From cac3ddc1ba2aaa19541187a6d4d1749c282c395a Mon Sep 17 00:00:00 2001 From: George Hansper Date: Fri, 27 Oct 2017 10:57:50 +1000 Subject: [PATCH 1/2] add parameter "version" to postgresql::server::extension - fix dependency on database --- manifests/server/extension.pp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/manifests/server/extension.pp b/manifests/server/extension.pp index 438459f789..86f2f9df11 100644 --- a/manifests/server/extension.pp +++ b/manifests/server/extension.pp @@ -32,6 +32,12 @@ } } + if( $database != 'postgres' ) { + # The database postgres cannot managed by this module, so it is exempt from this dependency + Postgresql_psql { + require => Postgresql::Server::Database[$database], + } + } postgresql_psql {"Add ${extension} extension to ${database}": @@ -45,10 +51,6 @@ unless => "SELECT t.count FROM (SELECT count(extname) FROM pg_extension WHERE extname = '${extension}') as t WHERE t.count ${unless_comp} 1", } - if($database != undef and defined(Postgresql::Server::Database[$database])) { - Postgresql::Server::Database[$database]->Postgresql_psql["Add ${extension} extension to ${database}"] - } - if $package_name { $_package_ensure = $package_ensure ? { undef => $ensure, @@ -79,8 +81,5 @@ command => $alter_extension_sql, unless => $update_unless, } - if($database != undef and defined(Postgresql::Server::Database[$database])) { - Postgresql::Server::Database[$database]->Postgresql_psql["${database}: ${alter_extension_sql}"] - } } } From bccc11aba915a8399a665b795b9779e5c9f623a2 Mon Sep 17 00:00:00 2001 From: Eric Putnam Date: Wed, 8 Nov 2017 10:56:20 -0800 Subject: [PATCH 2/2] (SERVER-2003) stub major versions Recent changes in the apt module are looking for structured facts that arent currently stubbed in postgresql unit tests. This adds those facts so that unit tests pass --- spec/unit/classes/globals_spec.rb | 3 ++- spec/unit/classes/repo_spec.rb | 3 ++- spec/unit/classes/server_spec.rb | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/spec/unit/classes/globals_spec.rb b/spec/unit/classes/globals_spec.rb index d4bceda47c..67890905bf 100644 --- a/spec/unit/classes/globals_spec.rb +++ b/spec/unit/classes/globals_spec.rb @@ -8,7 +8,8 @@ :family => 'Debian', :name => 'Debian', :release => { - :full => '6.0' + :full => '6.0', + :major => '6' } }, :osfamily => 'Debian', diff --git a/spec/unit/classes/repo_spec.rb b/spec/unit/classes/repo_spec.rb index edfeda3735..3942d65d20 100644 --- a/spec/unit/classes/repo_spec.rb +++ b/spec/unit/classes/repo_spec.rb @@ -7,7 +7,8 @@ :name => 'Debian', :family => 'Debian', :release => { - :full => '6.0' + :full => '6.0', + :major => '6' } }, :osfamily => 'Debian', diff --git a/spec/unit/classes/server_spec.rb b/spec/unit/classes/server_spec.rb index c78e60e7e7..18013d8ff4 100644 --- a/spec/unit/classes/server_spec.rb +++ b/spec/unit/classes/server_spec.rb @@ -7,7 +7,8 @@ :family => 'Debian', :name => 'Debian', :release => { - :full => '6.0' + :full => '6.0', + :major => '6' } }, :osfamily => 'Debian',