1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- ---
- - 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
|