aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-04-22 10:46:52 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-04-22 10:46:52 -0300
commitcc74d8ceee791d8fa78683c0ca6390bbc260ec2d (patch)
tree63cccdb7155d1019fc8cf1f17c5633aa5e8d081a /lib
parent326cfa5a6150d669fdfbd961f5fac75c4779c542 (diff)
downloadhydra-cc74d8ceee791d8fa78683c0ca6390bbc260ec2d.tar.gz
hydra-cc74d8ceee791d8fa78683c0ca6390bbc260ec2d.tar.bz2
Change strategy at hydra_deploy_facts_collect
Diffstat (limited to 'lib')
-rw-r--r--lib/hydra/deploy14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/hydra/deploy b/lib/hydra/deploy
index 7e2d40b..001c92f 100644
--- a/lib/hydra/deploy
+++ b/lib/hydra/deploy
@@ -244,12 +244,7 @@ function hydra_deploy_facts_collect {
if [ "$1" == "local" ]; then
$SUDO facter --yaml > $HYDRA_FOLDER/puppet/config/facts/$FQDN.yaml
elif [ "$1" == "remote" ]; then
- $HYDRA_CONNECT $FQDN sudo facter --yaml | \
- grep -v -e '^ *seconds' -e '^ *hours' -e '^ *days' -e '^ *uptime' \
- -e '^ *uptime' -e '^ *system_uptime' -e '^ *memoryfree' -e '^ *swapfree_mb' \
- -e '^ *memorysize' -e '^ *swapfree' -e '^ *seconds' -e '^ *hours' \
- -e '^ *days' -e '^ *uptime_' -e '^ *macaddress' \
- > $HYDRA_FOLDER/puppet/config/facts/$FQDN.yaml
+ $HYDRA_CONNECT $FQDN sudo facter --yaml > $HYDRA_FOLDER/puppet/config/facts/$FQDN.yaml
# Check result
if [ "$?" != "0" ]; then
@@ -257,4 +252,11 @@ function hydra_deploy_facts_collect {
return 1
fi
fi
+
+ # Remove transient info
+ sed -i -e '/^ *seconds:/d' -e '/^ *hours:/d' -e '/^ *days:/d' -e '/^ *uptime:/d' \
+ -e '/^ *uptime:/d' -e '/^ *system_uptime:/d' -e '/^ *memoryfree/d' -e '/^ *swapfree_mb:/d' \
+ -e '/^ *memorysize/d' -e '/^ *swapfree:/d' -e '/^ *seconds:/d' -e '/^ *hours:/d' \
+ -e '/^ *days:/d' -e '/^ *uptime_/d' -e '/^ *macaddress:/d' \
+ $HYDRA_FOLDER/puppet/config/facts/$FQDN.yaml
}