From: Silvio Rhatto Date: Sat, 22 Apr 2017 13:46:52 +0000 (-0300) Subject: Change strategy at hydra_deploy_facts_collect X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=cc74d8ceee791d8fa78683c0ca6390bbc260ec2d;p=hydra.git Change strategy at hydra_deploy_facts_collect --- 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 }