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
3a1e60d9
Commit
3a1e60d9
authored
1 year ago
by
Nathan Rodet
Browse files
Options
Downloads
Patches
Plain Diff
update
parent
ef31d580
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#79023
failed
1 year ago
Stage: prepare
Stage: build
Stage: deploy
Stage: destroy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+5
-7
5 additions, 7 deletions
.gitlab-ci.yml
terraform/main.tf
+2
-2
2 additions, 2 deletions
terraform/main.tf
terraform/variables-gitlab.tf
+1
-1
1 addition, 1 deletion
terraform/variables-gitlab.tf
with
8 additions
and
10 deletions
.gitlab-ci.yml
+
5
−
7
View file @
3a1e60d9
...
...
@@ -18,7 +18,7 @@ before_script:
-
export TF_VAR_SCW_PROJECT_ID=${TF_VAR_SCW_PROJECT_ID}
-
export TF_VAR_ENVIRONMENT=${ENVIRONMENT}
-
export TF_VAR_INSTANCE_COUNT=${TF_VAR_INSTANCE_COUNT}
-
export TF_VAR_SSH_
KEY_PATH=${
SSH
_
KEY
_PATH}.pub
#
- export TF_VAR_SSH_
PUBLIC_KEY= SET AFTER
SSH
KEY
CREATION
stages
:
-
prepare
...
...
@@ -30,11 +30,9 @@ stages:
sshkey
:
stage
:
prepare
script
:
-
ssh-keygen -b 2048 -t rsa -f $SSH_KEY_PATH -q -N ""
-
ls
-
ls /tmp
-
echo $SSH_KEY_PATH
-
cat $SSH_KEY_PATH
-
ssh-keygen -b 2048 -t rsa -C "${ENVIRONMENT}-cma-update-tmp" -f ${SSH_KEY_PATH} -q -N ""
-
export TF_VAR_SSH_PUBLIC_KEY=$(cat ${SSH_KEY_PATH}.pub)
-
echo ${TF_VAR_SSH_PUBLIC_KEY}
ansible-hosts-file
:
stage
:
prepare
...
...
@@ -76,7 +74,7 @@ apply:
ansible
:
stage
:
deploy
script
:
-
ansible-playbook -i $ANSIBLE_ROOT/tasks/update.yaml --private-key ${SSH_KEY_PATH}
-
ansible-playbook -i $
{
ANSIBLE_ROOT
}
/tasks/update.yaml --private-key ${SSH_KEY_PATH}
destroy
:
stage
:
destroy
...
...
This diff is collapsed.
Click to expand it.
terraform/main.tf
+
2
−
2
View file @
3a1e60d9
...
...
@@ -3,8 +3,8 @@
##############
resource
"scaleway_iam_ssh_key"
"ssh-key"
{
name
=
"
${
var
.
ENVIRONMENT
}
-ssh-key"
name
=
"
${
var
.
ENVIRONMENT
}
-
cma-
ssh-key"
project_id
=
var
.
SCW_PROJECT_ID
public_key
=
file
(
var
.
SSH_
KEY_PATH
)
public_key
=
var
.
SSH_
PUBLIC_KEY
}
This diff is collapsed.
Click to expand it.
terraform/variables-gitlab.tf
+
1
−
1
View file @
3a1e60d9
...
...
@@ -23,7 +23,7 @@ variable "ENVIRONMENT" {
description
=
"Environment of the deployment, contained in domains, subdomains and resources name convention"
}
variable
"SSH_
KEY_PATH
"
{
variable
"SSH_
PUBLIC_KEY
"
{
type
=
string
sensitive
=
true
description
=
"SSH key to use for the deployment"
...
...
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