added chrony salt state
This commit is contained in:
parent
4020121517
commit
cb7abf7c82
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
salt/pillars/local.sls
|
6
salt/pillars/chrony.sls
Normal file
6
salt/pillars/chrony.sls
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
chrony:
|
||||||
|
pool:
|
||||||
|
- 0.se.pool.ntp.org
|
||||||
|
- 1.se.pool.ntp.org
|
||||||
|
- 2.se.pool.ntp.org
|
||||||
|
- 3.se.pool.ntp.org
|
8
salt/pillars/network.sls
Normal file
8
salt/pillars/network.sls
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
network:
|
||||||
|
domain: suse.lan
|
||||||
|
address: 192.168.0.0
|
||||||
|
netmask: 24
|
||||||
|
|
||||||
|
interface:
|
||||||
|
internal: eth0
|
||||||
|
external: eth0.1000
|
7
salt/pillars/top.sls
Normal file
7
salt/pillars/top.sls
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
base:
|
||||||
|
'*':
|
||||||
|
- network
|
||||||
|
- chrony
|
||||||
|
{% if salt['file.file_exists']('local.sls') %}
|
||||||
|
- local
|
||||||
|
{% endif %}
|
2
salt/states/chrony/files/local.conf.jinja
Normal file
2
salt/states/chrony/files/local.conf.jinja
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
local stratum 10
|
||||||
|
allow {{ pillar['network']['address'] }}/{{ pillar['network']['netmask'] }}
|
3
salt/states/chrony/files/pool.conf.jinja
Normal file
3
salt/states/chrony/files/pool.conf.jinja
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{% for pool in pillar['chrony']['pool'] -%}
|
||||||
|
server {{ pool }} iburst
|
||||||
|
{% endfor %}
|
31
salt/states/chrony/init.sls
Normal file
31
salt/states/chrony/init.sls
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
install chrony:
|
||||||
|
pkg.installed:
|
||||||
|
- name: chrony
|
||||||
|
|
||||||
|
create chrony pool configuration:
|
||||||
|
file.managed:
|
||||||
|
- name: /etc/chrony.d/pool.conf
|
||||||
|
- source: salt://chrony/files/pool.conf.jinja
|
||||||
|
- template: jinja
|
||||||
|
- user: root
|
||||||
|
- group: chrony
|
||||||
|
- mode: "0640"
|
||||||
|
|
||||||
|
create chrony local configuration:
|
||||||
|
file.managed:
|
||||||
|
- name: /etc/chrony.d/local.conf
|
||||||
|
- source: salt://chrony/files/local.conf.jinja
|
||||||
|
- template: jinja
|
||||||
|
- user: root
|
||||||
|
- group: chrony
|
||||||
|
- mode: "0640"
|
||||||
|
|
||||||
|
start chronyd:
|
||||||
|
service.running:
|
||||||
|
- name: chronyd
|
||||||
|
- enable: True
|
||||||
|
- require:
|
||||||
|
- pkg: install chrony
|
||||||
|
- watch:
|
||||||
|
- file: create chrony pool configuration
|
||||||
|
- file: create chrony local configuration
|
3
salt/states/top.sls
Normal file
3
salt/states/top.sls
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
base:
|
||||||
|
'*':
|
||||||
|
- chrony
|
Loading…
Reference in New Issue
Block a user