Skip to content

bodsch/ansible-chrony

Repository files navigation

Ansible Role: chrony

Ansible role to install and configure chrony on various linux systems.

GitHub Workflow Status GitHub issues GitHub release (latest by date) Ansible Quality Score

Requirements & Dependencies

Ansible Collections

ansible-galaxy collection install bodsch.core
ansible-galaxy collection install bodsch.systemd

or

ansible-galaxy collection install --requirements-file collections.yml

Operating systems

Tested on

  • Arch Linux
  • Debian based
    • Debian 10 / 11 / 12
    • Ubuntu 20.10 / 22.04

RedHat-based systems are no longer officially supported! May work, but does not have to.

Configuration

chrony_service: {}

chrony_config: {}

chrony_daemon_args: {}

defaults

chrony_service:
  name: chrony
  executable: /usr/sbin/chronyd
  state: started
  enable: true

chrony_config:
  conf_directory: /etc/chrony/conf.d
  log:
    types: []
    #  - tracking
    #  - measurements
    #  - statistics
    directory: /var/log/chrony
  drift_file: /var/lib/chrony/chrony.drift
  key_file: /etc/chrony/chrony.keys
  nts_dump_directory: /var/lib/chrony
  source_directories: []
  #  - /run/chrony-dhcp
  #  - /etc/chrony/sources.d
  ntp_servers: []
  ntp_pools:
    - pool.ntp.org iburst maxpoll 10
  ntp_peers: []
  makestep:
    threshold: 1
    limit: 10
  rtc:
    sync: true
    on_utc: true
  leap_sec_tz: right/UTC
  bind_cmd_addresses:
    - 127.0.0.1
    - ::1
  allow: []
  deny: []

chrony_daemon_args:
  # -4
  use_ipv4_only: ""  # | true / false
  # -6
  use_ipv6_only: ""  # | true / false
  # -n
  run_as_daemon: ""  # | true / false
  # -d
  run_as_daemon_and_log_to_stderr: ""  # | true / false
  # -L level
  # 0 (informational), 1 (warning), 2 (non-fatal error), and 3 (fatal error)
  logging_threshold: 0  # | 0
  # -r
  reload_dump_files: true
  # -F level
  # Three levels are defined: 0, 1, 2.
  seccomp_filter_level: 2
  # -P priority
  process_priority: 0
  # -m
  lock_memory: ""  # | true / false
  # -x
  control_clock: ""  # | true / false
  # -u USER       Specify user (_chrony)
  run_as_user: "{{ chrony_user }}"
  # -U
  dont_check_for_root: ""  # | true / false

example

Contribution

Please read Contribution

Development, Branches (Git Tags)

The master Branch is my Working Horse includes the "latest, hot shit" and can be complete broken!

If you want to use something stable, please use a Tagged Version!

Author

  • Bodo Schulz

License

Apache

FREE SOFTWARE, HELL YEAH!