]> gitweb.fluxo.info Git - hydra.git/commitdiff
Change strategy at hydra_deploy_facts_collect
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 22 Apr 2017 13:46:52 +0000 (10:46 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 22 Apr 2017 13:46:52 +0000 (10:46 -0300)
lib/hydra/deploy

index 7e2d40bb29354214164f8723b08c3790a16ee1d1..001c92f9ba16cf1556d0d08f565bdf49b21da21f 100644 (file)
@@ -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
 }