Fix lint warnings

This commit is contained in:
juniorsysadmin 2015-01-11 15:27:57 +11:00
parent db42203ba9
commit 32ebbb5e34
7 changed files with 35 additions and 35 deletions

View file

@ -7,9 +7,9 @@ class postgresql::client (
validate_string($package_name)
package { 'postgresql-client':
ensure => $package_ensure,
name => $package_name,
tag => 'postgresql',
ensure => $package_ensure,
name => $package_name,
tag => 'postgresql',
}
file { '/usr/local/bin/validate_postgresql_connection.sh':

View file

@ -1,15 +1,15 @@
# PRIVATE CLASS: do not use directly
class postgresql::params inherits postgresql::globals {
$version = $globals_version
$postgis_version = $globals_postgis_version
$version = $postgresql::globals::globals_version
$postgis_version = $postgresql::globals::globals_postgis_version
$listen_addresses = 'localhost'
$port = 5432
$ip_mask_deny_postgres_user = '0.0.0.0/0'
$ip_mask_allow_all_users = '127.0.0.1/32'
$ipv4acls = []
$ipv6acls = []
$encoding = $encoding
$locale = $locale
$encoding = $postgresql::globals::encoding
$locale = $postgresql::globals::locale
$service_ensure = 'running'
$service_enable = true
$service_manage = true
@ -28,7 +28,7 @@ class postgresql::params inherits postgresql::globals {
$version_parts = split($version, '[.]')
$package_version = "${version_parts[0]}${version_parts[1]}"
if $version == $default_version {
if $version == $postgresql::globals::default_version {
$client_package_name = pick($client_package_name, 'postgresql')
$server_package_name = pick($server_package_name, 'postgresql-server')
$contrib_package_name = pick($contrib_package_name,'postgresql-contrib')
@ -108,7 +108,7 @@ class postgresql::params inherits postgresql::globals {
$user = pick($user, 'postgres')
$group = pick($group, 'postgres')
if $manage_package_repo == true {
if $postgresql::globals::manage_package_repo == true {
$needs_initdb = pick($needs_initdb, true)
$service_name = pick($service_name, 'postgresql')
} else {
@ -143,7 +143,7 @@ class postgresql::params inherits postgresql::globals {
$datadir = pick($datadir, "/var/lib/postgresql/${version}/main")
$confdir = pick($confdir, "/etc/postgresql/${version}/main")
$service_status = pick($service_status, "/etc/init.d/${service_name} status | /bin/egrep -q 'Running clusters: .+|online'")
$psql_path = pick($psql_path, "/usr/bin/psql")
$psql_path = pick($psql_path, '/usr/bin/psql')
}
'FreeBSD': {

View file

@ -10,12 +10,12 @@ include ::apt
priority => 500,
}->
apt::source { 'apt.postgresql.org':
location => 'http://apt.postgresql.org/pub/repos/apt/',
release => "${::lsbdistcodename}-pgdg",
repos => "main ${version}",
key => 'ACCC4CF8',
key_source => 'https://www.postgresql.org/media/keys/ACCC4CF8.asc',
include_src => false,
location => 'http://apt.postgresql.org/pub/repos/apt/',
release => "${::lsbdistcodename}-pgdg",
repos => "main ${postgresql::repo::version}",
key => 'ACCC4CF8',
key_source => 'https://www.postgresql.org/media/keys/ACCC4CF8.asc',
include_src => false,
}
Apt::Source['apt.postgresql.org']->Package<|tag == 'postgresql'|>

View file

@ -1,6 +1,6 @@
# PRIVATE CLASS: do not use directly
class postgresql::repo::yum_postgresql_org inherits postgresql::repo {
$version_parts = split($version, '[.]')
$version_parts = split($postgresql::repo::version, '[.]')
$package_version = "${version_parts[0]}${version_parts[1]}"
$gpg_key_path = "/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}"
@ -18,8 +18,8 @@ class postgresql::repo::yum_postgresql_org inherits postgresql::repo {
}
yumrepo { 'yum.postgresql.org':
descr => "PostgreSQL ${version} \$releasever - \$basearch",
baseurl => "http://yum.postgresql.org/${version}/${label1}/${label2}-\$releasever-\$basearch",
descr => "PostgreSQL ${postgresql::repo::version} \$releasever - \$basearch",
baseurl => "http://yum.postgresql.org/${postgresql::repo::version}/${label1}/${label2}-\$releasever-\$basearch",
enabled => 1,
gpgcheck => 1,
gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}",

View file

@ -148,7 +148,7 @@ class postgresql::server::config {
notify => [ Exec['restart-systemd'], Class['postgresql::server::service'] ],
before => Class['postgresql::server::reload'],
}
exec { "restart-systemd":
exec { 'restart-systemd':
command => 'systemctl daemon-reload',
refreshonly => true,
path => '/bin:/usr/bin:/usr/local/bin'

View file

@ -67,16 +67,16 @@ class postgresql::server::initdb {
if $::operatingsystem == 'Debian' or $::operatingsystem == 'Ubuntu' {
if $::operatingsystemrelease =~ /^6/ or $::operatingsystemrelease =~ /^7/ or $::operatingsystemrelease =~ /^10\.04/ or $::operatingsystemrelease =~ /^12\.04/ {
file { 'server.crt':
ensure => link,
path => "${datadir}/server.crt",
target => '/etc/ssl/certs/ssl-cert-snakeoil.pem',
require => Exec['postgresql_initdb'],
ensure => link,
path => "${datadir}/server.crt",
target => '/etc/ssl/certs/ssl-cert-snakeoil.pem',
require => Exec['postgresql_initdb'],
}
file { 'server.key':
ensure => link,
path => "${datadir}/server.key",
target => '/etc/ssl/private/ssl-cert-snakeoil.key',
require => Exec['postgresql_initdb'],
ensure => link,
path => "${datadir}/server.key",
target => '/etc/ssl/private/ssl-cert-snakeoil.key',
require => Exec['postgresql_initdb'],
}
}
}

View file

@ -15,18 +15,18 @@ class postgresql::server::passwd {
exec { 'set_postgres_postgrespw':
# This command works w/no password because we run it as postgres system
# user
command => "${psql_path} -c 'ALTER ROLE \"${user}\" PASSWORD ${escaped}'",
user => $user,
group => $group,
logoutput => true,
cwd => '/tmp',
command => "${psql_path} -c 'ALTER ROLE \"${user}\" PASSWORD ${escaped}'",
user => $user,
group => $group,
logoutput => true,
cwd => '/tmp',
# With this command we're passing -h to force TCP authentication, which
# does require a password. We specify the password via the PGPASSWORD
# environment variable. If the password is correct (current), this
# command will exit with an exit code of 0, which will prevent the main
# command from running.
unless => "${env} ${psql_path} -h localhost -c 'select 1' > /dev/null",
path => '/usr/bin:/usr/local/bin:/bin',
unless => "${env} ${psql_path} -h localhost -c 'select 1' > /dev/null",
path => '/usr/bin:/usr/local/bin:/bin',
}
}
}