1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_ntp.git synced 2024-08-16 12:59:49 +02:00
Ansible role for manage ntp on a large number of os
Find a file
dependabot[bot] 1191c064fc
Bump ansible-actions/yamllint-action from 0.0.1 to 0.0.2
Bumps [ansible-actions/yamllint-action](https://github.com/ansible-actions/yamllint-action) from 0.0.1 to 0.0.2.
- [Release notes](https://github.com/ansible-actions/yamllint-action/releases)
- [Commits](https://github.com/ansible-actions/yamllint-action/compare/v0.0.1...v0.0.2)

---
updated-dependencies:
- dependency-name: ansible-actions/yamllint-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-22 07:54:16 +00:00
.github Bump ansible-actions/yamllint-action from 0.0.1 to 0.0.2 2024-03-22 07:54:16 +00:00
defaults consider using ntpsec for Debian instead of ntp 2023-11-28 03:05:59 +01:00
handlers notify systemd on directory update 2023-11-28 03:49:51 +01:00
meta update ansible role namespace 2023-04-20 23:11:57 +02:00
tasks notify systemd on directory update 2023-11-28 03:49:51 +01:00
templates consider using ntpsec for Debian instead of ntp 2023-11-28 03:05:59 +01:00
vars change file premissions recursivly 2023-11-28 03:40:01 +01:00
.gitignore use modern ansible name scheme and remove travis 2021-03-12 13:20:58 +01:00
.yamllint add testing and improve linting 2021-03-12 13:26:34 +01:00
LICENSE Remove trailing whitespaces from LICENSE 2021-09-27 00:15:43 +02:00
README.md consider using ntpsec for Debian instead of ntp 2023-11-28 03:05:59 +01:00
requirements.yml improve linting and adding requirements 2023-10-28 16:47:54 +02:00

Ansible Galaxy BSD-3 Clause Maintainance

Ansible role ntp

Ansible role to install and configure the Network Time Protocol (NTP) Daemon.

This role was built with support for a variety of operating systems. Including Debian/Ubuntu, RHEL, Suse and Archlinux based Linux versions as well as FreeBSD, Darwin and OpenBSD.

Role Variables

In addition to the operating system-dependent variables, there are the following default values to adjust:

---
# defaults file for ansible-role-ntp

# Restrict acces on ntp server
# Default is: ::1, 127.0.0.1
ntp_restrict:
  - default nomodify notrap nopeer noquery
  - 127.0.0.1
  - ::1

# Ntp server to use for date synchronization
# Default is worldwide pool
ntp_servers:
  - ptbtime1.ptb.de
  - ptbtime3.ptb.de
  - 0.pool.ntp.org iburst
  - 1.pool.ntp.org iburst
  - 2.pool.ntp.org iburst
  - 3.pool.ntp.org iburst

# optionally set timezone
ntp_set_time_zone: false
ntp_timezone: 'Europe/Berlin'

# Leap seconds definition provided by tzdata
ntp_leap: true
ntp_leapfile: '/usr/share/zoneinfo/leap-seconds.list'

# Enable or disable ntp statistics
ntp_statistics: false

# version check for this playbook (true is recomended)
submodules_versioncheck: false

Example Usage

Getting this Role

You can install this role using ansible Galaxy:

ansible-galaxy install l3d.ntp

Or download or clone this git repo. Example:

git clone https://github.com/roles-ansible/ansible_role_ntp.git l3d.ntp

Using this role in a Playbook

---
- name: Install and Configure NTP
  hosts: example.com
  roles:
    - {role: l3d.ntp, tags: ntp}
  vars:
    submodules_versioncheck: true
    ntp_set_time_zone: true
    ntp_timezone: Zulu
    # In this example, we enabled optional version check
    # and set timezone to Zulu.

Resources

ntp on ubuntu

Requirements

The community.general collection is required for some parts of this ansible role. You can install it with this command:

ansible-galaxy collection install -r requirements.yml --upgrade

Testing

This role is tested on debian stable. It should work on other operating systems. Please Report issues if it does not work.

Author Information

  • This role was created in 2018 by diodonfrost.
  • This role was updated and maintained since 2019 by L3D (DO1JLR)
  • In 2023 this role moved from do1jlr.ntp to l3d.ntp Namespace.

Contribution

Pleas feel free to open a issue or (even better) create a Pull Request if there is a problem or you missing a feature or something like that.