diff options
-rw-r--r-- | README.markdown | 59 | ||||
-rw-r--r-- | files/README.markdown | 22 | ||||
-rw-r--r-- | manifests/config.pp | 2 | ||||
-rw-r--r-- | manifests/init.pp | 2 | ||||
-rw-r--r-- | manifests/install.pp | 2 | ||||
-rw-r--r-- | manifests/params.pp | 2 | ||||
-rw-r--r-- | templates/ntp.conf.debian.erb | 2 | ||||
-rw-r--r-- | templates/ntp.conf.el.erb | 6 | ||||
-rw-r--r-- | templates/ntp.conf.freebsd.erb | 2 | ||||
-rw-r--r-- | templates/ntp.conf.gentoo.erb | 2 | ||||
-rw-r--r-- | templates/ntp.conf.suse.erb | 2 |
11 files changed, 46 insertions, 57 deletions
diff --git a/README.markdown b/README.markdown index c7b71e5..65dde32 100644 --- a/README.markdown +++ b/README.markdown @@ -37,9 +37,11 @@ files. include '::ntp' is enough to get you up and running. If you wish to pass in parameters like which servers to use then you can use: - class { '::ntp': - servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], - } +```puppet +class { '::ntp': + servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], +} +``` ##Usage @@ -49,38 +51,47 @@ full functionality. ###I just want NTP, what's the minimum I need? - include '::ntp' +```puppet +include '::ntp' +``` ###I just want to tweak the servers, nothing else. - class { '::ntp': - servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], - } - +```puppet +class { '::ntp': + servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], +} +``` ###I'd like to make sure I restrict who can connect as well. - class { '::ntp': - servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], - restrict => 'restrict 127.0.0.1', - } +```puppet +class { '::ntp': + servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], + restrict => 'restrict 127.0.0.1', +} +``` ###I'd like to opt out of having the service controlled, we use another tool for that. - class { '::ntp': - servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], - restrict => 'restrict 127.0.0.1', - manage_service => false, - } +```puppet +class { '::ntp': + servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], + restrict => 'restrict 127.0.0.1', + manage_service => false, +} +``` ###Looks great! But I'd like a different template, we need to do something unique here. - class { '::ntp': - servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], - restrict => 'restrict 127.0.0.1', - manage_service => false, - config_template => 'different/module/custom.template.erb', - } +```puppet +class { '::ntp': + servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], + restrict => 'restrict 127.0.0.1', + manage_service => false, + config_template => 'different/module/custom.template.erb', +} +``` ##Reference @@ -157,7 +168,7 @@ The module has been tested on: * RedHat Enterprise Linux 5/6 * Debian 6/7 -* CentOS 5/6. +* CentOS 5/6 * Ubuntu 12.04 * Gentoo * Arch Linux diff --git a/files/README.markdown b/files/README.markdown deleted file mode 100644 index be52188..0000000 --- a/files/README.markdown +++ /dev/null @@ -1,22 +0,0 @@ -Files -===== - -Puppet comes with both a client and server for copying files around. The file -serving function is provided as part of the central Puppet daemon, -puppetmasterd, and the client function is used through the source attribute of -file objects. Learn more at -http://projects.puppetlabs.com/projects/puppet/wiki/File_Serving_Configuration - -You can use managed files like this: - - class myclass { - package { mypackage: ensure => latest } - service { myservice: ensure => running } - file { "/etc/myfile": - source => "puppet://$servername/modules/mymodule/myfile" - } - } - -The files are searched for in: - - $modulepath/mymodule/files/myfile diff --git a/manifests/config.pp b/manifests/config.pp index b34ef4f..0a4a710 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,4 +1,4 @@ -class ntp::config( +class ntp::config ( $config = $ntp::config, $config_template = $ntp::config_template, $panic = $ntp::panic, diff --git a/manifests/init.pp b/manifests/init.pp index 6d594c3..44e310b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,4 +1,4 @@ -class ntp( +class ntp ( $autoupdate = $ntp::params::autoupdate, $config = $ntp::params::config, $config_template = $ntp::params::config_template, diff --git a/manifests/install.pp b/manifests/install.pp index 95d225b..94cb080 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -1,4 +1,4 @@ -class ntp::install( +class ntp::install ( $package_ensure = $ntp::package_ensure, $package_name = $ntp::package_name, ) inherits ntp { diff --git a/manifests/params.pp b/manifests/params.pp index a8315e7..3fd8eaf 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,4 +1,4 @@ -class ntp::params() { +class ntp::params { $autoupdate = false $package_ensure = 'present' diff --git a/templates/ntp.conf.debian.erb b/templates/ntp.conf.debian.erb index 324b91c..1ca6b20 100644 --- a/templates/ntp.conf.debian.erb +++ b/templates/ntp.conf.debian.erb @@ -25,7 +25,7 @@ filegen clockstats file clockstats type day enable # pick a different set every time it starts up. Please consider joining the # pool: <http://www.pool.ntp.org/join.html> -# Managed by puppet class { "ntp": servers => [ ... ] } +# Managed by puppet class { 'ntp': servers => [ ... ] } <% [@servers].flatten.each do |server| -%> server <%= server %> <% end -%> diff --git a/templates/ntp.conf.el.erb b/templates/ntp.conf.el.erb index 157b28d..9a5d51b 100644 --- a/templates/ntp.conf.el.erb +++ b/templates/ntp.conf.el.erb @@ -23,7 +23,7 @@ restrict -6 ::1 # Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). -# Managed by puppet class { "ntp": servers => [ ... ] } +# Managed by puppet class { 'ntp': servers => [ ... ] } <% [@servers].flatten.each do |server| -%> server <%= server %> <% end -%> @@ -35,13 +35,13 @@ server <%= server %> #manycastserver 239.255.254.254 # manycast server #manycastclient 239.255.254.254 key 42 # manycast client -<% if @is_virtual == "false" -%> +<% if scope.lookupvar('::is_virtual') == "false" -%> # Undisciplined Local Clock. This is a fake driver intended for backup # and when no outside source of synchronized time is available. server 127.127.1.0 # local clock fudge 127.127.1.0 stratum 10 - <% end -%> + # Drift file. Put this in a directory which the daemon can write to. # No symbolic links allowed, either, since the daemon updates the file # by creating a temporary in the same directory and then rename()'ing diff --git a/templates/ntp.conf.freebsd.erb b/templates/ntp.conf.freebsd.erb index 7fcffb8..12be09c 100644 --- a/templates/ntp.conf.freebsd.erb +++ b/templates/ntp.conf.freebsd.erb @@ -17,7 +17,7 @@ # The option `iburst' is used for faster initial synchronisation. # The option `maxpoll 9' is used to prevent PLL/FLL flipping on FreeBSD. # -# Managed by puppet class { "ntp": servers => [ ... ] } +# Managed by puppet class { 'ntp': servers => [ ... ] } <% if @panic == false -%> # Keep ntpd from panicking in the event of a large clock skew # when a VM guest is suspended and resumed. diff --git a/templates/ntp.conf.gentoo.erb b/templates/ntp.conf.gentoo.erb index c22026a..c981c7d 100644 --- a/templates/ntp.conf.gentoo.erb +++ b/templates/ntp.conf.gentoo.erb @@ -12,7 +12,7 @@ tinker panic 0 <% end -%> -# Managed by puppet class { "ntp": servers => [ ... ] } +# Managed by puppet class { 'ntp': servers => [ ... ] } <% [@servers].flatten.each do |server| -%> server <%= server %> <% end -%> diff --git a/templates/ntp.conf.suse.erb b/templates/ntp.conf.suse.erb index 1cbe6a2..1a4361e 100644 --- a/templates/ntp.conf.suse.erb +++ b/templates/ntp.conf.suse.erb @@ -38,7 +38,7 @@ server 127.127.1.0 # local clock (LCL) fudge 127.127.1.0 stratum 10 # LCL is unsynchronized <% end -%> -# Managed by puppet class { "ntp": servers => [ ... ] } +# Managed by puppet class { 'ntp': servers => [ ... ] } <% [@servers].flatten.each do |server| -%> server <%= server %> <% end -%> |