ceph-ansible/roles/ceph-infra/tasks/ntp_debian.yml

41 lines
910 B
YAML

---
- name: setup ntpd
block:
- name: timedatectl set-ntp no
command: timedatectl set-ntp no
- name: install ntp
package:
name: ntp
state: present
register: result
until: result is succeeded
- name: start ntp
service:
name: ntp
enabled: yes
state: started
when: ntp_daemon_type == "ntpd"
- name: setup chrony
block:
- name: timedatectl set-ntp no
command: timedatectl set-ntp no
- name: install chrony
package:
name: chrony
state: present
register: result
until: result is succeeded
- name: start chronyd
service:
name: chronyd
enabled: yes
state: started
when: ntp_daemon_type == "chronyd"
- name: setup timesyncd
block:
- name: timedatectl set-ntp on
command: timedatectl set-ntp on
when: ntp_daemon_type == "timesyncd"