Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Commit

Permalink
syntax cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Rene Moser committed Sep 15, 2014
1 parent c54c9fd commit 9c2aae0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 41 deletions.
45 changes: 22 additions & 23 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
---
ntp_pkg_state: installed
ntp_service_state: started
ntp_service_enabled: yes
ntp_pkg_state: 'installed'
ntp_service_state: 'started'
ntp_service_enabled: 'yes'

ntp_config_server: [0.pool.ntp.org, 1.pool.ntp.org, 2.pool.ntp.org, 3.pool.ntp.org]
ntp_config_server: [ '0.pool.ntp.org', '1.pool.ntp.org', '2.pool.ntp.org', '3.pool.ntp.org' ]
ntp_config_restrict:
- "-4 default kod notrap nomodify nopeer noquery"
- "-6 default kod notrap nomodify nopeer noquery"
- "127.0.0.1"
- "::1"
- '-4 default kod notrap nomodify nopeer noquery'
- '-6 default kod notrap nomodify nopeer noquery'
- '127.0.0.1'
- '::1'

ntp_config_listen:
- 127.0.0.1
- '127.0.0.1'

ntp_config_filegen:
- "loopstats file loopstats type day enable"
- "peerstats file peerstats type day enable"
- "clockstats file clockstats type day enable"
- '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: no
ntp_config_includefile: no
ntp_config_keys: no
ntp_config_trustedkey: no
ntp_config_requestkey: no
ntp_config_controlkey: no
ntp_config_broadcast: no
ntp_config_broadcastclient: no
ntp_config_multicastclient: no
ntp_config_statistics: 'loopstats peerstats clockstats'
ntp_config_crypto: 'no'
ntp_config_includefile: 'no'
ntp_config_keys: 'no'
ntp_config_trustedkey: 'no'
ntp_config_requestkey: 'no'
ntp_config_controlkey: 'no'
ntp_config_broadcast: 'no'
ntp_config_broadcastclient: 'no'
ntp_config_multicastclient: 'no'
20 changes: 9 additions & 11 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
---
- name: Add the OS specific variables
include_vars: "{{ ansible_os_family }}.yml"
tags: ["configuration","packages","service","ntp"]
include_vars: '{{ ansible_os_family }}.yml'
tags: [ 'configuration', 'package', 'service', 'ntp' ]

- name: Install the required packages in Redhat derivatives
yum: name={{ item }} state={{ ntp_pkg_state }}
with_items: ntp_pkgs
yum: name=ntp state={{ ntp_pkg_state }}
when: ansible_os_family == 'RedHat'
tags: ["packages","ntp"]
tags: [ 'package', 'ntp' ]

- name: Install the required packages in Debian derivatives
apt: name={{ item }} state={{ ntp_pkg_state }}
with_items: ntp_pkgs
apt: name=ntp state={{ ntp_pkg_state }}
when: ansible_os_family == 'Debian'
tags: ["packages","ntp"]
tags: [ 'package', 'ntp' ]

- name: Copy the ntp.conf template file
template: src=ntp.conf.j2 dest=/etc/ntp.conf
notify:
- restart ntp
tags: ["configuration","packages","ntp"]
tags: [ 'configuration', 'package', 'ntp' ]

- name: Start/stop ntp service
service: name={{ ntp_service_name }} state={{ ntp_service_state }} enabled={{ ntp_service_enabled }} pattern="/ntpd"
tags: ["service","ntp"]
service: name={{ ntp_service_name }} state={{ ntp_service_state }} enabled={{ ntp_service_enabled }} pattern='/ntpd'
tags: [ 'service', 'ntp' ]
3 changes: 0 additions & 3 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
---
ntp_pkgs:
- ntp

ntp_service_name: ntp
ntp_config_driftfile: /var/lib/ntp/ntp.drift

3 changes: 0 additions & 3 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
---
ntp_pkgs:
- ntp

ntp_service_name: ntpd
ntp_config_driftfile: /var/lib/ntp/drift
1 change: 0 additions & 1 deletion vars/main.yml

This file was deleted.

0 comments on commit 9c2aae0

Please sign in to comment.