]> gitweb.fluxo.info Git - hydra.git/commitdiff
Facts: filter transient states such as uptime
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 1 Jul 2016 02:35:47 +0000 (23:35 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 1 Jul 2016 02:35:47 +0000 (23:35 -0300)
doc/todo.rst
lib/hydra/deploy

index 489d4f1c837b143d238a7073e9fd2c3f87409c13..4c4e0f534d539971013acbbe862f9cdff4c254d3 100644 (file)
@@ -5,7 +5,7 @@ TODO
 - deploy:
  - lockfile.
  - check for sudo config at the remote site.
- - facts: filter transient states such as uptime.
 - compile:
   - per-node compiled file.
   - backups: automatic definitions for per-node backup::users.
+- plugins support using lookup paths.
index 4c67cf88ceb83a4f1eec06fc772d3ec82d441394..3ef1dc0c83ced28b92169bd7cb4dbab04ef7a800 100644 (file)
@@ -244,7 +244,10 @@ 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 > $HYDRA_FOLDER/puppet/config/facts/$FQDN.yaml
+    $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" \
+              > $HYDRA_FOLDER/puppet/config/facts/$FQDN.yaml
 
     # Check result
     if [ "$?" != "0" ]; then