Skip to content

Commit

Permalink
Use /etc/tomcat as configuration directory
Browse files Browse the repository at this point in the history
The /usr/share/tomcat/conf path is already a symlink to /etc/tomcat so
this just makes it more explicit.
  • Loading branch information
ekohl authored and ehelms committed Mar 25, 2024
1 parent 9cd5deb commit 1a26d77
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
8 changes: 4 additions & 4 deletions manifests/artemis.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@
group => $candlepin::group,
}

file { "${candlepin::catalina_home}/conf/login.config":
file { "${candlepin::tomcat_conf}/login.config":
ensure => file,
content => file('candlepin/tomcat/login.config'),
mode => '0640',
owner => $candlepin::user,
group => $candlepin::group,
}

file { "${candlepin::catalina_home}/conf/cert-users.properties":
file { "${candlepin::tomcat_conf}/cert-users.properties":
ensure => file,
content => Deferred('inline_epp', ["katelloUser=<%= \$artemis_client_dn %>\n", { 'artemis_client_dn' => $candlepin::artemis_client_dn }]),
mode => '0640',
owner => $candlepin::user,
group => $candlepin::group,
}

file { "${candlepin::catalina_home}/conf/cert-roles.properties":
file { "${candlepin::tomcat_conf}/cert-roles.properties":
ensure => file,
content => file('candlepin/tomcat/cert-roles.properties'),
mode => '0640',
owner => $candlepin::user,
group => $candlepin::group,
}

file { "${candlepin::catalina_home}/conf/conf.d/jaas.conf":
file { "${candlepin::tomcat_conf}/conf.d/jaas.conf":
ensure => file,
content => file('candlepin/tomcat/jaas.conf'),
mode => '0640',
Expand Down
4 changes: 2 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@
'truststore_password' => $candlepin::_truststore_password,
}

file { '/etc/tomcat/server.xml':
file { "${candlepin::tomcat_conf}/server.xml":
ensure => file,
content => epp('candlepin/tomcat/server.xml.epp', $server_context),
mode => '0640',
owner => 'root',
group => $candlepin::group,
}

file { '/etc/tomcat/tomcat.conf':
file { "${candlepin::tomcat_conf}/tomcat.conf":
ensure => file,
content => template('candlepin/tomcat/tomcat.conf.erb'),
mode => '0644',
Expand Down
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
# In new-style instances, if CATALINA_BASE isn't specified, it will be
# constructed by joining TOMCATS_BASE and NAME.
#
# @param tomcat_conf
# Where your the tomcat configuration lives
#
# @param java_home
# Where your java installation lives
#
Expand Down Expand Up @@ -218,6 +221,7 @@
Stdlib::Host $host = 'localhost',
Stdlib::Absolutepath $candlepin_conf_file = '/etc/candlepin/candlepin.conf',
Stdlib::Absolutepath $tomcat_base = '/var/lib/tomcats/',
Stdlib::Absolutepath $tomcat_conf = '/etc/tomcat',
Stdlib::Absolutepath $java_home = '/usr/lib/jvm/jre',
Stdlib::Absolutepath $catalina_home = '/usr/share/tomcat',
Stdlib::Absolutepath $catalina_tmpdir = '/var/cache/tomcat/temp',
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/basic_candlepin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
its(:stdout) { should match(/least strength: (A|strong)/) }
end

describe file("/usr/share/tomcat/conf/cert-users.properties") do
describe file("/etc/tomcat/cert-users.properties") do
it { should be_file }
it { should be_mode 640 }
it { should be_owned_by 'tomcat' }
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/candlepin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
])
end

it { is_expected.to contain_file('/usr/share/tomcat/conf/login.config') }
it { is_expected.to contain_file('/usr/share/tomcat/conf/cert-roles.properties') }
it { is_expected.to contain_file('/usr/share/tomcat/conf/conf.d/jaas.conf') }
it { is_expected.to contain_file('/etc/tomcat/login.config') }
it { is_expected.to contain_file('/etc/tomcat/cert-roles.properties') }
it { is_expected.to contain_file('/etc/tomcat/conf.d/jaas.conf') }
it do
is_expected.to contain_file('/usr/share/tomcat/conf/cert-users.properties').
is_expected.to contain_file('/etc/tomcat/cert-users.properties').
with_content("katelloUser=CN=ActiveMQ Artemis Client, OU=Artemis, O=ActiveMQ, L=AMQ, ST=AMQ, C=AMQ\n")
end

Expand Down
8 changes: 4 additions & 4 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@

# Workaround for https://github.com/theforeman/puppet-candlepin/issues/185#issuecomment-822284497
$tomcat_conf_files = [
'/usr/share/tomcat/conf/login.config',
'/usr/share/tomcat/conf/cert-users.properties',
'/usr/share/tomcat/conf/cert-roles.properties',
'/usr/share/tomcat/conf/conf.d/jaas.conf'
'/etc/tomcat/login.config',
'/etc/tomcat/cert-users.properties',
'/etc/tomcat/cert-roles.properties',
'/etc/tomcat/conf.d/jaas.conf'
]
file { $tomcat_conf_files:
ensure => file,
Expand Down

0 comments on commit 1a26d77

Please sign in to comment.