Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use /etc/tomcat as configuration directory #256

Merged
merged 1 commit into from
Mar 25, 2024
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
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is now solved. We don't rely on the symlink to be resolved so perhaps SELinux will understand file contexts better.

$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