Merge pull request #8 from salt-formulas/fix-ignore-missing-class

fix-ignore-missing-class
diff --git a/bootstrap.sh b/bootstrap.sh
index d705eed..eef8c4f 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -15,7 +15,7 @@
 # shopt -u dotglob
 export RECLASS_ROOT=${RECLASS_ROOT:-/srv/salt/reclass}
 function source_local_envs() {
-  for path in /tmp/kitchen /srv/salt . ${RECLASS_ROOT}/classes/cluster ${RECLASS_ROOT}/classes/cluster/${CLUSTER_NAME}; do
+  for path in / /tmp/kitchen /srv/salt . ${RECLASS_ROOT}/classes/cluster ${RECLASS_ROOT}/classes/cluster/${CLUSTER_NAME}; do
     for f in $(find $path -maxdepth 1 -name '*.env' 2> /dev/null); do
         echo "Sourcing env variables from $f"
         source $f
@@ -75,6 +75,7 @@
 # salt
 export SALT_MASTER=${SALT_MASTER:-127.0.0.1} # ip or fqdn
 export MINION_ID=${MINION_ID:-${HOSTNAME}.${DOMAIN}}
+export MASTER_HOSTNAME=${MASTER_HOSTNAME:-${HOSTNAME}.${DOMAIN}}
 
 # saltstack
 BOOTSTRAP_SALTSTACK=${BOOTSTRAP_SALTSTACK:-True}
@@ -272,31 +273,33 @@
 
   #sed -ie "s#\(reclass_data_revision.\).*#\1 $RECLASS_BRANCH#" $(find nodes -name ${MASTER_HOSTNAME}.yml|tail -n1)
 
-  mkdir -vp ${RECLASS_ROOT}/nodes
+  mkdir -vp ${RECLASS_ROOT}/nodes/_generated
   CONFIG=$(find ${RECLASS_ROOT}/nodes -name ${MINION_ID}.yml| grep yml | tail -n1)
-  CONFIG=${CONFIG:-${RECLASS_ROOT}/nodes/${MINION_ID}.yml}
+  CONFIG=${CONFIG:-${RECLASS_ROOT}/nodes/_generated/${MINION_ID}.yml}
   if [[ $SALT_MASTER_BOOTSTRAP_MINIMIZED =~ ^(True|true|1|yes)$ || ! -f "${CONFIG}" ]]; then
   cat <<-EOF > ${CONFIG}
 	classes:
-	- service.git.client
-	- system.linux.system.single
-	- system.salt.master.single
-	- system.salt.master.$FORMULAS_SOURCE
-	- system.reclass.storage.salt
+	- cluster.${CLUSTER_NAME}.infra.config
 	parameters:
 	  _param:
-	    reclass_data_repository: "$RECLASS_ADDRESS"
-	    reclass_data_revision: ${RECLASS_BRANCH:-master}
-	    salt_formula_branch: ${SALT_FORMULAS_BRANCH:-master}
-	    reclass_config_master: $SALT_MASTER
 	    single_address: $SALT_MASTER
 	    salt_master_host: $SALT_MASTER
 	    salt_master_base_environment: $SALT_ENV
-	    linux_system_codename: $DISTRIB_CODENAME
+	    salt_formula_branch: ${SALT_FORMULAS_BRANCH:-master}
+	    reclass_data_revision: ${RECLASS_BRANCH:-master}
+	    reclass_data_repository: "$RECLASS_ADDRESS"
+	    reclass_config_master: $SALT_MASTER
+	    linux_system_codename: ${DISTRIB_CODENAME}
+	    cluster_name: ${CLUSTER_NAME}
+	    cluster_domain: ${DOMAIN:-$CLUSTER_NAME.local}
 	  linux:
 	    system:
-	      name: $MINION_ID
-	      domain: $DOMAIN
+	      name: ${HOSTNAME:-cfg01}
+	      domain: ${DOMAIN:-$CLUSTER_NAME.local}
+	  #reclass:
+	  #  storage:
+	  #    data_source:
+	  #      engine: local
 	# ########
 EOF