diff --git a/install_modules.sh b/install_modules.sh index 105198ee5b..caa70c4553 100755 --- a/install_modules.sh +++ b/install_modules.sh @@ -59,7 +59,11 @@ MODULES["puppetlabs-rabbitmq"]="4.0.0" # Source modules should use tags, explicit refs or remote branches because # we do not update local branches in this script. SOURCE_MODULES["https://github.com/nibalizer/puppet-module-puppetboard"]="2.4.0" -SOURCE_MODULES["https://git.openstack.org/openstack-infra/puppet-storyboard"]="origin/master" + +# Add modules that should be part of the openstack-infra integration test here +if [[ "$PUPPET_INTEGRATION_TEST" -ne "1" ]]; then + SOURCE_MODULES["https://git.openstack.org/openstack-infra/puppet-storyboard"]="origin/master" +fi MODULE_LIST=`puppet module list` diff --git a/modules/openstack_project/files/jenkins_job_builder/config/infra.yaml b/modules/openstack_project/files/jenkins_job_builder/config/infra.yaml index 237bb249c4..79a93f253a 100644 --- a/modules/openstack_project/files/jenkins_job_builder/config/infra.yaml +++ b/modules/openstack_project/files/jenkins_job_builder/config/infra.yaml @@ -113,3 +113,21 @@ publishers: - console-log + +- builder: + name: infra-puppet-apply + builders: + +- job-template: + name: 'gate-infra-puppet-apply-{ostype}' + node: 'bare-{ostype}' + + builders: + - shell: | + #!/bin/bash -xe + /usr/zuul-env/bin/zuul-cloner --cache-dir /opt/git git://git.openstack.org openstack-infra/config + cd openstack-infra/config + ./tools/apply-test.sh + + publishers: + - console-log diff --git a/modules/openstack_project/files/jenkins_job_builder/config/projects.yaml b/modules/openstack_project/files/jenkins_job_builder/config/projects.yaml index 1822232bab..a3d85d34f8 100644 --- a/modules/openstack_project/files/jenkins_job_builder/config/projects.yaml +++ b/modules/openstack_project/files/jenkins_job_builder/config/projects.yaml @@ -277,6 +277,11 @@ - gate-{name}-pep8 - gate-{name}-bashate - experimental-swift-logs-{name}-pep8 + - gate-infra-puppet-apply-{ostype}: + ostype: + - precise + - trusty + - centos6 - project: name: gitdm diff --git a/modules/openstack_project/files/zuul/layout.yaml b/modules/openstack_project/files/zuul/layout.yaml index 44b4aa1489..8700d2b1fb 100644 --- a/modules/openstack_project/files/zuul/layout.yaml +++ b/modules/openstack_project/files/zuul/layout.yaml @@ -2935,6 +2935,8 @@ projects: - ci-docs experimental: - experimental-swift-logs-config-pep8 + - gate-infra-puppet-apply-precise + - gate-infra-puppet-apply-centos6 - name: openstack-infra/devstack-gate template: diff --git a/tools/apply-test.sh b/tools/apply-test.sh new file mode 100755 index 0000000000..d5cd92ba12 --- /dev/null +++ b/tools/apply-test.sh @@ -0,0 +1,72 @@ +#!/bin/bash -ex + +# Copyright 2014 Hewlett-Packard Development Company, L.P. +# +# 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. + +ROOT=$(readlink -fn $(dirname $0)/..) +MODULE_PATH="${ROOT}/modules:/etc/puppet/modules" + +export PUPPET_INTEGRATION_TEST=1 + +cat > clonemap.yaml < $f.final + FOUND=1 + fi +done + +if [[ $FOUND == "0" ]]; then + echo "No hosts found for node type $CODENAME" + exit 1 +fi + +grep -v 127.0.1.1 /etc/hosts >/tmp/hosts +HOST=`echo $HOSTNAME |awk -F. '{ print $1 }'` +echo "127.0.1.1 $HOST.openstack.org $HOST" >> /tmp/hosts +sudo mv /tmp/hosts /etc/hosts + +sudo mkdir -p /var/run/puppet +sudo -E bash -x ./install_modules.sh +find applytest -name 'puppetapplytest*.final' -print0 | \ + xargs -0 -P $(nproc) -n 1 -I filearg \ + sudo puppet apply --modulepath=${MODULE_PATH} --noop --verbose --debug filearg > /dev/null