From 435754e5a63a277bb4bfbb0fe2f8f318abb9aea0 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 30 Aug 2017 15:33:16 +0200 Subject: [PATCH] Simplify variable access (#165) This should effectively be no change. --- manifests/katello.pp | 2 +- manifests/qpid.pp | 2 +- spec/classes/certs_katello_spec.rb | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/manifests/katello.pp b/manifests/katello.pp index dc161c4b..aaca22d0 100644 --- a/manifests/katello.pp +++ b/manifests/katello.pp @@ -56,7 +56,7 @@ # katello-default-ca is needed for the katello-agent to work properly # (especially in the custom certs scenario) files => ["${katello_rhsm_setup_script_location}:755=${katello_www_pub_dir}/${katello_rhsm_setup_script}"], - bootstrap_script => inline_template('/bin/bash <%= @katello_rhsm_setup_script_location %>'), + bootstrap_script => "/bin/bash ${katello_rhsm_setup_script_location}", postun_script => 'test -f /etc/rhsm/rhsm.conf.kat-backup && command cp /etc/rhsm/rhsm.conf.kat-backup /etc/rhsm/rhsm.conf', alias => $candlepin_cert_rpm_alias, subscribe => $server_ca, diff --git a/manifests/qpid.pp b/manifests/qpid.pp index d3dd06f0..c39a7c8d 100644 --- a/manifests/qpid.pp +++ b/manifests/qpid.pp @@ -62,7 +62,7 @@ client_cert => $ca_cert, trustargs => 'TCu,Cu,Tuw', refreshonly => true, - subscribe => Pubkey[$::certs::ca_cert], + subscribe => Pubkey[$ca_cert], } ~> certs::ssltools::certutil { 'broker': nss_db_dir => $nss_db_dir, diff --git a/spec/classes/certs_katello_spec.rb b/spec/classes/certs_katello_spec.rb index 7c18eed7..749a3412 100644 --- a/spec/classes/certs_katello_spec.rb +++ b/spec/classes/certs_katello_spec.rb @@ -10,9 +10,18 @@ "class {'certs': pki_dir => '/tmp', server_ca_name => 'server_ca', default_ca_name => 'default_ca'}" end - describe 'with katello certs set' do - # source format should be -> "${certs::pki_dir}/certs/${server_ca_name}.crt" - it { should contain_trusted_ca__ca('katello_server-host-cert').with({ :source => "/tmp/certs/server_ca.crt" }) } + it { should contain_trusted_ca__ca('katello_server-host-cert').with_source('/tmp/certs/server_ca.crt') } + + it do + should contain_certs_bootstrap_rpm('katello-ca-consumer-foo.example.com') + .with_dir('/var/www/html/pub') + .with_summary('Subscription-manager consumer certificate for Katello instance foo.example.com') + .with_description('Consumer certificate and post installation script that configures rhsm.') + .with_files(['/usr/bin/katello-rhsm-consumer:755=/var/www/html/pub/katello-rhsm-consumer']) + .with_bootstrap_script('/bin/bash /usr/bin/katello-rhsm-consumer') + .with_postun_script('test -f /etc/rhsm/rhsm.conf.kat-backup && command cp /etc/rhsm/rhsm.conf.kat-backup /etc/rhsm/rhsm.conf') + .with_alias('katello-ca-consumer-latest.noarch.rpm') + .that_subscribes_to(['Ca[server_ca]', 'Certs::Rhsm_reconfigure_script[/var/www/html/pub/katello-rhsm-consumer]']) end end end