added chrony salt state

This commit is contained in:
Jonas Forsberg
2021-09-22 09:49:42 +02:00
parent 4020121517
commit cb7abf7c82
8 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
local stratum 10
allow {{ pillar['network']['address'] }}/{{ pillar['network']['netmask'] }}

View File

@@ -0,0 +1,3 @@
{% for pool in pillar['chrony']['pool'] -%}
server {{ pool }} iburst
{% endfor %}

View 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
View File

@@ -0,0 +1,3 @@
base:
'*':
- chrony