diff options
author | Sam Chudnick <sam@chudnick.com> | 2023-06-25 09:52:36 -0400 |
---|---|---|
committer | Sam Chudnick <sam@chudnick.com> | 2023-06-25 09:52:36 -0400 |
commit | 95b73daa36b23565a8566f71f9b202d3459b685f (patch) | |
tree | cb17b021be70e7868d0ec235a761f0ecdc80f3f2 /roles/services/chronyd |
Diffstat (limited to 'roles/services/chronyd')
-rw-r--r-- | roles/services/chronyd/handlers/main.yml | 4 | ||||
-rw-r--r-- | roles/services/chronyd/tasks/main.yml | 30 |
2 files changed, 34 insertions, 0 deletions
diff --git a/roles/services/chronyd/handlers/main.yml b/roles/services/chronyd/handlers/main.yml new file mode 100644 index 0000000..7e6f687 --- /dev/null +++ b/roles/services/chronyd/handlers/main.yml | |||
@@ -0,0 +1,4 @@ | |||
1 | - name: restart chronyd | ||
2 | service: | ||
3 | name: chronyd | ||
4 | state: restarted | ||
diff --git a/roles/services/chronyd/tasks/main.yml b/roles/services/chronyd/tasks/main.yml new file mode 100644 index 0000000..73fdc28 --- /dev/null +++ b/roles/services/chronyd/tasks/main.yml | |||
@@ -0,0 +1,30 @@ | |||
1 | - name: install packages | ||
2 | package: | ||
3 | name: chrony | ||
4 | state: latest | ||
5 | |||
6 | - name: deploy chrony configuration | ||
7 | when: ansible_facts['distribution'] == 'Debian' | ||
8 | notify: restart chronyd | ||
9 | copy: | ||
10 | src: "{{ chrony_config }}" | ||
11 | dest: /etc/chrony/chrony.conf | ||
12 | owner: root | ||
13 | group: root | ||
14 | mode: '0644' | ||
15 | |||
16 | - name: deploy chrony configuration | ||
17 | when: ansible_facts['distribution'] == 'Fedora' | ||
18 | notify: restart chronyd | ||
19 | copy: | ||
20 | src: "{{ chrony_config }}" | ||
21 | dest: /etc/chrony.conf | ||
22 | owner: root | ||
23 | group: root | ||
24 | mode: '0644' | ||
25 | |||
26 | - name: make sure chronyd is enabled | ||
27 | systemd: | ||
28 | name: chronyd | ||
29 | enabled: yes | ||
30 | masked: no | ||