summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2012-11-11 21:48:58 +0100
committerintrigeri <intrigeri@boum.org>2012-11-11 21:48:58 +0100
commit6255a818641c07b20d7e718eeff5e5f92953bd09 (patch)
tree292c1347662bc22c3b08774a34389d512cd0c10c
parent1ee285d39980512b506084368f4f2208aa4d7c1f (diff)
Quote and enclose in braces variables in strings.
Puppet style guide "8. Quoting" reads: "Double quotes should be used when variable interpolation is required. [...] All variables should be enclosed in braces when interpolated in a string."
-rw-r--r--manifests/daemon.pp42
-rw-r--r--manifests/polipo.pp2
2 files changed, 22 insertions, 22 deletions
diff --git a/manifests/daemon.pp b/manifests/daemon.pp
index 683d2c6..bd6de31 100644
--- a/manifests/daemon.pp
+++ b/manifests/daemon.pp
@@ -12,11 +12,11 @@ class tor::daemon (
# packages, user, group
Service['tor'] {
- subscribe => File[$config_file],
+ subscribe => File["${config_file}"],
}
Package[ 'tor' ] {
- require => File[$data_dir],
+ require => File["${data_dir}"],
}
group { 'debian-tor':
@@ -28,7 +28,7 @@ class tor::daemon (
allowdupe => false,
comment => 'tor user,,,',
ensure => present,
- home => $data_dir,
+ home => "${data_dir}",
shell => '/bin/bash',
gid => 'debian-tor',
require => Group['debian-tor'],
@@ -59,19 +59,19 @@ class tor::daemon (
file { "${snippet_dir}":
ensure => directory,
owner => 'debian-tor', group => 'debian-tor', mode => 0755,
- require => File[$spool_dir],
+ require => File["${spool_dir}"],
}
# tor configuration file
concatenated_file { "${config_file}":
- dir => $snippet_dir,
+ dir => "${snippet_dir}",
mode => 0600,
owner => 'debian-tor', group => 'debian-tor',
}
# config file headers
concatenated_file_part { '00.header':
- dir => $snippet_dir,
+ dir => "${snippet_dir}",
content => template('tor/torrc.header.erb'),
owner => 'debian-tor', group => 'debian-tor', mode => 0644,
ensure => present,
@@ -79,7 +79,7 @@ class tor::daemon (
# global configurations
concatenated_file_part { '01.global':
- dir => $snippet_dir,
+ dir => "${snippet_dir}",
content => template('tor/torrc.global.erb'),
owner => 'debian-tor', group => 'debian-tor', mode => 0644,
}
@@ -90,7 +90,7 @@ class tor::daemon (
$policies = [] ) {
concatenated_file_part { '02.socks':
- dir => $tor::daemon::snippet_dir,
+ dir => "${tor::daemon::snippet_dir}",
content => template('tor/torrc.socks.erb'),
owner => 'debian-tor', group => 'debian-tor', mode => 0644,
}
@@ -120,7 +120,7 @@ class tor::daemon (
}
concatenated_file_part { '03.relay':
- dir => $tor::daemon::snippet_dir,
+ dir => "${tor::daemon::snippet_dir}",
content => template('tor/torrc.relay.erb'),
owner => 'debian-tor', group => 'debian-tor', mode => 0644,
ensure => $ensure,
@@ -139,12 +139,12 @@ class tor::daemon (
fail('You need to define the tor control password')
}
- if $cookie_authentication == 0 and ($cookie_auth_file != '' or $cookie_auth_file_group_readable != '') {
+ if $cookie_authentication == 0 and ("${cookie_auth_file}" != '' or "${cookie_auth_file_group_readable}" != '') {
notice('You set a tor cookie authentication option, but do not have cookie_authentication on')
}
concatenated_file_part { '04.control':
- dir => $tor::daemon::snippet_dir,
+ dir => "${tor::daemon::snippet_dir}",
content => template('tor/torrc.control.erb'),
owner => 'debian-tor', group => 'debian-tor', mode => 0600,
ensure => $ensure,
@@ -153,11 +153,11 @@ class tor::daemon (
# hidden services definition
define hidden_service( $ports = [],
- $data_dir = $tor::daemon::data_dir,
+ $data_dir = "${tor::daemon::data_dir}",
$ensure = present ) {
concatenated_file_part { "05.hidden_service.${name}":
- dir => $tor::daemon::snippet_dir,
+ dir => "${tor::daemon::snippet_dir}",
content => template('tor/torrc.hidden_service.erb'),
owner => 'debian-tor', group => 'debian-tor', mode => 0644,
ensure => $ensure,
@@ -171,7 +171,7 @@ class tor::daemon (
$ensure = present ) {
concatenated_file_part { '06.directory':
- dir => $tor::daemon::snippet_dir,
+ dir => "${tor::daemon::snippet_dir}",
content => template('tor/torrc.directory.erb'),
owner => 'debian-tor', group => 'debian-tor', mode => 0644,
ensure => $ensure,
@@ -192,7 +192,7 @@ class tor::daemon (
$ensure = present ) {
concatenated_file_part { "07.exit_policy.${name}":
- dir => $tor::daemon::snippet_dir,
+ dir => "${tor::daemon::snippet_dir}",
content => template('tor/torrc.exit_policy.erb'),
owner => 'debian-tor', group => 'debian-tor', mode => 0644,
ensure => $ensure,
@@ -205,7 +205,7 @@ class tor::daemon (
$ensure = present ) {
concatenated_file_part { "08.dns.${name}":
- dir => $tor::daemon::snippet_dir,
+ dir => "${tor::daemon::snippet_dir}",
content => template('tor/torrc.dns.erb'),
owner => 'debian-tor', group => 'debian-tor', mode => 0644,
ensure => $ensure,
@@ -218,7 +218,7 @@ class tor::daemon (
$ensure = present ) {
concatenated_file_part { "09.transparent.${name}":
- dir => $tor::daemon::snippet_dir,
+ dir => "${tor::daemon::snippet_dir}",
content => template('tor/torrc.transparent.erb'),
owner => 'debian-tor', group => 'debian-tor', mode => 0644,
ensure => $ensure,
@@ -232,7 +232,7 @@ class tor::daemon (
$ensure = present ) {
concatenated_file_part { "10.bridge.${name}":
- dir => $tor::daemon::snippet_dir,
+ dir => "${tor::daemon::snippet_dir}",
content => template('tor/torrc.bridge.erb'),
owner => 'debian-tor', group => 'debian-tor', mode => 0644,
ensure => $ensure,
@@ -244,7 +244,7 @@ class tor::daemon (
$newaddress = '') {
concatenated_file_part { "08.map_address.${name}":
- dir => $tor::daemon::snippet_dir,
+ dir => "${tor::daemon::snippet_dir}",
content => template('tor/torrc.map_address.erb'),
owner => 'debian-tor', group => 'debian-tor', mode => 0644,
ensure => $ensure,
@@ -256,8 +256,8 @@ class tor::daemon (
$ensure = present ) {
concatenated_file_part { "99.snippet.${name}":
- dir => $tor::daemon::snippet_dir,
- content => $content,
+ dir => "${tor::daemon::snippet_dir}",
+ content => "${content}",
owner => 'debian-tor', group => 'debian-tor', mode => 0644,
ensure => $ensure,
}
diff --git a/manifests/polipo.pp b/manifests/polipo.pp
index 8563347..9a8fdb5 100644
--- a/manifests/polipo.pp
+++ b/manifests/polipo.pp
@@ -1,7 +1,7 @@
class tor::polipo {
include ::tor
- case $::operatingsystem {
+ case "${::operatingsystem}" {
'debian': { include tor::polipo::debian }
default: { include tor::polipo::base }
}