]> gitweb.fluxo.info Git - hydra.git/commitdiff
Provision: config file autodiscovery also matches fqdn
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 2 Jun 2017 18:49:08 +0000 (15:49 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 2 Jun 2017 18:49:08 +0000 (15:49 -0300)
lib/hydra/provision

index 62e066ca0d9f8657373b38a9d38df377109b1317..850230b91d88d513c91d5d656a9c24454538ce7a 100644 (file)
@@ -2,6 +2,8 @@
 
 # Load provision configuration
 function hydra_provision_config_load {
+  local domain="`facter domain`"
+
   if [ ! -z "$1" ]; then
     if [ -f "$1" ]; then
       echo "Using configuration from file $1..."
@@ -9,6 +11,9 @@ function hydra_provision_config_load {
     elif [ -f "$1.conf" ]; then
       echo "Using configuration from file $1.conf..."
       source "$1.conf"
+    elif [ -f "$1.$domain.conf" ]; then
+      echo "Using configuration from file $1.$domain.conf..."
+      source "$1.$domain.conf"
     elif [ -f "$HYDRA_FOLDER/config/provision/$1" ]; then
       echo "Using configuration from $HYDRA_FOLDER/config/provision/$1..."
       source "$HYDRA_FOLDER/config/provision/$1"