Skip to content
Snippets Groups Projects
Commit 88946d11 authored by Nathan Rodet's avatar Nathan Rodet
Browse files

reworked bash script

parent 1eee8127
No related branches found
No related tags found
No related merge requests found
Pipeline #78494 failed
......@@ -15,6 +15,7 @@ before_script:
- export TF_VAR_SCW_SECRET_KEY=${TF_VAR_SCW_SECRET_KEY}
- export TF_VAR_SCW_PROJECT_ID=${TF_VAR_SCW_PROJECT_ID}
- export TF_VAR_ENVIRONMENT=${ENVIRONMENT}
- export INSTANCE_COUNT=${TF_VAR_INSTANCE_COUNT}
stages:
- prepare
......@@ -35,6 +36,7 @@ ssh_key:
- ls
- ls ${SCRIPTS_ROOT}
- ls ${ANSIBLE_ROOT}
- cat ${ANSIBLE_ROOT}/hosts.yaml
init:
stage: prepare
......
#!/bin/bash
export HOST_FILE_PATH=${ANSIBLE_ROOT}/hosts.yaml
HOST_FILE_PATH=$ANSIBLE_ROOT/hosts.yaml
# Create hosts.yaml file with base configuration
echo "instances:
......@@ -8,5 +8,5 @@ echo "instances:
# Add host url for each instance
for ((i=0; i<=$INSTANCE_COUNT; i++)); do
echo " ${ENVIRONMENT}-${i}.cma.alpha.grandlyon.com:" >> $HOST_FILE_PATH
echo " $TF_VAR_ENVIRONMENT-${i}.cma.alpha.grandlyon.com:" >> $HOST_FILE_PATH
done
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment