diff options
Diffstat (limited to 'grid5000/steps/setup/debian/run_orchestrator.yaml')
-rw-r--r-- | grid5000/steps/setup/debian/run_orchestrator.yaml | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/grid5000/steps/setup/debian/run_orchestrator.yaml b/grid5000/steps/setup/debian/run_orchestrator.yaml new file mode 100644 index 0000000..76074cd --- /dev/null +++ b/grid5000/steps/setup/debian/run_orchestrator.yaml @@ -0,0 +1,43 @@ +# Provision a VM by launching a puppet agent (standalone) +- puppet_build_path: "/tmp/puppet_recipes" +- hiera_path: "/tmp/hiera" +- puppet_local_path: $${kameleon_data_dir}/setup/puppet +- hiera_local_path: $${kameleon_data_dir}/setup/hiera +- version_file: modules/env/files/version +- release_file: modules/env/files/min/image_versioning/release +- kameleon_repo_name : "default" + + + +- import_puppet_recipes: + - exec_in: mkdir -p $${puppet_build_path} + - exec_local: rsync -e "ssh -F $${ssh_config_file}" -r $${puppet_local_path}/ $${kameleon_recipe_name}:$${puppet_build_path} +- import_hiera: + - exec_in: mkdir -p $${hiera_path} + - exec_local: rsync -e "ssh -F $${ssh_config_file}" -r $${hiera_local_path}/ $${kameleon_recipe_name}:$${hiera_path} + - exec_in: puppet config set hiera_config $${hiera_path}/hiera.yaml + +# Store G5K environment release information +- set_release: + - exec_in: echo "$${distrib}$${release_number}-$${g5k_image_arch}-$${g5k_variant}-$${g5k_version}" >> $${puppet_build_path}/$${release_file} + # this extracts last git commit hash from local repo + - pipe: + - exec_local: | + git rev-parse HEAD 2>/dev/null || echo "Error: Kameleon could find git log in local or in $HOME/.kameleon.d/repos/$${kameleon_repo_name}/" ; + - exec_in: cat - >> $${puppet_build_path}/$${release_file} +# Also store version +- set_version: + - exec_in: echo "$${g5k_version}" > $${puppet_build_path}/$${version_file} + +- run_puppet: + - exec_in: | + set +e + if [ -z "$${g5k_variant}" ]; then + VARIANT=std + else + VARIANT=$${g5k_variant} + fi + puppet apply --detailed-exitcodes -d --modulepath=$${puppet_build_path}/modules:/etc/puppet/code/modules $${puppet_build_path}/manifests/$VARIANT.pp | tee /tmp/puppet_exec.log + ret=$? + echo $ret + if [ $ret -eq 2 -o $ret -eq 0 ] ; then true ; else false ; fi # Set exit code to 0 |