Colleagues, I have a variable that I get inside the gitlab task with a bash script.
add_token_uat:
stage: add_token
script:
- |
token=$(curl -X 'POST' 'https://xxxx.xxxx.uat.fgislk.xxxxxx.xxx/subsystem/token/get' -H 'accept: */*' -H 'Content-Type: application/json' -d '{
"subsystem": "XXXX",
"authKey": "XXXXX"
}' -sk | grep -Po '{"token":"\K[^","]+')
rules:
- if: $STAND == "uat"
How to pass the token variable further in the pipeline? I want to use this variable in the next task:
add_subsystem_microservices_configs:
stage: add_subsystem_microservices_configs
script:
- ansible-playbook roles/add_subsystem.yml --extra-vars "@vars/${SUBSYSTEM}.yml" -D
when: manual
How to pass variable to add_subsystem.yaml file?