From d86aca6adac6f1fad2858a8c8facb02778168f8c Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Nov 15 2017 18:03:37 +0000 Subject: bin/prepare_test_show_highstate_env.sh: Various improvements and bugfixes: - Use pillar/id/$hostname_$domain.sls instead of just hostname (the docker CI worker has ID which is just the hostname, but in our workstations it might not be the same) - do not write custom grains in pillar/id/$fqdn, but instead write them all in /etc/salt/grains, otherwise they are ignored by show_highstate - strip out the inclusion of the secrets files, as the docker CI runner is not able to read them --- diff --git a/bin/prepare_test_show_highstate_env.sh b/bin/prepare_test_show_highstate_env.sh index 29fdb73..1f08bd7 100755 --- a/bin/prepare_test_show_highstate_env.sh +++ b/bin/prepare_test_show_highstate_env.sh @@ -17,7 +17,9 @@ $SUDO zypper -qn in --no-recommends salt git python3 python3-PyYAML $SUDO rm -rf /srv/{salt,pillar} $SUDO ln -s $PWD/salt /srv/salt $SUDO ln -s $PWD/pillar /srv/pillar -printf "domain: infra.opensuse.org\nosfullname:\nosmajorrelease:\nosrelease_info:" | $SUDO tee /etc/salt/grains > /dev/null -sed -i -e 's/^production:$/base:/' /srv/{salt,pillar}/top.sls +ID=$(hostname -f) ROLES=$(bin/get_roles.py --yaml) -printf "city:\ncountry:\nsalt_cluster: opensuse\nvirt_cluster:\n$ROLES" > pillar/id/${HOSTNAME}.sls +printf "city:\ncountry:\ndomain: infra.opensuse.org\nosfullname:\nosmajorrelease:\nosrelease_info:\n$ROLES\nsalt_cluster: opensuse\nvirt_cluster:" | $SUDO tee /etc/salt/grains > /dev/null +sed -i -e 's/^production:$/base:/' /srv/{salt,pillar}/top.sls +touch pillar/id/${ID//./_}.sls +sed -i -e "s#\- secrets\..*#- id.${ID//./_}#g" $(grep -lr "\- secrets\.")