From 764aaf6a5cfc6906e673322fac82d7b58419907e Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 31 May 2019 16:33:34 +0200 Subject: [PATCH] [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 (cherry picked from commit d12465b4a0134a2ecc0d5e5d9fb96cf55a730b6e) --- elements/puppet-stack-config/puppet-stack-config.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elements/puppet-stack-config/puppet-stack-config.pp b/elements/puppet-stack-config/puppet-stack-config.pp index 46f1c2e97..9cc27b1ef 100644 --- a/elements/puppet-stack-config/puppet-stack-config.pp +++ b/elements/puppet-stack-config/puppet-stack-config.pp @@ -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',