Merge "Delegate tasks from the tobiko-cleanup role to undercloud"
This commit is contained in:
commit
372cb72ce7
@ -1,4 +1,8 @@
|
|||||||
---
|
---
|
||||||
|
- name: "from which host the cleanup will be executed"
|
||||||
|
set_fact:
|
||||||
|
cleanup_delegate_to: '{{ groups.get("undercloud", []) | first | default(test_host) }}'
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- include_role: name=tobiko-ir-jenkins
|
- include_role: name=tobiko-ir-jenkins
|
||||||
when: "(lookup('env','JENKINS_URL') | length) > 0"
|
when: "(lookup('env','JENKINS_URL') | length) > 0"
|
||||||
@ -59,7 +63,10 @@
|
|||||||
|
|
||||||
rescue:
|
rescue:
|
||||||
- name: "clean up heat stacks generated during tobiko tests"
|
- name: "clean up heat stacks generated during tobiko tests"
|
||||||
include_role: name=tobiko-cleanup
|
include_role:
|
||||||
|
name: tobiko-cleanup
|
||||||
|
apply:
|
||||||
|
delegate_to: '{{ cleanup_delegate_to }}'
|
||||||
when: stacks_cleanup
|
when: stacks_cleanup
|
||||||
|
|
||||||
- name: "finalize test execution"
|
- name: "finalize test execution"
|
||||||
@ -71,7 +78,10 @@
|
|||||||
|
|
||||||
|
|
||||||
- name: "clean up heat stacks generated during tobiko tests"
|
- name: "clean up heat stacks generated during tobiko tests"
|
||||||
include_role: name=tobiko-cleanup
|
include_role:
|
||||||
|
name: tobiko-cleanup
|
||||||
|
apply:
|
||||||
|
delegate_to: '{{ cleanup_delegate_to }}'
|
||||||
when: stacks_cleanup
|
when: stacks_cleanup
|
||||||
|
|
||||||
- name: "finalize test execution"
|
- name: "finalize test execution"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
# OpenStack client credentials
|
# OpenStack command
|
||||||
stackrc_file: '{{ ansible_user_dir }}/overcloudrc'
|
openstack_cmd: 'openstack --os-cloud overcloud'
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
---
|
---
|
||||||
- name: "cleanup Loadbalancers created by Tobiko tests"
|
- name: "cleanup Loadbalancers created by Tobiko tests"
|
||||||
shell: |
|
shell: |
|
||||||
source {{ stackrc_file }}
|
{{ openstack_cmd }} loadbalancer list -f value -c 'name' | \
|
||||||
openstack loadbalancer list -f value -c 'name' | \
|
|
||||||
grep "^tobiko\." | \
|
grep "^tobiko\." | \
|
||||||
xargs -r openstack loadbalancer delete --cascade --wait
|
xargs -r {{ openstack_cmd }} loadbalancer delete --cascade --wait
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: "cleanup Heat stacks created by Tobiko tests"
|
- name: "cleanup Heat stacks created by Tobiko tests"
|
||||||
shell: |
|
shell: |
|
||||||
source {{ stackrc_file }}
|
{{ openstack_cmd }} stack list -f value -c 'Stack Name' | \
|
||||||
openstack stack list -f value -c 'Stack Name' | \
|
|
||||||
grep "^tobiko\." | \
|
grep "^tobiko\." | \
|
||||||
xargs -r timeout 180 openstack stack delete -y --wait
|
xargs -r timeout 180 {{ openstack_cmd }} stack delete -y --wait
|
||||||
register: result
|
register: result
|
||||||
retries: 5
|
retries: 5
|
||||||
delay: 5
|
delay: 5
|
||||||
@ -21,24 +19,21 @@
|
|||||||
|
|
||||||
- name: "cleanup subnet pools created by Tobiko tests"
|
- name: "cleanup subnet pools created by Tobiko tests"
|
||||||
shell: |
|
shell: |
|
||||||
source {{ stackrc_file }}
|
{{ openstack_cmd }} subnet pool list -f value -c 'Name' | \
|
||||||
openstack subnet pool list -f value -c 'Name' | \
|
|
||||||
grep "^tobiko\." | \
|
grep "^tobiko\." | \
|
||||||
xargs -r openstack subnet pool delete
|
xargs -r {{ openstack_cmd }} subnet pool delete
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: "cleanup Security Groups created by Tobiko tests"
|
- name: "cleanup Security Groups created by Tobiko tests"
|
||||||
shell: |
|
shell: |
|
||||||
source {{ stackrc_file }}
|
{{ openstack_cmd }} security group list -f value -c 'Name' | \
|
||||||
openstack security group list -f value -c 'Name' | \
|
|
||||||
grep "^tobiko\." | \
|
grep "^tobiko\." | \
|
||||||
xargs -r openstack security group delete
|
xargs -r {{ openstack_cmd }} security group delete
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: "cleanup Glance images created by Tobiko tests"
|
- name: "cleanup Glance images created by Tobiko tests"
|
||||||
shell: |
|
shell: |
|
||||||
source {{ stackrc_file }}
|
{{ openstack_cmd }} image list -f value -c 'Name' | \
|
||||||
openstack image list -f value -c 'Name' | \
|
|
||||||
grep "^tobiko\." | \
|
grep "^tobiko\." | \
|
||||||
xargs -r openstack image delete
|
xargs -r {{ openstack_cmd }} image delete
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user