aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/hydra/deploy6
-rwxr-xr-xshare/hydra/newnode15
2 files changed, 13 insertions, 8 deletions
diff --git a/lib/hydra/deploy b/lib/hydra/deploy
index d5df1a0..928aecc 100644
--- a/lib/hydra/deploy
+++ b/lib/hydra/deploy
@@ -53,9 +53,9 @@ function hydra_deploy_setup {
# Common parameters
DOMAIN="`echo $FQDN | cut -d . -f 2-`"
- ROLE="`hydra_yaml_param nodo::role $HYDRA_FOLDER/$DOMAIN/$FQDN.yaml`"
- LOCATION="`hydra_yaml_param nodo::location $HYDRA_FOLDER/$DOMAIN/$FQDN.yaml`"
- DEPLOY_PUPPET="puppet appy $PUPPET_OPTS $PUPPET_MANIFEST"
+ ROLE="`hydra_yaml_param nodo::role $HYDRA_FOLDER/puppet/hiera/$DOMAIN/$FQDN.yaml`"
+ LOCATION="`hydra_yaml_param nodo::location $HYDRA_FOLDER/puppet/hiera/$DOMAIN/$FQDN.yaml`"
+ DEPLOY_PUPPET="puppet apply $PUPPET_OPTS $PUPPET_MANIFEST"
DEPLOY_APPLY="$DEPLOY_COMMAND $DEPLOY_PUPPET"
# Check for manifest
diff --git a/share/hydra/newnode b/share/hydra/newnode
index 7cb7ae4..16ca402 100755
--- a/share/hydra/newnode
+++ b/share/hydra/newnode
@@ -61,19 +61,24 @@ else
fi
# Copy YAML template
-mkdir -p $HYDRA_FOLDER/puppet/hiera/production/domain/$DOMAIN/node
-cp $YAML $HYDRA_FOLDER/puppet/hiera/production/domain/$DOMAIN/node/$NODE.$DOMAIN.yaml
+mkdir -p $HYDRA_FOLDER/puppet/hiera/node
+cp $YAML $HYDRA_FOLDER/puppet/hiera/node/$NODE.$DOMAIN.yaml
+
+# Setup secret YAML template
+mkdir $HYDRA_FOLDER/puppet/hiera/secrets/node
+echo "---" > $HYDRA_FOLDER/puppet/hiera/secrets/node/$NODE.$DOMAIN.yaml
# Copy node template
mkdir -p $HYDRA_FOLDER/puppet/manifests/nodes
cp $PP $HYDRA_FOLDER/puppet/manifests/nodes/$NODE.$DOMAIN.pp
# Edit the template
-sed -i -e "s/nodename/$NODE/g" $HYDRA_FOLDER/puppet/manifests/nodes/$NODE.pp
-sed -i -e "s/example.org/$DOMAIN/g" $HYDRA_FOLDER/puppet/manifests/nodes/$NODE.pp
+sed -i -e "s/nodename/$NODE/g" $HYDRA_FOLDER/puppet/manifests/nodes/$NODE.$DOMAIN.pp
+sed -i -e "s/example.org/$DOMAIN/g" $HYDRA_FOLDER/puppet/manifests/nodes/$NODE.$DOMAIN.pp
# Add to git
(
cd $HYDRA_FOLDER/puppet
- git add manifests/site.pp manifests/nodes/$NODE.pp hiera/production/domain/$DOMAIN/node/$NODE.$DOMAIN.yaml
+ git add manifests/site.pp manifests/nodes/$NODE.pp hiera/node/$NODE.$DOMAIN.yaml
+ git add manifests/site.pp manifests/nodes/$NODE.pp hiera/secrets/node/$NODE.$DOMAIN.yaml
)