Skip to content

Ansible role for installing ntp on installs RHEL/CentOS or Debian/Ubuntu

License

Notifications You must be signed in to change notification settings

arillso/ansible.ntp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Role: NTP

Build Status license Ansible Galaxy Ansible Role

Description

The role configures and installs NTP under Linux and Windows. It is possible to specify multiple NTP servers for time synchronization. For Linux this is done via the NTP package, for Windows it is set up via the local GPO for the NTP synchronization.

Installation

ansible-galaxy install arillso.ntp

Requirements

This role require Ansible 2.7 or higher. The platform requirements are listed in the metadata file.

Role Variables

NTP Server

List of NTP servers for time synchronization. Special case if an inventory group NAS is present it will be taken as the first NTP server.

ntp_server:
  - "{{ groups['NAS'] | default('0.pool.ntp.org') }}"
  - '1.pool.ntp.org'
  - '2.pool.ntp.org'
  - '3.pool.ntp.org'

Linux

Restrictions

Restrictions are used to control access to your ntpd:

ntp_config_restrict:
  - '-4 default kod notrap nomodify nopeer noquery'
  - '-6 default kod notrap nomodify nopeer noquery'
  - '127.0.0.1'
  - '::1'

Listen

Specifies to which interface NTP should be appended:

ntp_config_listen: []

More

NTP configurations details:

ntp_config_filegen:
- 'loopstats file loopstats type day enable'
- 'peerstats file peerstats type day enable'
- 'clockstats file clockstats type day enable'

  ntp_config_statistics: 'loopstats peerstats clockstats'
  ntp_config_crypto: ''
  ntp_config_includefile: ''
  ntp_config_keys: ''
  ntp_config_trustedkey: ''
  ntp_config_requestkey: ''
  ntp_config_controlkey: ''
  ntp_config_broadcast: ''
  ntp_config_broadcastclient: ''
  ntp_config_multicastclient: ''
  ntp_config_tinker_panic_enabled: ''

Windows

Specifies if the time server is configured via Windows GPO so that it is not permanently overwritten.

GPO

ntp_GPO_enable: '{{ default_GPO_enable | default(false) }}'

NTP Settings

Possible settings are described under the following link

ntp_time_type: 'NTP'
ntp_crosssitesyncflags: '2'
ntp_resolvepeerbackoffminutes: '15'
ntp_resolvepeerbackoffmaxtimes: '7'
ntp_specialpollinterval: '1024'
ntp_eventlogflags: '0'

NTP Flags

Possible NTP flags that can be used under windows. 0x01 SpecialInterval 0x02 UseAsFallbackOnly 0x04 SymmatricActive 0x08 Client

ntp_flag: '0x01'

Dependencies

None

Author

License

This project is under the MIT License. See the LICENSE file for the full license text.

Copyright

(c) 2020, Arillso

About

Ansible role for installing ntp on installs RHEL/CentOS or Debian/Ubuntu

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published