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
2019-06-07 17:49:33 +02:00
.github Update founding infos 2019-06-07 17:49:33 +02:00
defaults Update time 2019-06-05 15:38:18 +02:00
handlers Run commands as admin 2019-03-04 17:35:28 +01:00
meta remove unknown os from list 2019-05-17 17:24:39 +02:00
tasks Improve error handling 2019-06-03 09:47:18 +02:00
templates Update time 2019-06-05 15:38:18 +02:00
tests update ansible role 2019-01-22 11:47:43 +01:00
vars Update time 2019-06-05 15:38:18 +02:00
.ansible-lint start improving role 2019-05-17 16:25:17 +02:00
.gitignore add Gmefile and gitignore 2018-12-28 11:16:57 +01:00
.kitchen-vagrant.yml add FreeBSD support 2018-12-28 12:26:05 +01:00
.kitchen.yml remove duplicate provision_command in kitchen-ci 2019-01-31 10:38:56 +01:00
.travis.yml remove deprecated from test 2019-05-17 17:13:48 +02:00
Gemfile add Gmefile and gitignore 2018-12-28 11:16:57 +01:00
LICENSE Update supported devices and Licence 2019-05-17 16:35:30 +02:00
README.md Update supported devices and Licence 2019-05-17 16:35:30 +02:00

Ansible role: ntp

Build Status

This role provide a compliance for install ntp on your target host.

Requirements

This role was developed using Ansible 2.7 Backwards compatibility is not guaranteed.

Please have a look into the meta file for supportet platform overview!

Please note: It could need some fixes on exotic untested devices!

Role Variables

This role has multiple variables. The defaults for all these variables are the following:

---
# 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:
  - 0.pool.ntp.org iburst
  - 1.pool.ntp.org iburst
  - 2.pool.ntp.org iburst
  - 3.pool.ntp.org iburst

# Enable or disable ntp statistics
# Default is false
ntp_statistics: false

Local Testing

The preferred way of locally testing the role is to use Docker. You will have to install Docker on your system.

You can also use vagrant and Virtualbox with vagrant to run tests locally. You will have to install Virtualbox and Vagrant on your system. For all our tests we use test-kitchen.

Next install test-kitchen:

# Install dependencies
gem install bundler
bundle install

Testing with Docker

# List all tests with kitchen
kitchen list

# fast test on one machine
kitchen test default-centos-7

# test on all machines
kitchen test

# for development, create environment
kitchen create default-centos-7

# Apply ansible playbook
kitchen converge default-centos-7

# Apply inspec tests
kitchen verify default-centos-7

Testing with Virtualbox

# Specify kitchen file on Linux
export KITCHEN_YAML=.kitchen-vagrant.yml

# fast test on one machine
kitchen test os-packaging-freebsd-112

Testing Windows and Solaris with Virtualbox

Windows and Solaris can only be test with Virtualbox provider,do not use 'kitchen test' command for testing Windows and Solaris environment. There 4 steps you will be using with test-kitchen as part of your workflow.

First of all we must set the kitchen file:

# For testing Windows
export KITCHEN_YAML=.kitchen-windows.yml

# For testing Solaris
export KITCHEN_YAML=.kitchen-solaris.yml

Provision the virtual machines, a Linux machine to run Ansible and Windows/Solaris machines to apply playbook again:

# deploy machines
kitchen create

# Launch playbook
kitchen converge

Finaly launch inspec tests:

kitchen verify

For cleaning environment use:

kitchen destroy

License

Apache 2

Resources

ntp on ubuntu

Author Information

This role was created in 2018 by diodonfrost. This role was updated in 2019 by L3D