aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2020-05-25 11:19:36 -0300
committerSilvio Rhatto <rhatto@riseup.net>2020-05-25 11:19:36 -0300
commitc04cae496085ae08978aa096271b7cbc191e1e5a (patch)
treef657044f648b2d2e5ed94b0320fc20026ac765c0
parenta21dbd1b1273b3bd51eb339887579bb076792e6c (diff)
downloadpuppet-bootstrap-c04cae496085ae08978aa096271b7cbc191e1e5a.tar.gz
puppet-bootstrap-c04cae496085ae08978aa096271b7cbc191e1e5a.tar.bz2
Provision: setup facts
-rwxr-xr-xbin/deploy7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/deploy b/bin/deploy
index 3680129..518e03a 100755
--- a/bin/deploy
+++ b/bin/deploy
@@ -66,6 +66,13 @@ if [ -e "$BASEDIR/Puppetfile" ]; then
fi
fi
+# Setup facts
+ROLE="`hydractl yaml-param nodo::role $BASEDIR/config/node/$FQDN.yaml default`"
+LOCATION="`hydractl yaml-param nodo::location $BASEDIR/config/node/$FQDN.yaml default`"
+$SUDO mkdir -p /etc/facter/facts.d
+$SUDO echo "role=$ROLE" | $SUDO tee /etc/facter/facts.d/role.txt > /dev/null
+$SUDO echo "location=$LOCATION" | $SUDO tee /etc/facter/facts.d/location.txt > /dev/null
+
# Run puppet apply
PUPPET_OPTS="--confdir=$BASEDIR --modulepath=$BASEDIR/modules"
LC_ALL=C $SUDO puppet apply $PUPPET_OPTS $PUPPET_MANIFEST