This roles installs and configures NTP, it will also set the timezone.
This role has no dependencies.
To install run ansible-galaxy install sansible.ntp
or add
this to your roles.yml
- src: sansible.ntp
version: v2.0
and run ansible-galaxy install -p ./roles -r roles.yml
This role uses two tags: build, configure
build
- Install NTPconfigure
- Configures timezone and enable NTP
Simple example for enabling NTP and setting timezone to Europe/London
- name: Install and setup NTP
hosts: sandbox
roles:
- name: sansible.ntp
sansible_ntp_timezone: Europe/London
Example of using a different set of NTP servers (AWS servers are used by default):
- name: Install and setup NTP
hosts: sandbox
roles:
- name: sansible.ntp
sansible_ntp_servers:
- 0.ubuntu.pool.ntp.org
- 1.ubuntu.pool.ntp.org
- 2.ubuntu.pool.ntp.org
- 3.ubuntu.pool.ntp.org