Skip to content

Commit

Permalink
Working on roles. Using @arcimboldo 's ansible playbooks as inspiration
Browse files Browse the repository at this point in the history
  • Loading branch information
brucellino committed Mar 7, 2014
1 parent 6b43086 commit 2fc37fa
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
19 changes: 19 additions & 0 deletions roles/common/templates/etc/hosts.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file is managed by Ansible.
# taken from https://github.com/gc3-uzh-ch/ansible-playbooks 7/03/2014
127.0.0.1 localhost.localdomain localhost

{% if hosts %}
{% for host in hosts|sort %}
{% if host != 'localhost' %}
{{ hostvars[host].ansible_default_ipv4.address }} {{ host }}
{% endif %}
{% endfor -%}

{% else %}
{% for host in groups['all']|sort %}
{% if host != 'localhost' %}
{{ hostvars[host].ansible_default_ipv4.address }} {{ host }}
{% endif %}
{% endfor %}

{% endif %}
39 changes: 39 additions & 0 deletions roles/common/templates/etc/ntp.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
driftfile /var/lib/ntp/ntp.drift


# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

# Specify one or more NTP servers.

# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org

# Use Ubuntu's ntp server as a fallback.
server ntp.ubuntu.com

# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.

# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

0 comments on commit 2fc37fa

Please sign in to comment.