--- - hosts: localhost tasks: - name: install chrony yum: name: chrony state: present - name: config time server copy: src: chrony/chrony.conf dest: /etc/chrony.conf - name: disable chrony ipv6 copy: src: chrony/chronyd dest: /etc/sysconfig/chronyd #replace: # path: /etc/sysconfig/chronyd # regexp: '^OPTIONS=""' # replace: 'OPTIONS="-4"' - name: start and active service chronyd systemd: name: chronyd enabled: true state: started