feat: enable chrony-wait service
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
Robert Kaussow 2023-06-05 21:48:39 +02:00
parent 5ab2044b9c
commit c4f2ecaa9c
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
2 changed files with 31 additions and 1 deletions

View File

@ -5,6 +5,17 @@
name: chrony name: chrony
state: present state: present
- name: Create required directories
loop:
- name: /etc/systemd/system/time-sync.target.d
mode: "0755"
loop_control:
label: "{{ item.name }}"
file:
path: "{{ item.name }}"
state: directory
mode: "{{ item.mode }}"
- name: Deploy configuration file - name: Deploy configuration file
template: template:
src: etc/chrony.conf.j2 src: etc/chrony.conf.j2
@ -23,11 +34,26 @@
mode: 0644 mode: 0644
notify: __chrony_restart notify: __chrony_restart
- name: Ensure service is up and running - name: Deploy time-sync.target override file
template:
src: etc/systemd/system/time-sync.target.d/requires.conf.j2
dest: /etc/systemd/system/time-sync.target.d/requires.conf
owner: root
group: root
mode: 0644
notify: __chrony_restart
- name: Ensure chronyd is up and running
systemd: systemd:
name: chronyd.service name: chronyd.service
state: started state: started
daemon_reload: True daemon_reload: True
enabled: True enabled: True
- name: Ensure chrony-wait is enabled
systemd:
name: chrony-wait.service
daemon_reload: True
enabled: True
become: True become: True
become_user: root become_user: root

View File

@ -0,0 +1,4 @@
#jinja2: lstrip_blocks: True
{{ ansible_managed | comment }}
[Unit]
Requires=chrony-wait.service