diff --git a/manifests/site.pp b/manifests/site.pp index 2f566c0b46..f156f55bb4 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1,22 +1,3 @@ -# -# Top-level variables -# -# There must not be any whitespace between this comment and the variables or -# in between any two variables in order for them to be correctly parsed and -# passed around in test.sh -# -# Note we do not do a hiera lookup here as we set $group on a per node basis -# and that must be set before we can do hiera lookups. Doing a hiera lookup -# here would fail to find any group specific info. -$elasticsearch_nodes = [ - "elasticsearch02.openstack.org", - "elasticsearch03.openstack.org", - "elasticsearch04.openstack.org", - "elasticsearch05.openstack.org", - "elasticsearch06.openstack.org", - "elasticsearch07.openstack.org", -] - # # Default: should at least behave like an openstack server # @@ -225,6 +206,15 @@ node /^logstash\d*\.open.*\.org$/ { node /^logstash-worker\d+\.open.*\.org$/ { $group = 'logstash-worker' + $elasticsearch_nodes = [ + 'elasticsearch02.openstack.org', + 'elasticsearch03.openstack.org', + 'elasticsearch04.openstack.org', + 'elasticsearch05.openstack.org', + 'elasticsearch06.openstack.org', + 'elasticsearch07.openstack.org', + ] + class { 'openstack_project::server': } class { 'openstack_project::logstash_worker': @@ -250,6 +240,16 @@ node /^subunit-worker\d+\.open.*\.org$/ { # Node-OS: xenial node /^elasticsearch\d+\.open.*\.org$/ { $group = "elasticsearch" + + $elasticsearch_nodes = [ + 'elasticsearch02.openstack.org', + 'elasticsearch03.openstack.org', + 'elasticsearch04.openstack.org', + 'elasticsearch05.openstack.org', + 'elasticsearch06.openstack.org', + 'elasticsearch07.openstack.org', + ] + class { 'openstack_project::server': } class { 'openstack_project::elasticsearch_node': discover_nodes => $elasticsearch_nodes, diff --git a/tools/apply-test.sh b/tools/apply-test.sh index c3593d45e6..399146901d 100755 --- a/tools/apply-test.sh +++ b/tools/apply-test.sh @@ -22,18 +22,15 @@ fi trap "mv ~/applytest applytest" EXIT -# First split the variables at the beginning of the file -csplit -sf ~/applytest/prep $PUPPET_MANIFEST '/^$/' {0} -# Then split the class defs. -csplit -sf ~/applytest/puppetapplytest ~/applytest/prep01 '/^}$/' {*} +# Split the class defs. +csplit -sf ~/applytest/puppetapplytest $PUPPET_MANIFEST '/^}$/' {*} # Remove } header left by csplit sed -i -e '/^\}$/d' ~/applytest/puppetapplytest* # Comment out anything that doesn't begin with a space. # This gives us the node {} internal contents. -sed -i -e 's/^[^][:space:]$]/#&/g' ~/applytest/prep00 ~/applytest/puppetapplytest* -sed -i -e 's@hiera(.\([^.]*\).,\([^)]*\))@\2@' ~/applytest/prep00 ~/applytest/puppetapplytest* -sed -i -e "s@hiera(.\([^.]*\).)@'\1NoDefault'@" ~/applytest/prep00 ~/applytest/puppetapplytest* -mv ~/applytest/prep00 ~/applytest/head # These are the top-level variables defined in site.pp +sed -i -e 's/^[^][:space:]$]/#&/g' ~/applytest/puppetapplytest* +sed -i -e 's@hiera(.\([^.]*\).,\([^)]*\))@\2@' ~/applytest/puppetapplytest* +sed -i -e "s@hiera(.\([^.]*\).)@'\1NoDefault'@" ~/applytest/puppetapplytest* if [[ `lsb_release -i -s` == 'CentOS' ]]; then if [[ `lsb_release -r -s` =~ '7' ]]; then @@ -55,7 +52,7 @@ for f in `find ~/applytest -name 'puppetapplytest*' -print` ; do echo "Skipping $f due to unsupported puppet version" continue else - cat ~/applytest/head $f > $f.final + cp $f $f.final FOUND=1 fi fi