Stop installing and running puppet in node builds

Move non-puppet-related parts of the puppet element into other elements,
remove the puppet element, and stop running the prepare-node script.

\o/

Change-Id: Ib241ea976ca0a3d661599f36e3f5a2d4eb023c08
This commit is contained in:
Colleen Murphy 2017-04-27 20:46:58 +02:00
parent b0e55c306b
commit 0d55fc765d
16 changed files with 3 additions and 176 deletions

View File

@ -17,7 +17,6 @@ rsyslog:
git: git:
rsync: rsync:
parted: parted:
puppet:
wget: wget:
iputils-ping: iputils-ping:
dnsutils: dnsutils:
@ -26,3 +25,4 @@ iptables:
centos-release-openstack-ocata: centos-release-openstack-ocata:
redhat-rpm-config: redhat-rpm-config:
redhat-lsb-core: redhat-lsb-core:
curl:

View File

@ -10,6 +10,7 @@
"gentoo": { "gentoo": {
"build-essential": "", "build-essential": "",
"cron": "sys-process/cronie", "cron": "sys-process/cronie",
"curl": "net-misc/curl",
"ntp": "net-misc/ntp", "ntp": "net-misc/ntp",
"python-dev": "", "python-dev": "",
"python3-dev": "", "python3-dev": "",
@ -38,7 +39,6 @@
"git": "git-core", "git": "git-core",
"iputils-ping": "iputils", "iputils-ping": "iputils",
"ntpdate": "", "ntpdate": "",
"puppet": "ruby2.1-rubygem-puppet",
"python-dev": "python-devel", "python-dev": "python-devel",
"python3-dev": "python3-devel", "python3-dev": "python3-devel",
"iptables": "iptables SuSEfirewall2", "iptables": "iptables SuSEfirewall2",
@ -46,6 +46,7 @@
} }
}, },
"default": { "default": {
"curl": "curl",
"iptables": "iptables-persistent", "iptables": "iptables-persistent",
"gentoolkit": "", "gentoolkit": "",
"centos-release-openstack-ocata": "", "centos-release-openstack-ocata": "",

View File

@ -1,5 +1,4 @@
jenkins-slave jenkins-slave
package-installs package-installs
pip-and-virtualenv pip-and-virtualenv
puppet
zuul-worker zuul-worker

View File

@ -1,4 +1,3 @@
cache-url cache-url
prepare-node prepare-node
puppet
source-repositories source-repositories

View File

@ -1,2 +1 @@
nodepool-base nodepool-base
puppet

View File

@ -21,9 +21,5 @@ if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
fi fi
set -e set -e
export SUDO='true'
prepare-node
mkdir -p ~jenkins/cache/files mkdir -p ~jenkins/cache/files
mkdir -p ~jenkins/cache/pip mkdir -p ~jenkins/cache/pip

View File

@ -1 +0,0 @@
Bootstrap puppet on a node

View File

@ -1,59 +0,0 @@
#!/bin/bash
# Copyright (C) 2011-2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
# dib-lint: disable=setu setpipefail dibdebugtrace indent
set -e
SUDO=${SUDO:-true}
if [ -n "$NODEPOOL_SSH_KEY" ] ; then
puppet_ssh_key="ssh_key => '$NODEPOOL_SSH_KEY',"
else
puppet_ssh_key=""
fi
export FACTER_in_chroot=true
cat >/tmp/local.pp <<EOF
Service {
start => '/bin/true',
stop => '/bin/true',
status => '/bin/true',
restart => '/bin/true'
}
class {'openstack_project::single_use_slave':
sudo => $SUDO,
$puppet_ssh_key
}
EOF
# Puppet doesn't return nonzero if some things fail by default.
# Use detailed exit codes to get that info and determine whether
# the return code indicates failure.
set +e
puppet apply --detailed-exitcodes --color=false \
--modulepath=/opt/build_git/openstack-infra/system-config/modules:/etc/puppet/modules \
/tmp/local.pp
PUPPET_RETURN=$?
if [ "$PUPPET_RETURN" -eq 4 ] || [ "$PUPPET_RETURN" -eq 6 ] ; then
exit $PUPPET_RETURN
fi
set -e
# Make sure resolv.conf settings don't break dib
if [ -n "$NODEPOOL_STATIC_NAMESERVER_V4" ] ; then
echo "nameserver $NODEPOOL_STATIC_NAMESERVER_V4"> /etc/resolv.conf
fi

View File

@ -1,4 +0,0 @@
cache-url
openstack-repos
package-installs
source-repositories

View File

@ -1,30 +0,0 @@
#!/bin/bash
# Copyright (C) 2011-2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e
# Unset the download cache for this invocation to prevent bleed from build host
unset PIP_DOWNLOAD_CACHE
SETUP_PIP=false /bin/bash /opt/build_git/openstack-infra/system-config/install_puppet.sh
/bin/bash /opt/build_git/openstack-infra/system-config/install_modules.sh
install -m 0755 -o root -g root $(dirname $0)/../bin/prepare-node /usr/local/bin

View File

@ -1,60 +0,0 @@
#!/bin/bash
# Copyright (C) 2011-2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
# Remove additional sources used to install puppet or special version of pypi.
# We do this because leaving these sources in place causes every test that
# does an apt-get update to hit those servers which may not have the uptime
# of our local mirrors.
# dib-lint: disable=sete setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e
OS_FAMILY=$(facter osfamily)
case $OS_FAMILY in
"Debian")
repo=/etc/apt/sources.list.d/puppetlabs.list
update="apt-get update"
;;
"RedHat")
repo=/etc/yum.repos.d/puppetlabs.repo
# yum/dnf will notice this is gone, so don't need to spend
# time updating.
update=""
;;
"Gentoo")
# make a fake repo to satisfy the removal below
touch /tmp/fakerepo
repo=/tmp/fakerepo
update=""
;;
"Suse")
repo=/etc/zypp/repos.d/systemsmanagement_puppet.repo
update=""
;;
*)
die "Don't know how to cleanup!"
;;
esac
rm -f $repo
$update
rm /usr/local/bin/prepare-node

View File

@ -1 +0,0 @@
curl:

View File

@ -1,10 +0,0 @@
{
"family": {
"gentoo": {
"curl": "net-misc/curl"
}
},
"default": {
"curl": "curl"
}
}

View File

@ -869,7 +869,6 @@ diskimages:
- openstack-repos - openstack-repos
- nodepool-base - nodepool-base
- cache-devstack - cache-devstack
- puppet
- cache-bindep - cache-bindep
- growroot - growroot
- infra-package-needs - infra-package-needs
@ -891,7 +890,6 @@ diskimages:
- nodepool-base - nodepool-base
- cache-devstack - cache-devstack
- initialize-urandom - initialize-urandom
- puppet
- cache-bindep - cache-bindep
- growroot - growroot
- infra-package-needs - infra-package-needs