launch cleanup job after deleting subscription
This commit is contained in:
parent
a37e5b6d60
commit
e75ecd858d
@ -318,21 +318,34 @@
|
|||||||
validate_certs: yes
|
validate_certs: yes
|
||||||
when: matrix_domain is defined
|
when: matrix_domain is defined
|
||||||
|
|
||||||
#- name: Remove '<< SUBSCRIPTION DELETION IN PROGRESS >>' job template
|
- name: Save new 'Delete Job Template' survey.json to the AWX tower, template
|
||||||
# delegate_to: 127.0.0.1
|
delegate_to: 127.0.0.1
|
||||||
# awx.awx.tower_job_template:
|
template:
|
||||||
# name: "0 - {{ subscription_id }} - << SUBSCRIPTION DELETION IN PROGRESS >>"
|
src: '{{ role_path }}/templates/delete_job_template.json.j2'
|
||||||
# job_type: run
|
dest: '/var/lib/awx/projects/hosting/delete_job_template.json'
|
||||||
# project: "{{ member_id }} - Matrix Docker Ansible Deploy"
|
|
||||||
# playbook: setup.yml
|
|
||||||
# state: absent
|
|
||||||
# tower_host: "https://{{ tower_host }}"
|
|
||||||
# tower_oauthtoken: "{{ tower_token.stdout }}"
|
|
||||||
# validate_certs: yes
|
|
||||||
|
|
||||||
# make new extra vars file
|
- name: Re-create '00 - Cleanup Deletion Template' job template
|
||||||
# remake 'delete delete playbook'
|
awx.awx.tower_job_template:
|
||||||
# launch it
|
name: "00 - Cleanup Deletion Template"
|
||||||
|
description: "Deletes the remaining '<< SUBSCRIPTION DELETION IN PROGRESS >>' job template."
|
||||||
|
job_type: run
|
||||||
|
inventory: "{{ org_name }} [Admin]"
|
||||||
|
project: "Ansible Create Delete Subscription Membership"
|
||||||
|
playbook: cleanup_deletion_job_template.yml
|
||||||
|
extra_vars: "{{ lookup('file', '/var/lib/awx/projects/hosting/delete_job_template.json') }}"
|
||||||
|
ask_extra_vars: yes
|
||||||
|
state: present
|
||||||
|
verbosity: 1
|
||||||
|
tower_host: "https://{{ tower_host }}"
|
||||||
|
tower_oauthtoken: "{{ tower_token.stdout }}"
|
||||||
|
validate_certs: yes
|
||||||
|
|
||||||
|
- name: Launch '00 - Cleanup Deletion Template' job template before ending
|
||||||
|
awx.awx.tower_job_launch:
|
||||||
|
job_template: "00 - Cleanup Deletion Template"
|
||||||
|
tower_host: "https://{{ tower_host }}"
|
||||||
|
tower_oauthtoken: "{{ tower_token.stdout }}"
|
||||||
|
validate_certs: yes
|
||||||
|
|
||||||
- name: Set boolean value to exit playbook
|
- name: Set boolean value to exit playbook
|
||||||
set_fact:
|
set_fact:
|
||||||
|
4
roles/matrix-awx/templates/delete_job_template.json.j2
Normal file
4
roles/matrix-awx/templates/delete_job_template.json.j2
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"subscription_id": "{{ subscription_id }}",
|
||||||
|
"member_id": "{{ member_id }}"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user