123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- ---
- - name: Deploy ntp servers
- block:
- - name: Deploy ntpd
- package:
- name: ntp
- state: present
- - name: Deploy ntpdate
- package:
- name: ntpdate
- state: present
- - name: Update ntp servers
- template:
- src: ntp.conf.j2
- dest: "{{ ntp_path }}"
- owner: root
- group: root
- mode: "{{ ntp_mode }}"
- backup: yes
- notify:
- - Restart ntpd
- - Sync tp clocks
- when: ( ansible_distribution == "CentOS" or ansible_distribution == "RedHat" ) and ansible_distribution_major_version < os_higher_version
- - name: Deploy chrony server
- block:
- - name: Deploy chrony
- package:
- name: chrony
- state: present
- - name: Update ntp servers
- template:
- src: chrony.conf.j2
- dest: "{{ chrony_path }}"
- owner: root
- group: root
- mode: "{{ ntp_mode }}"
- backup: yes
- notify:
- - Restart chrony
- - Sync chrony sources
- when: (( ansible_distribution == "CentOS" or ansible_distribution == "RedHat" ) and ansible_distribution_major_version > os_version) or
- ( os_supported_leap in compute_os ) and ( ansible_distribution_version >= os_supported_leap_version )
|