Refs #8025 Rol debian-base. Task timesync systemd fix, vars add to defaults, refactor handlers
This commit is contained in:
parent
616beda4b7
commit
d14b123219
|
@ -8,3 +8,4 @@ fail2ban:
|
|||
vn_host:
|
||||
url: http://apt.verdnatura.es/pool/main/v/vn-host
|
||||
package: vn-host_2.0.2_all.deb
|
||||
time_server_spain: ntp.roa.es
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
- name: restart-timesyncd
|
||||
service:
|
||||
- name: restart systemd-timesyncd
|
||||
systemd:
|
||||
name: systemd-timesyncd
|
||||
state: restarted
|
||||
- name: restart-ssh
|
||||
service:
|
||||
systemd:
|
||||
name: ssh
|
||||
state: restarted
|
||||
- name: restart-fail2ban
|
||||
service:
|
||||
systemd:
|
||||
name: fail2ban
|
||||
state: restarted
|
||||
- name: restart-nrpe
|
||||
service:
|
||||
systemd:
|
||||
name: nagios-nrpe-server
|
||||
state: restarted
|
||||
- name: generate locales
|
||||
|
@ -19,4 +19,4 @@
|
|||
- name: reconfigure tzdata
|
||||
command: dpkg-reconfigure -f noninteractive tzdata
|
||||
- name: update exim configuration
|
||||
command: /usr/sbin/update-exim4.conf
|
||||
command: /usr/sbin/update-exim4.conf
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
- import_tasks: resolv.yml
|
||||
tags: resolv
|
||||
- import_tasks: timesync.yml
|
||||
tags: timesync
|
||||
- import_tasks: defuser.yml
|
||||
tags: defuser
|
||||
- import_tasks: install.yml
|
||||
|
|
|
@ -1,21 +1,23 @@
|
|||
- name: Configure /etc/systemd/timesyncd.conf
|
||||
lineinfile:
|
||||
path: /etc/systemd/timesyncd.conf
|
||||
regexp: '^#NTP'
|
||||
line: "NTP={{ time_server }}"
|
||||
- name: Ensure directory for timesyncd custom configuration exists
|
||||
file:
|
||||
path: /etc/systemd/timesyncd.conf.d/
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
- name: Configure /etc/systemd/timesyncd.conf
|
||||
lineinfile:
|
||||
path: /etc/systemd/timesyncd.conf
|
||||
regexp: '^#?FallbackNTP='
|
||||
line: "FallbackNTP=ntp.roa.es"
|
||||
mode: '0755'
|
||||
- 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: '0644'
|
||||
notify: restart systemd-timesyncd
|
||||
- name: Service should start on boot
|
||||
- name: Ensure systemd-timesyncd service is enabled and started
|
||||
service:
|
||||
name: systemd-timesyncd
|
||||
enabled: yes
|
||||
state: started
|
||||
|
|
Loading…
Reference in New Issue