robertdebock.ntp
Ansible Role NTP
This guide helps you install and set up NTP (Network Time Protocol) on your system.
GitHub | GitLab | Downloads | Version |
---|---|---|---|
Example Playbook
Here’s a simple playbook to demonstrate how to use the NTP role. This example is found in molecule/default/converge.yml
and is tested for every push, pull request, and release.
---
- name: Converge
hosts: all
become: true
gather_facts: true
roles:
- role: robertdebock.cron
- role: robertdebock.ntp
ntp_state: stopped
To prepare your machine, you can refer to molecule/default/prepare.yml
:
---
- name: Prepare
hosts: all
become: true
gather_facts: false
roles:
- role: robertdebock.bootstrap
You can also check this complete guide with examples for using these roles.
Role Variables
You can find the default values for the NTP variables in defaults/main.yml
:
---
# Default settings for NTP
# Current state of the NTP service.
ntp_state: started
# Should the NTP service start at boot?
ntp_enabled: true
# List of IP addresses to listen to.
ntp_interfaces:
- address: "127.0.0.1"
# List of NTP pools and their options.
ntp_pool:
- name: "0.pool.ntp.org iburst"
- name: "1.pool.ntp.org iburst"
- name: "2.pool.ntp.org iburst"
- name: "3.pool.ntp.org iburst"
# The timezone used for the NTP service.
ntp_timezone: Etc/UTC
Requirements
You need the pip packages listed in requirements.txt.
State of Used Roles
The following roles help prepare your system, but you can set it up differently if needed.
Requirement | GitHub | GitLab |
---|---|---|
robertdebock.bootstrap | ||
robertdebock.cron |
Context
This role is part of a collection of compatible roles. For more information, check the documentation for these roles.
Here's a visual of the related roles:
Compatibility
This role has been tested on the following container images:
Container | Tags |
---|---|
Amazon | Candidate |
EL | 9 |
Debian | All |
Fedora | All |
Ubuntu | All |
You need at least Ansible version 2.12. Tests were conducted on:
- The previous version.
- The latest version.
- The development version.
If you encounter any problems, please report them on GitHub.
License
This project is licensed under Apache-2.0.
Author Information
Created by robertdebock.
If you like this work, please consider sponsoring me.
ansible-galaxy install robertdebock.ntp