From 28007a665d8488b0c3d0a629b2423bcd5e26d426 Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Tue, 15 Dec 2015 15:27:32 -0500 Subject: [PATCH] Provide a toggle to disable repository management by puppet By default, repositories will be managed by puppet through manifests/repos.pp. If someone wants to set up different repositories outside of puppet entirely, he can "export MANAGE_REPOS=false" and run_tests will not run repos.pp. Change-Id: I3a09a2be1d2a064e784ed24f189fec41476330d9 --- fixtures/scenario001.pp | 1 - fixtures/scenario002.pp | 1 - fixtures/scenario003.pp | 1 - manifests/init.pp | 5 +++++ manifests/repos.pp | 3 --- run_tests.sh | 5 ++++- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/fixtures/scenario001.pp b/fixtures/scenario001.pp index 2d6f3d57c..7a2786cd5 100644 --- a/fixtures/scenario001.pp +++ b/fixtures/scenario001.pp @@ -15,7 +15,6 @@ # include ::openstack_integration -include ::openstack_integration::repos include ::openstack_integration::rabbitmq include ::openstack_integration::mysql include ::openstack_integration::keystone diff --git a/fixtures/scenario002.pp b/fixtures/scenario002.pp index 0fdd63d11..c686ab832 100644 --- a/fixtures/scenario002.pp +++ b/fixtures/scenario002.pp @@ -15,7 +15,6 @@ # include ::openstack_integration -include ::openstack_integration::repos include ::openstack_integration::rabbitmq include ::openstack_integration::mysql include ::openstack_integration::keystone diff --git a/fixtures/scenario003.pp b/fixtures/scenario003.pp index 0e8442f5d..6050c61f8 100644 --- a/fixtures/scenario003.pp +++ b/fixtures/scenario003.pp @@ -15,7 +15,6 @@ # include ::openstack_integration -include ::openstack_integration::repos include ::openstack_integration::rabbitmq include ::openstack_integration::mysql include ::openstack_integration::keystone diff --git a/manifests/init.pp b/manifests/init.pp index 1847d1e32..749c6a077 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -2,4 +2,9 @@ class openstack_integration { Exec { logoutput => 'on_failure' } + if $::osfamily == 'RedHat' { + package { 'openstack-selinux': + ensure => 'latest' + } + } } diff --git a/manifests/repos.pp b/manifests/repos.pp index fd01d3324..6f8e0a501 100644 --- a/manifests/repos.pp +++ b/manifests/repos.pp @@ -7,14 +7,11 @@ class openstack_integration::repos { release => 'liberty', package_require => true, } - $package_provider = 'apt' } 'RedHat': { class { '::openstack_extras::repo::redhat::redhat': release => 'liberty', } - package { 'openstack-selinux': ensure => 'latest' } - $package_provider = 'yum' } default: { fail("Unsupported osfamily (${::osfamily})") diff --git a/run_tests.sh b/run_tests.sh index 238f9077d..05aea3ea2 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -14,6 +14,7 @@ # under the License. export SCENARIO=${SCENARIO:-scenario001} +export MANAGE_REPOS=${MANAGE_REPOS:-true} export SCRIPT_DIR=$(cd `dirname $0` && pwd -P) source $SCRIPT_DIR/functions @@ -43,7 +44,6 @@ PUPPET_ARGS="--detailed-exitcodes --verbose --color=false --debug" function run_puppet() { local manifest=$1 - $SUDO puppet apply $PUPPET_ARGS fixtures/${manifest}.pp local res=$? @@ -70,6 +70,9 @@ fi # Run puppet and assert something changes. set +e +if [ "${MANAGE_REPOS}" = true ]; then + $SUDO puppet apply $PUPPET_ARGS -e "include ::openstack_integration::repos" +fi run_puppet $SCENARIO RESULT=$? set -e