weareinteractive.ntp
is an Ansible role which:
- installs ntp
- configures ntp
Note:
Since Ansible Galaxy supports organization now, this role has moved from
franklinkim.ntp
toweareinteractive.ntp
!
Using ansible-galaxy
:
$ ansible-galaxy install weareinteractive.ntp
Using requirements.yml
:
- src: weareinteractive.ntp
Using git
:
$ git clone https://github.com/weareinteractive/ansible-ntp.git weareinteractive.ntp
- Ansible >= 2.4
Here is a list of all the default variables for this role, which are also available in defaults/main.yml
.
---
# For more information about default variables see:
# http://www.ansibleworks.com/docs/playbooks_variables.html#id26
#
# package name (version)
ntp_package: ntp
# list of server
ntp_servers:
- 0.ubuntu.pool.ntp.org
- 1.ubuntu.pool.ntp.org
- 2.ubuntu.pool.ntp.org
- 3.ubuntu.pool.ntp.org
- ntp.ubuntu.com
# list of peer hosts (typically on the same network)
ntp_peers: []
# start on boot
ntp_service_enabled: yes
# current state: started, stopped
ntp_service_state: started
# drift file
ntp_driftfile: /var/lib/ntp/ntp.drift
# stats dir
ntp_statsdir: /var/log/ntpstats/
These are the handlers that are defined in handlers/main.yml
.
---
# For more information about handlers see:
# http://www.ansibleworks.com/docs/playbooks.html#handlers-running-operations-on-change
- name: restart ntp
service: name=ntp state=restarted
when: ntp_service_state != 'stopped'
This is an example playbook:
---
- hosts: all
roles:
- weareinteractive.ntp
vars:
ntp_servers:
- 0.de.pool.ntp.org
- 1.de.pool.ntp.org
- 3.de.pool.ntp.org
- 4.de.pool.ntp.org
ntp_peers:
- 127.0.0.4
$ git clone https://github.com/weareinteractive/ansible-ntp.git
$ cd ansible-ntp
$ make test
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Note: To update the README.md
file please install and run ansible-role
:
$ gem install ansible-role
$ ansible-role docgen
Copyright (c) We Are Interactive under the MIT license.