summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-06-23 16:23:09 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-06-23 16:23:09 -0300
commit0509c1d1221231e6c796021e673281765d6cd90c (patch)
tree65535c24d4073e66048be13a592304f2de1890ab /lib
parent3baee42b732ad815a0bb2c7de886a2b0200b91f3 (diff)
downloadhydra-0509c1d1221231e6c796021e673281765d6cd90c.tar.gz
hydra-0509c1d1221231e6c796021e673281765d6cd90c.tar.bz2
Deploy: facts collection
Diffstat (limited to 'lib')
-rw-r--r--lib/hydra/deploy14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/hydra/deploy b/lib/hydra/deploy
index 748263c..7a8f2e3 100644
--- a/lib/hydra/deploy
+++ b/lib/hydra/deploy
@@ -15,6 +15,9 @@ function hydra_deploy_setup {
# Fix puppet folder permissions
chmod 700 $HYDRA_FOLDER/puppet
+ # Ensure facts folder
+ mkdir -p $HYDRA_FOLDER/puppet/config/facts
+
if [ "$1" == "remote" ]; then
# Deploy in a remote host
if [ ! -z "$2" ]; then
@@ -196,3 +199,14 @@ function hydra_deploy_copy {
$DEPLOY_RSYNC "$RSYNC_PATH" $orig $dest
fi
}
+
+# Collects facts from a system
+function hydra_deploy_facts_collect {
+ echo "Collecting facts from remote system..."
+
+ if [ "$1" == "local" ]; then
+ facter --yaml > $HYDRA_FOLDER/puppet/config/facts/$FQDN.yaml
+ elif [ "$1" == "remote" ]; then
+ $HYDRA_CONNECT $FQDN facter --yaml > $HYDRA_FOLDER/puppet/config/facts/$FQDN.yaml
+ fi
+}