diff options
author | Adam Jahn <ajjahn@gmail.com> | 2012-10-25 00:30:33 -0400 |
---|---|---|
committer | Adam Jahn <ajjahn@gmail.com> | 2012-10-25 00:30:33 -0400 |
commit | 0571cbf053ac3aa456a49bc3cb0a4e040ec737b8 (patch) | |
tree | 7c6651b068b5ac4bb136aed9ef98e374882c094b | |
parent | 4ca06356889b0b653ad0fc4593c617ab9b0b1b31 (diff) | |
download | puppet-samba-0571cbf053ac3aa456a49bc3cb0a4e040ec737b8.tar.gz puppet-samba-0571cbf053ac3aa456a49bc3cb0a4e040ec737b8.tar.bz2 |
add puppet-lint
-rw-r--r-- | Gemfile | 5 | ||||
-rw-r--r-- | Gemfile.lock | 18 | ||||
-rw-r--r-- | Rakefile | 16 | ||||
-rw-r--r-- | manifests/server.pp | 30 |
4 files changed, 54 insertions, 15 deletions
@@ -0,0 +1,5 @@ +source "http://rubygems.org" + +gem "rake" +gem "puppet-lint" +gem "puppet"
\ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..6b9032d --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,18 @@ +GEM + remote: http://rubygems.org/ + specs: + facter (1.6.13) + hiera (1.0.0) + puppet (3.0.1) + facter (~> 1.6.11) + hiera (~> 1.0.0) + puppet-lint (0.3.2) + rake (0.9.2.2) + +PLATFORMS + ruby + +DEPENDENCIES + puppet + puppet-lint + rake diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..8e7269f --- /dev/null +++ b/Rakefile @@ -0,0 +1,16 @@ +require 'puppet' +require 'rake' +require 'puppet-lint/tasks/puppet-lint' + +# Leave this in until we're ready to write documentation +PuppetLint.configuration.send("disable_documentation") + +# Ruby's version of true does not equate to puppet's version of true +PuppetLint.configuration.send("disable_quoted_booleans") +PuppetLint.configuration.send("disable_selector_inside_resource") +PuppetLint.configuration.send("disable_autoloader_layout") +PuppetLint.configuration.send("disable_80chars") +PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}" + +desc "Run puppet-lint" +task :default => [:lint] diff --git a/manifests/server.pp b/manifests/server.pp index 66d10b1..f3253bb 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -7,53 +7,53 @@ class samba::server($interfaces = '', include samba::server::config include samba::server::service - $context = "/files/etc/samba/smb.conf" + $context = '/files/etc/samba/smb.conf' $target = "target[. = 'global']" augeas { 'global-section': context => $context, changes => "set ${target} global", - require => Class["samba::server::config"], - notify => Class['samba::server::service'] + require => Class['samba::server::config'], + notify => Class['samba::server::service'] } augeas { 'global-interfaces': context => $context, changes => $interfaces ? { - default => ["set \"${target}/interfaces\" '$interfaces'", "set \"${target}/bind interfaces only\" yes"], - '' => ["rm \"${target}/interfaces\"", "rm \"${target}/bind interfaces only\""], + default => ["set \"${target}/interfaces\" '${interfaces}'", "set \"${target}/bind interfaces only\" yes"], + '' => ["rm \"${target}/interfaces\"", "rm \"${target}/bind interfaces only\""], }, require => Augeas['global-section'], - notify => Class['samba::server::service'] + notify => Class['samba::server::service'] } augeas { 'global-security': context => $context, changes => $security ? { - default => "set \"${target}/security\" '$security'", - '' => "rm \"${target}/security\"", + default => "set \"${target}/security\" '${security}'", + '' => "rm \"${target}/security\"", }, require => Augeas['global-section'], - notify => Class['samba::server::service'] + notify => Class['samba::server::service'] } augeas { 'global-server_string': context => $context, changes => $server_string ? { - default => "set \"${target}/server string\" '$server_string'", - '' => "rm \"${target}/server string\"", + default => "set \"${target}/server string\" '${server_string}'", + '' => "rm \"${target}/server string\"", }, require => Augeas['global-section'], - notify => Class['samba::server::service'] + notify => Class['samba::server::service'] } augeas { 'global-workgroup': context => $context, changes => $workgroup ? { - default => "set ${target}/workgroup '$workgroup'", - '' => "rm ${target}/workgroup", + default => "set ${target}/workgroup '${workgroup}'", + '' => "rm ${target}/workgroup", }, require => Augeas['global-section'], - notify => Class['samba::server::service'] + notify => Class['samba::server::service'] } } |