Skip to content
Merged
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
6 changes: 2 additions & 4 deletions manifests/uitdatabank/search_api/deployment.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
String $facilities_source,
String $themes_source,
String $types_source,
String $pubkey_auth0_source,
String $pubkey_keycloak_source,
String $version = 'latest',
String $repository = 'uitdatabank-search-api',
Expand Down Expand Up @@ -60,10 +59,9 @@
}

file { 'uitdatabank-search-api-pubkey-auth0':
ensure => 'file',
ensure => 'absent',
path => "${basedir}/public-auth0.pem",
source => $pubkey_auth0_source,
* => $file_default_attributes
notify => [Service['uitdatabank-search-api'], Class['profiles::uitdatabank::search_api::listeners']]
}

file { 'uitdatabank-search-api-pubkey-keycloak':
Expand Down
26 changes: 6 additions & 20 deletions spec/classes/uitdatabank/search_api/deployment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
context "on #{os}" do
let(:facts) { facts }

context "with config_source => /tmp/config.yml, features_source => /tmp/features.yml, facilities_source => /tmp/facilities.yml, themes_source => /tmp/themes.yml, types_source => /tmp/types.yml, pubkey_auth0_source => /tmp/pubkey and pubkey_keycloak_source => /tmp/pubkey" do
context "with config_source => /tmp/config.yml, features_source => /tmp/features.yml, facilities_source => /tmp/facilities.yml, themes_source => /tmp/themes.yml, types_source => /tmp/types.yml and pubkey_keycloak_source => /tmp/pubkey" do
let(:params) { {
'config_source' => '/tmp/config.yml',
'features_source' => '/tmp/features.yml',
'facilities_source' => '/tmp/facilities.yml',
'themes_source' => '/tmp/themes.yml',
'types_source' => '/tmp/types.yml',
'pubkey_auth0_source' => '/tmp/pubkey',
'pubkey_keycloak_source' => '/tmp/pubkey'
} }

Expand All @@ -26,7 +25,6 @@
'types_source' => '/tmp/types.yml',
'version' => 'latest',
'repository' => 'uitdatabank-search-api',
'pubkey_auth0_source' => '/tmp/pubkey',
'pubkey_keycloak_source' => '/tmp/pubkey',
'region_mapping_source' => 'puppet:///modules/profiles/uitdatabank/search_api/mapping_region.json',
'default_queries_source' => nil,
Expand Down Expand Up @@ -74,11 +72,8 @@
) }

it { is_expected.to contain_file('uitdatabank-search-api-pubkey-auth0').with(
'ensure' => 'file',
'owner' => 'www-data',
'group' => 'www-data',
'path' => '/var/www/udb3-search-service/public-auth0.pem',
'source' => '/tmp/pubkey'
'ensure' => 'absent',
'path' => '/var/www/udb3-search-service/public-auth0.pem'
) }

it { is_expected.to contain_file('uitdatabank-search-api-region-mapping').with(
Expand Down Expand Up @@ -136,10 +131,6 @@
it { is_expected.to contain_file('uitdatabank-search-api-facet-mapping-regions').that_requires('Package[uitdatabank-search-api]') }
it { is_expected.to contain_file('uitdatabank-search-api-facet-mapping-regions').that_notifies('Service[uitdatabank-search-api]') }
it { is_expected.to contain_file('uitdatabank-search-api-facet-mapping-regions').that_notifies('Class[profiles::uitdatabank::search_api::listeners]') }
it { is_expected.to contain_file('uitdatabank-search-api-pubkey-auth0').that_requires('Group[www-data]') }
it { is_expected.to contain_file('uitdatabank-search-api-pubkey-auth0').that_requires('User[www-data]') }
it { is_expected.to contain_file('uitdatabank-search-api-pubkey-auth0').that_requires('Package[uitdatabank-search-api]') }
it { is_expected.to contain_file('uitdatabank-search-api-pubkey-auth0').that_notifies('Service[uitdatabank-search-api]') }
it { is_expected.to contain_file('uitdatabank-search-api-pubkey-auth0').that_notifies('Class[profiles::uitdatabank::search_api::listeners]') }
it { is_expected.to contain_file('uitdatabank-search-api-region-mapping').that_requires('Group[www-data]') }
it { is_expected.to contain_file('uitdatabank-search-api-region-mapping').that_requires('User[www-data]') }
Expand Down Expand Up @@ -168,7 +159,7 @@
end
end

context "with config_source => /foo/config.yml, features_source => /foo/features.yml, facilities_source => /tmp/facilities.txt, themes_source => /tmp/themes.txt, types_source => /tmp/types.txt, version => 1.2.3, repository => foo, pubkey_auth0_source => /tmp/mypubkey, pubkey_keycloak_source => /tmp/mypubkey, region_mapping_source => /tmp/mapping.json, default_queries_source => /tmp/default_queries.php and puppetdb_url => http://example.com:8000" do
context "with config_source => /foo/config.yml, features_source => /foo/features.yml, facilities_source => /tmp/facilities.txt, themes_source => /tmp/themes.txt, types_source => /tmp/types.txt, version => 1.2.3, repository => foo, pubkey_keycloak_source => /tmp/mypubkey, region_mapping_source => /tmp/mapping.json, default_queries_source => /tmp/default_queries.php and puppetdb_url => http://example.com:8000" do
let(:params) { {
'config_source' => '/foo/config.yml',
'features_source' => '/foo/features.yml',
Expand All @@ -177,7 +168,6 @@
'types_source' => '/tmp/types.txt',
'version' => '1.2.3',
'repository' => 'foo',
'pubkey_auth0_source' => '/tmp/mypubkey',
'pubkey_keycloak_source' => '/tmp/mypubkey',
'region_mapping_source' => '/tmp/mapping.json',
'default_queries_source' => '/tmp/default_queries.php',
Expand Down Expand Up @@ -228,11 +218,8 @@
) }

it { is_expected.to contain_file('uitdatabank-search-api-pubkey-auth0').with(
'ensure' => 'file',
'owner' => 'www-data',
'group' => 'www-data',
'path' => '/var/www/udb3-search-service/public-auth0.pem',
'source' => '/tmp/mypubkey'
'ensure' => 'absent',
'path' => '/var/www/udb3-search-service/public-auth0.pem'
) }

it { is_expected.to contain_file('uitdatabank-search-api-region-mapping').with(
Expand Down Expand Up @@ -290,7 +277,6 @@
it { expect { catalogue }.to raise_error(Puppet::ParseError, /expects a value for parameter 'facilities_source'/) }
it { expect { catalogue }.to raise_error(Puppet::ParseError, /expects a value for parameter 'themes_source'/) }
it { expect { catalogue }.to raise_error(Puppet::ParseError, /expects a value for parameter 'types_source'/) }
it { expect { catalogue }.to raise_error(Puppet::ParseError, /expects a value for parameter 'pubkey_auth0_source'/) }
end
end
end
Expand Down
1 change: 0 additions & 1 deletion spec/classes/uitdatabank/search_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
it { expect { catalogue }.to raise_error(Puppet::ParseError, /expects a value for parameter 'facilities_source'/) }
it { expect { catalogue }.to raise_error(Puppet::ParseError, /expects a value for parameter 'themes_source'/) }
it { expect { catalogue }.to raise_error(Puppet::ParseError, /expects a value for parameter 'types_source'/) }
it { expect { catalogue }.to raise_error(Puppet::ParseError, /expects a value for parameter 'pubkey_auth0_source'/) }
it { expect { catalogue }.to raise_error(Puppet::ParseError, /expects a value for parameter 'pubkey_keycloak_source'/) }
end
end
Expand Down