diff options
-rw-r--r-- | modules/postgresql/manifests/database.pp | 4 | ||||
-rw-r--r-- | modules/postgresql/manifests/database_callback.pp | 2 | ||||
-rw-r--r-- | modules/postgresql/manifests/hba_entry.pp | 2 | ||||
-rw-r--r-- | modules/postgresql/manifests/server.pp | 8 | ||||
-rw-r--r-- | modules/postgresql/manifests/user.pp | 8 |
5 files changed, 12 insertions, 12 deletions
diff --git a/modules/postgresql/manifests/database.pp b/modules/postgresql/manifests/database.pp index 82670b5e..822dc5ee 100644 --- a/modules/postgresql/manifests/database.pp +++ b/modules/postgresql/manifests/database.pp @@ -3,9 +3,9 @@ define postgresql::database($description = '', $user = 'postgres', $callback_notify = '') { - exec { "createdb -O $user -U postgres $name '$description'": + exec { "createdb -O ${user} -U postgres ${name} '${description}'": user => 'root', - unless => "psql -A -t -U postgres -l | grep '^$name|'", + unless => "psql -A -t -U postgres -l | grep '^${name}|'", require => Service['postgresql'], } diff --git a/modules/postgresql/manifests/database_callback.pp b/modules/postgresql/manifests/database_callback.pp index 8d4b217c..0ab1771f 100644 --- a/modules/postgresql/manifests/database_callback.pp +++ b/modules/postgresql/manifests/database_callback.pp @@ -1,7 +1,7 @@ define postgresql::database_callback($callback_notify = '') { # dummy declaration, so we can trigger the notify if $callback_notify { - exec { "callback $name": + exec { "callback ${name}": command => '/bin/true', notify => $callback_notify, } diff --git a/modules/postgresql/manifests/hba_entry.pp b/modules/postgresql/manifests/hba_entry.pp index bc8afcc3..595fd33c 100644 --- a/modules/postgresql/manifests/hba_entry.pp +++ b/modules/postgresql/manifests/hba_entry.pp @@ -1,5 +1,5 @@ # == Define: postgresql::hba_entry -# +# # Set a new entry to pg_hba.conf file # # === Parameters diff --git a/modules/postgresql/manifests/server.pp b/modules/postgresql/manifests/server.pp index 85f5dda5..29fa30d0 100644 --- a/modules/postgresql/manifests/server.pp +++ b/modules/postgresql/manifests/server.pp @@ -37,11 +37,11 @@ class postgresql::server { @postgresql::pg_hba { $postgresql::var::hba_file: } postgresql::hba_entry { 'allow_local_ipv4': - type => 'host', + type => 'host', database => 'all', - user => 'all', - address => '127.0.0.1/32', - method => 'md5', + user => 'all', + address => '127.0.0.1/32', + method => 'md5', } postgresql::config { diff --git a/modules/postgresql/manifests/user.pp b/modules/postgresql/manifests/user.pp index b70dd122..5b73b243 100644 --- a/modules/postgresql/manifests/user.pp +++ b/modules/postgresql/manifests/user.pp @@ -1,13 +1,13 @@ # TODO convert to a regular type, so we can later change password # without erasing the current user define postgresql::user($password) { - $sql = "CREATE ROLE $name ENCRYPTED PASSWORD '\$pass' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;" + $sql = "CREATE ROLE ${name} ENCRYPTED PASSWORD '\${pass}' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;" - exec { "psql -U postgres -c \"$sql\" ": + exec { "psql -U postgres -c \"${sql}\" ": user => 'root', # do not leak the password on commandline - environment => "pass=$password", - unless => "psql -A -t -U postgres -c '\\du $name' | grep '$name'", + environment => "pass=${password}", + unless => "psql -A -t -U postgres -c '\\du ${name}' | grep '${name}'", require => Service['postgresql'], } } |