2023-10-28 16:47:54 +02:00
[![Ansible Galaxy ](https://ansible.l3d.space/svg/l3d.ntp.svg )](https://galaxy.ansible.com/ui/standalone/roles/l3d/ntp/)
2023-04-20 23:06:34 +02:00
[![BSD-3 Clause ](https://ansible.l3d.space/svg/l3d.ntp_license.svg )](LICENSE)
[![Maintainance ](https://ansible.l3d.space/svg/l3d.ntp_maintainance.svg )](https://ansible.l3d.space/#l3d.ntp)
2018-12-28 10:49:24 +01:00
2021-09-27 00:14:59 +02:00
Ansible role ntp
======================
2019-05-17 16:35:30 +02:00
2021-09-27 00:14:59 +02:00
Ansible role to install and configure the Network Time Protocol (NTP) Daemon.
2018-12-28 10:49:24 +01:00
2021-09-27 00:14:59 +02:00
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.
2019-05-17 16:35:30 +02:00
2018-12-28 11:54:06 +01:00
## Role Variables
2018-12-28 10:49:24 +01:00
2021-09-27 00:14:59 +02:00
In addition to the operating system-dependent variables, there are the following default values to adjust:
2018-12-28 10:49:24 +01:00
2018-12-28 11:54:06 +01:00
```yaml
---
# defaults file for ansible-role-ntp
2018-12-28 10:49:24 +01:00
2018-12-28 15:27:57 +01:00
# 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:
2021-09-27 00:14:59 +02:00
- ptbtime1.ptb.de
- ptbtime3.ptb.de
2018-12-28 15:27:57 +01:00
- 0.pool.ntp.org iburst
- 1.pool.ntp.org iburst
- 2.pool.ntp.org iburst
- 3.pool.ntp.org iburst
2022-11-17 00:02:19 +01:00
# optionally set timezone
ntp_set_time_zone: false
ntp_timezone: 'Europe/Berlin'
2023-11-28 03:05:59 +01:00
# Leap seconds definition provided by tzdata
ntp_leap: true
ntp_leapfile: '/usr/share/zoneinfo/leap-seconds.list'
2018-12-28 15:27:57 +01:00
# Enable or disable ntp statistics
ntp_statistics: false
2021-09-27 00:14:59 +02:00
# version check for this playbook (true is recomended)
submodules_versioncheck: false
2018-12-28 11:54:06 +01:00
```
2018-12-28 10:49:24 +01:00
2023-04-20 23:06:34 +02:00
## Example Usage
### Getting this Role
You can install this role using ansible Galaxy:
```bash
ansible-galaxy install l3d.ntp
```
Or download or clone this git repo. Example:
```bash
git clone https://github.com/roles-ansible/ansible_role_ntp.git l3d.ntp
```
### Using this role in a Playbook
```yml
---
- 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.
```
2018-12-28 11:54:06 +01:00
## Resources
[ntp on ubuntu ](https://doc.ubuntu-fr.org/ntp )
2023-10-28 16:47:54 +02:00
## Requirements
The ``community.general`` collection is required for some parts of this ansible role.
You can install it with this command:
```bash
ansible-galaxy collection install -r requirements.yml --upgrade
```
2023-11-28 03:05:59 +01:00
## Testing
This role is tested on debian stable. It should work on other operating systems. Please Report issues if it does not work.
2018-12-28 11:54:06 +01:00
## Author Information
2023-04-20 23:06:34 +02:00
+ This role was created in 2018 by diodonfrost.
+ This role was updated and maintained since 2019 by L3D *([DO1JLR](https://github.com/do1jlr))*
+ In 2023 this role moved from ``do1jlr.ntp`` to ``l3d.ntp`` Namespace.
2021-03-19 19:21:29 +01:00
2022-11-17 00:02:19 +01:00
## 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.