Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Paas CI
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
INFN Cloud
Paas CI
Commits
51bc82ec
Commit
51bc82ec
authored
2 years ago
by
qweqweasdasd
Browse files
Options
Downloads
Patches
Plain Diff
First Change in ansible role
parent
c3203cad
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tasks/main.yml
+30
-3
30 additions, 3 deletions
tasks/main.yml
vars/main.yml
+1
-0
1 addition, 0 deletions
vars/main.yml
with
31 additions
and
3 deletions
tasks/main.yml
+
30
−
3
View file @
51bc82ec
...
...
@@ -5,17 +5,17 @@
url
:
"
{{
paas_ci_orchestrator_url
}}"
-
debug
:
var
:
paas_ci_workdir
var
:
paas_ci_workdir
-
block
:
-
name
:
Get template
get_url
:
url
:
"
{{
paas_ci_test.template_url
}}"
dest
:
"
{{
paas_ci_workdir
}}"
dest
:
"
{{
paas_ci_workdir
+
'/template.yaml'
}}"
-
name
:
Deployment command
set_fact
:
depcreate_cmd
:
"
orchent
depcreate
--ojson
single_vm
.yaml
-g
admins/beta-testers
{{
paas_ci_test.inputs
}}"
depcreate_cmd
:
"
orchent
depcreate
--ojson
template
.yaml
-g
admins/beta-testers
{{
paas_ci_test.inputs
}}"
-
name
:
Create the deployment
command
:
"
{{depcreate_cmd}}"
...
...
@@ -60,6 +60,33 @@
when
:
paas_ci_test_step == 'create_deployment'
-
block
:
-
name
:
Concatenate endpoints_to_scan items
set_fact
:
endpoints_to_scan_list
:
"
{{
{{
paas_ci_test.endpoints_to_scan
}}
|
join(',')
}}"
-
name
:
Run scan
command
:
python3 /home/gmp/script.py "{{ paas_ci_workdir }} '/dep.json'" "{{ paas_ci_workdir }} + '/report.txt'" "{{ paas_ci_workdir }} + '/severity'"
register
:
scan_output
-
name
:
cat report
command
:
cat "{{ paas_ci_workdir }} + '/report.txt'"
register
:
report_output
-
name
:
show report
debug
:
var
:
report_output
-
name
:
Get scan outputs (if successful)
assert
:
that
:
-
deployment.status == 'CREATE_COMPLETE'
fail_msg
:
"
TEST
FAILED
-
deployment
uuid:
{{
deployment.uuid
}},
status:
{{
deployment.status
}}"
success_msg
:
"
TEST
PASSED
-
deployment
uuid:
{{
deployment.uuid
}},
status:
{{
deployment.status
}},
outputs:
{{
deployment.outputs
}}"
when
:
paas_ci_test_step == 'scan'
-
block
:
-
set_fact
:
deployment
:
"
{{
lookup('file',
paas_ci_workdir
+
'/dep.json')
}}"
...
...
This diff is collapsed.
Click to expand it.
vars/main.yml
+
1
−
0
View file @
51bc82ec
...
...
@@ -5,3 +5,4 @@ paas_ci_test:
template_url
:
https://baltig.infn.it/infn-cloud/tosca-templates/-/raw/master/single-vm/single_vm.yaml
inputs
:
|
'{ "users": [{"os_user_add_to_sudoers": true, "os_user_name": "antonacci", "os_user_ssh_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDE887DQ8WcX5f8d9/MakzMhG/QovKzjrgDzJ0CwjxKm3kUYildhPcUtj7k73WdcP06st6cWpxQ+7HmFseuX+1GASorENAqMHbOvoT0K6pkNlgwgyDOYdR5JSnXIEfR7gTE391SuYN8lbLEvFCscNHYP6814tYochO+sSlpa3XJ2nHvvVp4Ikt/X2Q+zidkKzuMUwFeGf4MZz93Nlwcbg3UM+ENEjjksb7Rqxx2WtYAv8Gn6Jr1X3PmvMoaO9HBgZaosp7NXh20LRHJW+aiEKcr+vzFlgUjTcd/h2CrkgS6+AhjKqpMNS1sS/QuOvPVMUNr1dSOkmAR5EwfHcXpY9RL marica@MacBook-Air-di-marica.local"}]}'
endpoints
:
[
"
jupyter_notebook"
,
"
grafana_endpoint"
]
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