Kapitel 10: Chrony mit Handler
This commit is contained in:
parent
c2e7716fe1
commit
e5a5d1c94c
1
10/chrony.conf.j2
Symbolic link
1
10/chrony.conf.j2
Symbolic link
|
@ -0,0 +1 @@
|
|||
../05/chrony.conf.j2
|
24
10/chrony_mit_handler.yml
Normal file
24
10/chrony_mit_handler.yml
Normal file
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
- hosts: all
|
||||
|
||||
tasks:
|
||||
|
||||
- name: Install Chrony
|
||||
package: name=chrony state=latest
|
||||
notify: Restart Chrony
|
||||
|
||||
- name: Show pools
|
||||
debug: var=chrony_pools
|
||||
|
||||
- name: Template config file
|
||||
template: "src=chrony.conf.j2 dest='{{ chrony_config_path }}' mode=0644 owner=root group=root backup=yes"
|
||||
notify: Restart Chrony
|
||||
|
||||
- name: Enable Chrony at boot
|
||||
service: "name={{ chrony_service_name }} enabled=yes"
|
||||
|
||||
handlers:
|
||||
|
||||
- name: Restart Chrony
|
||||
service: "name='{{ chrony_service_name }}' state=restarted"
|
||||
|
1
10/old.ntp/ntp.conf.j2
Symbolic link
1
10/old.ntp/ntp.conf.j2
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../05/old.ntp/ntp.conf.j2
|
31
10/old.ntp/ntp_mit_handler.yml
Normal file
31
10/old.ntp/ntp_mit_handler.yml
Normal file
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
- hosts: all
|
||||
|
||||
tasks:
|
||||
|
||||
- name: Install NTP
|
||||
package:
|
||||
name: ntp
|
||||
state: latest
|
||||
|
||||
- name: Debug
|
||||
debug: var=ntp_servers
|
||||
|
||||
- name: Copy ntp.conf
|
||||
template:
|
||||
src: ntp.conf.j2
|
||||
dest: /etc/ntp.conf
|
||||
backup: yes
|
||||
notify: Restart NTP
|
||||
|
||||
- name: Enable NTP
|
||||
service:
|
||||
name: "{{ ntp_service_name }}"
|
||||
enabled: yes
|
||||
state: started
|
||||
|
||||
|
||||
handlers:
|
||||
- name: Restart NTP
|
||||
service: "name={{ ntp_service_name }} state=\"restarted\""
|
||||
|
Loading…
Reference in a new issue