Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ fixtures:
apt: "https://github.com/puppetlabs/puppetlabs-apt.git"
augeas_core: "https://github.com/puppetlabs/puppetlabs-augeas_core.git"
concat: "https://github.com/puppetlabs/puppetlabs-concat.git"
cron_core: "https://github.com/puppetlabs/puppetlabs-cron_core.git"
cron_core:
repo: "https://github.com/puppetlabs/puppetlabs-cron_core.git"
ref: "v1.3.0"
facts: 'https://github.com/puppetlabs/puppetlabs-facts.git'
firewall: "https://github.com/puppetlabs/puppetlabs-firewall.git"
provision: "https://github.com/puppetlabs/provision.git"
puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git'
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
yumrepo_core: "https://github.com/puppetlabs/puppetlabs-yumrepo_core.git"
yumrepo_core:
repo: "https://github.com/puppetlabs/puppetlabs-yumrepo_core.git"
ref: "v2.1.0"
systemd: "https://github.com/voxpupuli/puppet-systemd.git"
10 changes: 5 additions & 5 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
}

$service_reload = "systemctl reload ${service_name}"
$service_status = pick($service_status, "systemctl status ${service_name}")
$service_status = pick($service_status, "systemctl is-active --quiet ${service_name}")

$psql_path = pick($psql_path, "${bindir}/psql")

Expand Down Expand Up @@ -130,7 +130,7 @@
$confdir = pick($confdir, $datadir)
$psql_path = pick($psql_path, "${bindir}/psql")

$service_status = pick($service_status, "systemctl status ${service_name}")
$service_status = pick($service_status, "systemctl is-active --quiet ${service_name}")
$service_reload = "systemctl reload ${service_name}"
$python_package_name = pick($python_package_name, 'python-psycopg2')
# Archlinux does not have a perl::DBD::Pg package
Expand Down Expand Up @@ -173,7 +173,7 @@
$datadir = pick($datadir, "/var/lib/postgresql/${version}/main")
$confdir = pick($confdir, "/etc/postgresql/${version}/main")
$service_reload = "systemctl reload ${service_name}"
$service_status = pick($service_status, "systemctl status ${service_name}")
$service_status = pick($service_status, "systemctl is-active --quiet ${service_name}")
$psql_path = pick($psql_path, '/usr/bin/psql')
$postgresql_conf_mode = pick($postgresql_conf_mode, '0644')
}
Expand All @@ -194,7 +194,7 @@
$bindir = pick($bindir, "/usr/lib/postgresql-${version}/bin")
$datadir = pick($datadir, "/var/lib/postgresql/${version}_data")
$confdir = pick($confdir, "/etc/postgresql-${version}")
$service_status = pick($service_status, "systemctl status ${service_name}")
$service_status = pick($service_status, "systemctl is-active --quiet ${service_name}")
$service_reload = "systemctl reload ${service_name}"
$psql_path = pick($psql_path, "${bindir}/psql")

Expand Down Expand Up @@ -267,7 +267,7 @@
$bindir = pick($bindir, "/usr/lib/postgresql${version}/bin")
$datadir = pick($datadir, '/var/lib/pgsql/data')
$confdir = pick($confdir, $datadir)
$service_status = pick($service_status, "systemctl status ${service_name}")
$service_status = pick($service_status, "systemctl is-active --quiet ${service_name}")
$service_reload = "systemctl reload ${service_name}"
$psql_path = pick($psql_path, "${bindir}/psql")

Expand Down
2 changes: 1 addition & 1 deletion manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
Boolean $service_restart_on_change = $postgresql::params::service_restart_on_change,
Optional[String[1]] $service_provider = $postgresql::params::service_provider,
String[1] $service_reload = $postgresql::params::service_reload,
Optional[String[1]] $service_status = $postgresql::params::service_status,
Optional[Variant[Array[String[1]],String[1]]] $service_status = $postgresql::params::service_status,
String[1] $default_database = $postgresql::params::default_database,
Hash $default_connect_settings = $postgresql::globals::default_connect_settings,
Optional[Variant[String[1], Array[String[1]]]] $listen_addresses = $postgresql::params::listen_addresses,
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/server_instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class { 'postgresql::server':
},
service_settings => {
'service_name' => 'postgresql@13-test1',
'service_status' => 'systemctl status postgresql@13-test1.service',
'service_status' => 'systemctl is-active --quiet postgresql@13-test1.service',
'service_ensure' => 'running',
'service_enable' => true,
},
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/server/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
end

it { is_expected.to contain_class('postgresql::server::service') }
it { is_expected.to contain_service('postgresqld_instance_main').with_name('postgresql').with_status('systemctl status postgresql') }
it { is_expected.to contain_service('postgresqld_instance_main').with_name('postgresql').with_status('systemctl is-active --quiet postgresql') }
end
4 changes: 2 additions & 2 deletions spec/defines/server_instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class { 'postgresql::server':
'port' => 5433,
'pg_hba_conf_defaults' => false },
'service_settings': { 'service_name' => 'postgresql@13-test1',
'service_status' => 'systemctl status postgresql@13-test1.service',
'service_status' => 'systemctl is-active --quiet postgresql@13-test1.service',
'service_ensure' => 'running',
'service_enable' => true },
'initdb_settings': { 'auth_local' => 'peer',
Expand Down Expand Up @@ -120,7 +120,7 @@ class { 'postgresql::server':
it { is_expected.to contain_postgresql__server_instance('test1') }
it { is_expected.to contain_user('ins_test1') }
it { is_expected.to contain_group('ins_test1') }
it { is_expected.to contain_service('postgresqld_instance_test1').with_name('postgresql@13-test1').with_status('systemctl status postgresql@13-test1.service') }
it { is_expected.to contain_service('postgresqld_instance_test1').with_name('postgresql@13-test1').with_status('systemctl is-active --quiet postgresql@13-test1.service') }
it { is_expected.to contain_systemd__dropin_file('postgresql@13-test1.conf') }
it { is_expected.to contain_postgresql_conn_validator('validate_service_is_running_instance_test1') }
it { is_expected.to contain_postgresql_conf('port_for_instance_test1') }
Expand Down
Loading