refs #8280 fix timesync conditions, move grub to qemu

This commit is contained in:
Juan Ferrer 2024-12-10 15:25:40 +01:00
parent ffc7963fca
commit 67f01fd74c
4 changed files with 30 additions and 25 deletions

View File

@ -32,5 +32,3 @@
tags: bacula
- import_tasks: vn-repo.yml
tags: vn-repo
- import_tasks: grub_startup.yml
tags: grub_startup

View File

@ -1,23 +1,28 @@
- name: Ensure directory for timesyncd custom configuration exists
file:
path: /etc/systemd/timesyncd.conf.d/
state: directory
owner: root
group: root
mode: u=rwx,g=rx,o=rx
- name: Configure NTP settings in /etc/systemd/timesyncd.conf.d/vn-ntp.conf
copy:
dest: /etc/systemd/timesyncd.conf.d/vn-ntp.conf
content: |
[Time]
NTP={{ time_server }}
FallbackNTP={{ time_server_spain }}
owner: root
group: root
mode: u=rw,g=r,o=r
notify: restart systemd-timesyncd
- name: Ensure systemd-timesyncd service is enabled and started
service:
name: systemd-timesyncd
enabled: yes
state: started
- name: Getting service facts to check for timesyncd
service_facts:
- when: "'systemd-timesyncd.service' in ansible_facts.services"
block:
- name: Ensure directory for timesyncd custom configuration exists
file:
path: /etc/systemd/timesyncd.conf.d/
state: directory
owner: root
group: root
mode: u=rwx,g=rx,o=rx
- name: Configure timesyncd service
copy:
dest: /etc/systemd/timesyncd.conf.d/vn-ntp.conf
content: |
[Time]
NTP={{ time_server }}
FallbackNTP={{ time_server_spain }}
owner: root
group: root
mode: u=rw,g=r,o=r
notify: restart systemd-timesyncd
- name: Ensure timesyncd service is enabled and started
when: "ansible_facts.services['systemd-timesyncd.service'].status == 'enabled'"
service:
name: systemd-timesyncd
enabled: yes
state: started

View File

@ -6,3 +6,5 @@
tags: autofs
- import_tasks: blacklist.yml
tags: blacklist
- import_tasks: grub_startup.yml
tags: grub_startup