Cleanup F5 configuration
Head back to the .gitlab-ci.yml file and add a final stage of delete, so that the section looks as follows:
stages:
- registry
- container
- info
- test
- staging
- delete
Add the following details for the staging block to the end of the file:
delete_config:
stage: delete
rules:
- if: '$CI_COMMIT_BRANCH == "delete"'
when: manual
tags:
- ansible_f5
image: ${CI_REGISTRY}/${CI_PROJECT_PATH}/ansible:latest
script:
- echo $ANSIBLE_VAULT_PASSWORD > vault_passwd
- ansible-playbook -i inventories/staging/ --vault-password-file vault_passwd bigip-delete-configuration.yml
Commit the changes. This will trigger another pipeline run, but we can ignore it.