Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scaleway instances template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
systemes-dinformation
alpha
pocs
Cloud Machinist
cloud machinist templates
scaleway instances template
Commits
b56a679a
Commit
b56a679a
authored
1 year ago
by
Nathan Rodet
Browse files
Options
Downloads
Patches
Plain Diff
reworked script
parent
2d53a9c7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#78821
failed
1 year ago
Stage: prepare
Stage: validate
Stage: build
Stage: deploy
Stage: destroy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+9
-5
9 additions, 5 deletions
.gitlab-ci.yml
scripts/build-ansible-hosts.sh
+4
-4
4 additions, 4 deletions
scripts/build-ansible-hosts.sh
with
13 additions
and
9 deletions
.gitlab-ci.yml
+
9
−
5
View file @
b56a679a
...
...
@@ -35,11 +35,15 @@ ansible_hosts_file:
script
:
-
ls
-
ls ${ANSIBLE_ROOT}
-
echo "instances:" > ${HOST_FILE_PATH}
-
cat ${HOST_FILE_PATH}
-
echo " hosts:" >> ${HOST_FILE_PATH}
-
cat ${HOST_FILE_PATH}
-
echo "$(for ((i=0; i<=${TF_VAR_INSTANCE_COUNT}; i++)); do echo " ${TF_VAR_ENVIRONMENT}-${i}.cma.alpha.grandlyon.com:"; done)" >> ${HOST_FILE_PATH}
-
|+
# Create hosts.yaml file with base configuration
echo "instances: " > ${HOST_FILE_PATH}
echo " hosts:" >> ${HOST_FILE_PATH}
# Add host url for each instance
for ((i=0; i<=${TF_VAR_INSTANCE_COUNT}; i++)); do
echo " ${TF_VAR_ENVIRONMENT}-${i}.cma.alpha.grandlyon.com:" >> ${HOST_FILE_PATH}
done
-
cat ${HOST_FILE_PATH}
-
ls
-
ls ${ANSIBLE_ROOT}
...
...
This diff is collapsed.
Click to expand it.
scripts/build-ansible-hosts.sh
+
4
−
4
View file @
b56a679a
#!/bin/bash
HOST_FILE_PATH
=
$ANSIBLE_ROOT
/hosts.yaml
{
HOST_FILE_PATH
}
=
$ANSIBLE_ROOT
/hosts.yaml
# Create hosts.yaml file with base configuration
echo
"instances:
hosts:"
>
$HOST_FILE_PATH
hosts:"
>
$
{
HOST_FILE_PATH
}
# Add host url for each instance
for
((
i
=
0
;
i<
=
$TF_VAR_INSTANCE_COUNT
;
i++
))
;
do
echo
"
$TF_VAR_ENVIRONMENT
-
${
i
}
.cma.alpha.grandlyon.com:"
>>
$HOST_FILE_PATH
for
((
i
=
0
;
i<
=
$
{
TF_VAR_INSTANCE_COUNT
}
;
i++
))
;
do
echo
"
$
{
TF_VAR_ENVIRONMENT
}
-
${
i
}
.cma.alpha.grandlyon.com:"
>>
$
{
HOST_FILE_PATH
}
done
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment