ceuser@deyu:/ansible_pb$ vi timesync.yml
ceuser@deyu:/ansible_pb$ cat timesync.yml
---
- hosts: dev
vars:
timesync_ntp_servers:
- hostname: 192.168.122.1
iburst: yes
roles:
- rhel.system_roles.timesync
ceuser@deyu:/ansible_pb$ ansible-playbook timesync.yml
PLAY [dev] **********************************************************************
TASK [Gathering Facts] **********************************************************
ok: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Set version specific variables] *******
ok: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Populate service facts] ***************
[WARNING]: Unable to query 'service' tool (1):
ok: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Set variable `timesync_services` with filtered uniq service names] ***
ok: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Check that variable 'timesync_services' is defined] ***
ok: [kvm11] => {
"changed": false,
"msg": "All assertions passed"
}
TASK [redhat.rhel_system_roles.timesync : Check if only NTP is needed] **********
ok: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Check if single PTP is needed] ********
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Check if both NTP and PTP are needed] ***
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Determine current NTP provider] *******
ok: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Select NTP provider] ******************
ok: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Install chrony] ***********************
ok: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Install ntp] **************************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Install linuxptp] *********************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Gather package facts] *****************
ok: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Run phc_ctl on PTP interface] *********
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Check if PTP interface supports HW timestamping] ***
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Generate chrony.conf file] ************
changed: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Generate chronyd sysconfig file] ******
changed: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Generate ntp.conf file] ***************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Generate ntpd sysconfig file] *********
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Generate ptp4l.conf file] *************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Generate ptp4l sysconfig file] ********
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Generate phc2sys sysconfig file] ******
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Generate timemaster.conf file] ********
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Update network sysconfig file] ********
changed: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Disable chronyd] **********************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Disable ntpd] *************************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Disable ntpdate] **********************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Disable sntp] *************************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Disable ptp4l] ************************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Disable phc2sys] **********************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Disable timemaster] *******************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Enable chronyd] ***********************
ok: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Enable ntpd] **************************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Enable ptp4l] *************************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Enable phc2sys] ***********************
skipping: [kvm11]
TASK [redhat.rhel_system_roles.timesync : Enable timemaster] ********************
skipping: [kvm11]
RUNNING HANDLER [redhat.rhel_system_roles.timesync : restart chronyd] ***********
changed: [kvm11]
PLAY RECAP **********************************************************************
kvm11 : ok=15 changed=4 unreachable=0 failed=0 skipped=23 rescued=0 ignored=0
ceuser@deyu:/ansible_pb$ ansible dev -m shell -a "grep ^server /etc/chrony.conf" kvm11 | CHANGED | rc=0 >> server 192.168.122.1 iburst