From 0929840479e41625c7791324fd1ffc9ee82a4132 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Sat, 8 Apr 2017 21:30:56 +0200 Subject: [PATCH] Move puppet service disablement to o_p::server We don't need to stop the puppet service in single_use_slave, so as part of emptying out openstack_project::template, move that resource to openstack_project::server. We still need to disable the service during the image build so add that to the install_puppet.sh script. Change-Id: I11db1b49f083c7a30e7908ba5a4a7df9d4033c9f --- install_puppet.sh | 5 +++++ modules/openstack_project/manifests/server.pp | 19 +++++++++++++++++++ .../openstack_project/manifests/template.pp | 14 -------------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/install_puppet.sh b/install_puppet.sh index 43605453c2..27d3af9a57 100755 --- a/install_puppet.sh +++ b/install_puppet.sh @@ -226,6 +226,11 @@ EOF --assume-yes install -y --force-yes puppet git $rubypkg # Wipe out templatedir so we don't get warnings about it sed -i '/templatedir/d' /etc/puppet/puppet.conf + if [ -f /bin/systemctl ]; then + systemctl disable puppet + else + service puppet disable + fi } function setup_puppet_opensuse { diff --git a/modules/openstack_project/manifests/server.pp b/modules/openstack_project/manifests/server.pp index 108254f1cf..89f64633e3 100644 --- a/modules/openstack_project/manifests/server.pp +++ b/modules/openstack_project/manifests/server.pp @@ -135,6 +135,25 @@ class openstack_project::server ( require => Class['pip'], } + ########################################################### + # Turn off puppet service + + service { 'puppet': + ensure => stopped, + enable => false, + } + + if $::osfamily == 'Debian' { + file { '/etc/default/puppet': + ensure => present, + owner => 'root', + group => 'root', + mode => '0444', + source => 'puppet:///modules/openstack_project/puppet.default', + replace => true, + } + } + class { 'openstack_project::template': iptables_public_tcp_ports => $iptables_public_tcp_ports, iptables_public_udp_ports => $iptables_public_udp_ports, diff --git a/modules/openstack_project/manifests/template.pp b/modules/openstack_project/manifests/template.pp index 3bfe82348d..3d990b3afd 100644 --- a/modules/openstack_project/manifests/template.pp +++ b/modules/openstack_project/manifests/template.pp @@ -180,16 +180,6 @@ class openstack_project::template ( source => 'puppet:///modules/openstack_project/90no-translations', replace => true, } - - file { '/etc/default/puppet': - ensure => present, - owner => 'root', - group => 'root', - mode => '0444', - source => 'puppet:///modules/openstack_project/puppet.default', - replace => true, - } - } if ($::operatingsystem == 'CentOS') { @@ -202,10 +192,6 @@ class openstack_project::template ( replace => true, } } - service { 'puppet': - ensure => stopped, - enable => false, - } ###########################################################