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
2018-12-28 13:00:01 +01:00
defaults ansible-galaxy init 2018-12-28 10:49:24 +01:00
handlers ansible-galaxy init 2018-12-28 10:49:24 +01:00
meta add OpenBSD support 2018-12-28 12:37:38 +01:00
tasks update debian and gentoo cache before installing ntp daemon 2018-12-28 13:00:01 +01:00
tests add FreeBSD support 2018-12-28 12:26:05 +01:00
vars add OpenBSD support 2018-12-28 12:37:38 +01: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 add FreeBSD support 2018-12-28 12:26:05 +01:00
.travis.yml .kitchen-vagrant.yml 2018-12-28 12:06:26 +01:00
Gemfile add Gmefile and gitignore 2018-12-28 11:16:57 +01:00
LICENSE Initial commit 2018-12-28 10:46:40 +01:00
README.md add OpenBSD support 2018-12-28 12:37:38 +01:00

ansible-role-ntp

Build Status Ansible Galaxy

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

Requirements

This role was developed using Ansible 2.4 Backwards compatibility is not guaranteed. Use ansible-galaxy install diodonfrost.ntp to install the role on your system.

Supported platforms:

- name: EL
  versions:
    - 7
    - 6
    - 5
- name: Fedora
  versions:
    - 29
    - 28
    - 27
    - 26
- name: Debian
  versions:
    - stretch
    - jessie
    - wheezy
    - squeeze
- name: Ubuntu
  versions:
    - bionic
    - xenial
    - trusty
    - precise
    - trusty
- name: OracleLinux
  versions:
    - 7
    - 6
- name: Amazon
  versions:
    - 2017.12
    - 2016.03
    - 2013.09
- name: opensuse
  versions:
    - 13.2
    - 42.1
    - 42.2
    - 42.3
- name: SLES
  versions:
    - 11
    - 12
    - 15
- name: ArchLinux
  versions:
    - any
- name: Gentoo
  versions:
    - stage3
- name: FreeBSD
  versions:
    - 11.2
    - 10.4
    - 10.3
- name: OpenBSD
  versions:
    - 6.0
    - 6.4

Role Variables

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

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

Dependencies

None

Example Playbook

This is a sample playbook file for deploying the Ansible Galaxy ntp role in a localhost.

---
- hosts: localhost
  become: true
  roles:
    - role: diodonfrost.ntp

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.