j-vanwijk / ansible_role_chrony

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

1. Chrony

Managing network time with Ansible using chrony.

Build Status

1.1. License

MIT / BSD

1.2. Author Information

1.3. Requirements

  • Ensure a package manager is available and configured with the correct package sources and repositories.
  • Ensure privileged permissions are set for the user executing this role to:
    • Install and uninstall.
    • Edit files provided by the package itself.
    • Manage systemd services for ntpd and chronyd.
  • Ensure network traffic over 123/udp (port/protocol) is allowed.
    • Outbound for any servers providing NTP.
    • Inbound for any clients retrieving NTP.

1.4. Dependencies

N/A

1.5. Compatibility

Compatible with the following list of operating systems:

  • CentOS 7
  • CentOS 8
  • RHEL 7.x
  • RHEL 8.x

1.6. Role Variables

Variable name Description
role_chrony_chrony_dot_conf_parameters A dictionary containing the chrony configuration.
role_chrony_required_packages A list of packages that need to be installed for chrony to work properly.
role_chrony_time_zone The timezone to set.

1.7. Example Playbook

---
- name: Manage the installation and configuration of chrony for NTP
  become: True
  gather_facts: False
  roles:
   - role: chrony

...

1.8. Useful shell commands

chronyc tracking
chronyc sources
chronyc sourcestats

1.9. Additional chrony documentation resources

The following links provide more information about chrony and it's usage.

1.10. Testing with Molecule

This role is locally tested with the use of Molecule, the configuration is located at: molecule/default.
The Molecule tests are run (using the docker driver) on Dockerhub images built for this purpose:

Some specific configurations might require a full OS instead of a minimal container image. In these use-cases make use of molecule driver for vagrant with the libvirt provider. The Molecule driver and platform configuration part could look something like this:

driver:
  name: vagrant
  provider:
    name: libvirt
platforms:
  - name: ansible_role_chrony-ansible-molecule-centos-7
    box: centos/7
    imemory: 1024
    cpus: 1

1.11. CI/CD with Travis CI

This role uses Travis CI to run online tests with the use of Molecule and pushes notifications to import the role into Ansible Galaxy once the tests are successful. The Travis CI configuration is located at the root of the Ansible role .travis.yml

1.12. Useful links

About