diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2015-10-19 13:20:21 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2015-10-19 13:20:21 -0200 |
commit | 8b9c9827522a28d197c543faca52cdb6ea238d81 (patch) | |
tree | 2ca302d1a26dc94be21450c40885765c6d476766 | |
parent | 7fd68eec9d6925c868094d60eddfc4ca8d762ad2 (diff) | |
download | hydra-8b9c9827522a28d197c543faca52cdb6ea238d81.tar.gz hydra-8b9c9827522a28d197c543faca52cdb6ea238d81.tar.bz2 |
Misc fixes
-rw-r--r-- | lib/hydra/deploy | 6 | ||||
-rwxr-xr-x | share/hydra/newnode | 15 |
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 ) |