This Ansible role configures the system time using ntp (network time protocol).
- None
- See meta info
- Add a similar line to your Ansible playbook's role section as shown below:
roles:
- { role: ansible-time, time_ntp_config_server_list: [ 'time1.mydomain.com', 'time2.mydomain.com' ] }
- Or with tags:
roles:
- { role: ansible-time, time_ntp_config_server_list: [ 'time1.mydomain.com', 'time2.mydomain.com' ], tags: [ 'ntp', 'time' ] }
- site.yml:
- hosts: servers
vars_files:
- vars/main.yml
roles:
- { role: ansible-time }
- vars/main.yml:
time_zoneinfo: Europe/Zurich
The following Ansible tags allow to run this role more granular.
Tag | Description |
---|---|
config | Applies all the configuration and restarts affected services to make sure the new config is being loaded |
service | Enables the required service(s) |
package | Makes sure required packages are installed |
ntp | Runs everything related to the ntp setup and config |
timezone | Runs everything related to the timezone setup and config |
See defaults.