[queens-only] Rename the systemctl-daemon-reload exec

While rebasing puppet-rabbitmq due to other reasons, I noticed that the
undercloud (re) deploy would fail with:

2019-05-31 09:59:00,919 INFO: Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Exec[systemctl-daemon-reload] is already declared in file /etc/puppet/manifests/puppet-stack-config.pp:99; cannot redeclare at /etc/puppet/modules/systemd/manifests/systemctl/daemon_reload.pp:5 at /etc/puppet/modules/systemd/manifests/systemctl/daemon_reload.pp:5:3 at /etc/puppet/modules/rabbitmq/manifests/config.pp:231 on node undercloud-0.redhat.local
2019-05-31 09:59:00,982 INFO: + rc=1

This is because a newer puppet-rabbitmq introduced:
+
+ if $::facts['systemd'] {
+ Class['systemd::systemctl::daemon_reload'] -> Service['rabbitmq-server']
+ }
   }

Which then pulls in the exec called 'systemctl-daemon-reload' from the
systemd module which conflicts with the same call we do in undercloud
puppet manifest.
Let's just rename this exact to 'systemctl-daemon-undercloud' so we do
not duplicate this resource ever. Tested this on a queens undercloud
with a puppet-rabbitmq that triggers the problematic exec and got a
correctly redeployed undercloud.

We could have used the systemd module instead but that might require
other backports and this seems the smallest possible approach to solve
this.

Change-Id: I96f5e4e51947da6919724d8ffb8531b8ecf87ff8
Closes-Bug: #1831253
This commit is contained in:
Michele Baldessari 2019-05-31 16:33:34 +02:00
parent d381995a8c
commit d12465b4a0
1 changed files with 3 additions and 3 deletions

View File

@ -96,7 +96,7 @@ if hiera('tripleo::haproxy::service_certificate', undef) {
# MySQL
include ::tripleo::profile::base::database::mysql
# Raise the mysql file limit
exec { 'systemctl-daemon-reload':
exec { 'systemctl-daemon-reload-undercloud':
command => '/bin/systemctl daemon-reload',
refreshonly => true,
}
@ -113,9 +113,9 @@ file { '/etc/systemd/system/mariadb.service.d/limits.conf':
mode => '0644',
content => "[Service]\nLimitNOFILE=16384\n",
require => File['/etc/systemd/system/mariadb.service.d'],
notify => [Exec['systemctl-daemon-reload'], Service['mysqld']],
notify => [Exec['systemctl-daemon-reload-undercloud'], Service['mysqld']],
}
Exec['systemctl-daemon-reload'] -> Service['mysqld']
Exec['systemctl-daemon-reload-undercloud'] -> Service['mysqld']
file { '/var/log/journal':
ensure => 'directory',