Commit 8ef2a1da authored by Simon Rose's avatar Simon Rose
Browse files

Merge branch 'master' into 'icshwi_9584_rename_server'

# Conflicts:
#   copy-db-prod-to-test.yml
parents 53f4ebd8 6cb868ae
Pipeline #123587 passed with stage
in 22 minutes and 19 seconds
---
- hosts: ce-deploy-01.esss.lu.se
- hosts: "ce-deploy-01.esss.lu.se,ce-template-01.esss.lu.se"
become: true
tasks:
- name: Create database dump
docker_container:
name: ccce-dump
name: "{{ ccce_area }}-dump"
image: postgres:13.3
detach: false
cleanup: true
purge_networks: "yes"
networks:
- name: ccce
- name: "{{ ccce_area }}"
env:
PGHOST: ccce-database
PGDATABASE: "{{ ce_deploy_database_name }}"
PGUSER: "{{ ce_deploy_database_username }}"
PGPASSWORD: "{{ ce_deploy_database_password }}"
command: pg_dump --format=custom --file=/tmp/ccce/ccce.dump
PGHOST: "{{ ccce_area }}-database"
PGDATABASE: "{{ ce_template_database_name }}"
PGUSER: "{{ ce_template_database_username }}"
PGPASSWORD: "{{ ce_template_database_password }}"
command: pg_dump --format=custom --file=/tmp/ccce/{{ ccce_area }}.dump
volumes:
- /tmp/ccce:/tmp/ccce
- name: Fetch database dump
fetch:
src: /tmp/ccce/ccce.dump
dest: "{{ playbook_dir }}/ccce.dump"
src: /tmp/ccce/{{ ccce_area }}.dump
dest: "{{ playbook_dir }}/{{ ccce_area }}.dump"
flat: true
- name: Delete database dump (on source host)
file:
path: /tmp/ccce/ccce.dump
path: /tmp/ccce/{{ ccce_area }}.dump
state: absent
- hosts: ce-deploy-test.cslab.esss.lu.se
- hosts: "ce-deploy-test.cslab.esss.lu.se,ce-template-test.cslab.esss.lu.se"
become: true
tasks:
- name: Copy database dump
copy:
src: "{{ playbook_dir }}/ccce.dump"
dest: /tmp/ccce.dump
src: "{{ playbook_dir }}/{{ ccce_area }}.dump"
dest: /tmp/{{ ccce_area }}.dump
- name: Apply database dump
docker_container:
name: ccce-backup
name: "{{ ccce_area }}-backup"
image: postgres:13.3
detach: false
cleanup: true
purge_networks: "yes"
networks:
- name: ccce
- name: "{{ ccce_area }}"
env:
PGHOST: ccce-database
PGUSER: "{{ ce_deploy_database_username }}"
PGPASSWORD: "{{ ce_deploy_database_password }}"
command: pg_restore --clean --dbname="{{ ce_deploy_database_name }}" /tmp/ccce.dump
PGHOST: "{{ ccce_area }}-database"
PGUSER: "{{ ce_template_database_username }}"
PGPASSWORD: "{{ ce_template_database_password }}"
command: pg_restore --clean --dbname="{{ ce_template_database_name }}" /tmp/{{ ccce_area }}.dump
volumes:
- /tmp/ccce.dump:/tmp/ccce.dump
- /tmp/{{ ccce_area }}.dump:/tmp/{{ ccce_area }}.dump
- name: Delete database dump (on target host)
file:
path: /tmp/ccce.dump
path: /tmp/{{ ccce_area }}.dump
state: absent
- hosts: 127.0.0.1
......@@ -66,5 +66,5 @@
tasks:
- name: Delete database dump (on controller host)
file:
path: "{{ playbook_dir }}/ccce.dump"
path: "{{ playbook_dir }}/{{ ccce_area }}.dump"
state: absent
......@@ -19,15 +19,4 @@ ce_template_rbac_server_address: https://rbac.esss.lu.se/service/
ccce_ccdb_base_url: https://ccdb.esss.lu.se
ccce_gitlab_host: https://gitlab.esss.lu.se
ce_template_gitlab_technical_user_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
66643538613038653039333635356562646136643661623463323361313836343263346339373236
3461343764346261616634643466306437663434633033330a366634653464323064363530633466
37653038313935356130663536366461656337303236343438613835616531663737623338636637
3630363266613332370a333362363665643632326166366139306333653135653066646238656237
31366439666136303834643961663433343366326136343835356332393930383331
ce_template_gitlab_allowed_output_group_id: 611
ce_template_gitlab_allowed_template_group_id: 6425
ce_template_gitlab_allowed_config_group_id: 6426
ce_template_openapi_server: "{{ ce_template_server_address }}"
---
ce_template_gitlab_technical_user_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
66643538613038653039333635356562646136643661623463323361313836343263346339373236
3461343764346261616634643466306437663434633033330a366634653464323064363530633466
37653038313935356130663536366461656337303236343438613835616531663737623338636637
3630363266613332370a333362363665643632326166366139306333653135653066646238656237
31366439666136303834643961663433343366326136343835356332393930383331
ce_template_gitlab_allowed_output_group_id: 7225
ce_template_gitlab_allowed_template_group_id: 7229
ce_template_gitlab_allowed_config_group_id: 7230
ce_template_database_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
32306236373061396436373566333333613834623161353537663239396337313063306130663739
3736316439306337373437323734363666666466303631350a623930633865373263336566313935
64323362633937323133353538333538313231323633666639626334326161316432376235623930
3166333035343365320a653136376132323238653864633766386133643463346463306536386536
61396433373034626236633265386539346262323765613164626237303065323235
ce_template_hostname: ce-template.esss.lu.se
---
ce_template_gitlab_technical_user_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
33383265393639623730656131396566373032326131376233356636623862353130646637363130
3839303631653365636638643739636138313130623430620a343232346231386365376430343932
66303030386566326663656437303936626663666261656562346336636434363839653166306566
3532316133333765660a613166383535376139663864313931616533623166646530323265373036
34303330336535313430316561616565313362373032343031626665346665303435
ce_template_gitlab_allowed_output_group_id: 611
ce_template_gitlab_allowed_template_group_id: 6425
ce_template_gitlab_allowed_config_group_id: 6426
ce_template_database_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
30356265303362613931326165363765663232346334323364623639663666396563313031633734
3666623539303830363062393436353738393334386437380a356362346437633531643135383561
61346439393235326236376335393332383336636363373665366438626637396664386666653665
3935633639316364620a653731373630393761373264353538643664343263653035646535653036
38313437313533396539383136383261646438663032613865383261663334653164
ce_template_rbac_server_address: https://icsvs-app01.esss.lu.se/rbac/service/
---
ce_template_gitlab_technical_user_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
62366630373463353361333931326165313031616365383234386330363162343266363534363466
3837386237613235306439643535663737313338646239360a306434636232616233396566663434
33643232396663343563653965383937326162373232323462386262656363363936646233626661
6133646136366633370a326636353237653962356361326335366234333163633032623031613036
38356535316166613464313332323035306566663137336232313034643237323766
ce_template_gitlab_allowed_output_group_id: 7225
ce_template_gitlab_allowed_template_group_id: 7229
ce_template_gitlab_allowed_config_group_id: 7230
ce_template_database_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
30356265303362613931326165363765663232346334323364623639663666396563313031633734
3666623539303830363062393436353738393334386437380a356362346437633531643135383561
61346439393235326236376335393332383336636363373665366438626637396664386666653665
3935633639316364620a653731373630393761373264353538643664343263653035646535653036
38313437313533396539383136383261646438663032613865383261663334653164
$ANSIBLE_VAULT;1.1;AES256
30356265303362613931326165363765663232346334323364623639663666396563313031633734
3666623539303830363062393436353738393334386437380a356362346437633531643135383561
61346439393235326236376335393332383336636363373665366438626637396664386666653665
3935633639316364620a653731373630393761373264353538643664343263653035646535653036
38313437313533396539383136383261646438663032613865383261663334653164
ce_template_rbac_server_address: https://icsvs-app01.esss.lu.se/rbac/service/
......@@ -21,6 +21,9 @@ provisioner:
host_vars:
ce-template-host:
ce_template_gitlab_technical_user_token: "gitlab-token"
ce_template_gitlab_allowed_output_group_id: 611
ce_template_gitlab_allowed_template_group_id: 6425
ce_template_gitlab_allowed_config_group_id: 6426
verifier:
name: testinfra
......
......@@ -39,7 +39,7 @@
scm_type: "{{ ccce_awx_project_scm_type | default(omit) }}"
scm_url: "{{ ccce_awx_project_scm_url | default(omit) }}"
scm_branch: "{{ ccce_ioc_deploy_playbook_branch | default(omit) }}"
allow_override: yes
allow_override: true
scm_update_on_launch: "{{ ccce_awx_project_scm_update_on_launch | default(omit) }}"
local_path: "{{ ccce_awx_project_local_path | default(omit) }}"
......@@ -281,6 +281,10 @@
- hosts: ce_template
become: true
roles:
- role: ics-ans-role-repository
tags:
- ce-template-backend
- ce-template-ui
- role: ics-ans-role-traefik
tags:
- ce-template-backend
......
---
- src: git+https://gitlab.esss.lu.se/ics-ansible-galaxy/ics-ans-role-repository.git
version: v0.13.0
- src: git+https://gitlab.esss.lu.se/ics-ansible-galaxy/ics-ans-role-docker.git
version: v1.6.0
- src: git+https://gitlab.esss.lu.se/ics-ansible-galaxy/ics-ans-role-traefik.git
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment