Skip to content

while-true-do/ansible-role-chrony

Build Status

Ansible Role: chrony

| A role that installs chrony and configures it.

Motivation

chrony is a daemon which implements the Network Time Protocol (NTP).

Installation

Install from Ansible Galaxy

ansible-galaxy install while_true_do.chrony

Install from Github

git clone https://github.com/while-true-do/ansible-role-chrony.git while_true_do.chrony

Requirements

Used Modules:

Dependencies

None.

Role Variables

---
# defaults/main.yml

# for a complete set of options please have a look at
# man chrony.conf
# examples:
# "minpoll 6"  -> minimum polling interval
# "maxpoll 10" -> the maximum polling interval
# "iburst"     -> the interval between the first four polls
# options can be combined:
# "minpoll 6 maxpoll 10 iburst"
wtd_chrony_cfg_servers:
 - name: 0.centos.pool.ntp.org
   # options: "iburst"
 - name: 1.centos.pool.ntp.org
 - name: 2.centos.pool.ntp.org
 - name: 3.centos.pool.ntp.org

wtd_chrony_cfg_stratumweight: ""
wtd_chrony_cfg_driftfile: "/var/lib/chrony/drift"
wtd_chrony_cfg_rtcsync: true
wtd_chrony_cfg_makestep: "10 3"

wtd_chrony_cfg_allows: ""

wtd_chrony_cfg_local: false
wtd_chrony_cfg_local_stratum: "10"
wtd_chrony_cfg_local_distance: ""
wtd_chrony_cfg_local_orphan: ""

wtd_chrony_cfg_keyfile: "/etc/chrony.keys"

wtd_chrony_cfg_bindcmdaddresses: [ "127.0.0.1", "::1" ]

wtd_chrony_cfg_noclientlog: true
wtd_chrony_cfg_logchange: "0.5"
wtd_chrony_cfg_logdir: "/var/log/chrony"
# wtd_chrony_cfg_log: "measurements statistics tracking"
wtd_chrony_cfg_log: ""

Example Playbook

Simple Example:

- hosts: servers
  roles:
    - { role: while_true_do.chrony }

Advanced Example:

- hosts: servers
  roles:
    - { role: while_true_do.chrony, wtd_chrony_cfg_servers: [{ name: 0.centos.pool.ntp.org, options: "iburst" }, { name: 1.centos.pool.ntp.org }], wtd_chrony_cfg_logdir: '/var/log/chrony' }

Testing

All tests are located in test directory.

Basic testing:

bash ./tests/test-ansible.sh
bash ./tests/test-spelling.sh
bash ./tests/test-whitespace.sh

Contribute / Bugs

Thank you so much for considering to contribute. Every contribution helps us. We are really happy, when somebody is joining the hard work. Please have a look at the links first.

License

This work is licensed under a BSD License.

Author Information

Site: while-true-do.org

Mail: hello@while-true-do.org

Releases

No releases published

Packages

No packages published

Languages