updated remove postgres registration
diff --git a/tasks/main.yml b/tasks/main.yml
index 4958704..a4295f9 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -1,13 +1,30 @@
---
# tasks file for /Users/carlosfrias/apigee-workspace/opdk-workspace/apigee-opdk-setup-qpid-remove
+- name: Set attributes if available
+ ignore_errors: true
+ set_fact:
+ uuid: "{{ hostvars[groups[qpid_group_name][0]].edge_qs_self.uUID }}"
+ server_type: "{{ hostvars[groups[qpid_group_name][0]].edge_qs_self.type[0] }}"
+
+- name: Assert that attributes are available.
+ assert:
+ that:
+ - "ax_group is defined and ax_group | trim | length > 0"
+ - "consumer_group is defined and consumer_group | trim | length > 0"
+ - "server_type is defined and server_type | trim | length > 0"
+ - "uuid is defined and uuid | trim | length > 0"
+ - "local_mgmt_ip is defined and local_mgmt_ip | trim | length > 0"
+ - "opdk_user_email is defined and opdk_user_email | trim | length > 0"
+ - "opdk_user_pass is defined and opdk_user_pass | trim | length > 0"
+ msg: "Please provide the missing attribute"
+
- name: Remove qpid from consumer groups
- delegate_to: '{{ inventory_hostname }}'
uri:
user: '{{ opdk_user_email }}'
password: '{{ opdk_user_pass }}'
method: DELETE
- url: http://{{ local_mgmt_ip }}:8080/v1/analytics/groups/ax/{{ ax_group }}/consumer-groups/{{ consumer_group }}/consumers/{{ edge_qs_self.uUID }}
body_format: json
+ url: http://{{ local_mgmt_ip }}:8080/v1/analytics/groups/ax/{{ ax_group }}/consumer-groups/{{ consumer_group }}/consumers/{{ uuid }}
- name: Remove qpid server
uri:
@@ -15,6 +32,6 @@
password: '{{ opdk_user_pass }}'
method: DELETE
body_format: json
- url: http://{{ local_mgmt_ip }}:8080/v1/analytics/groups/ax/{{ ax_group }}/servers?uuid={{ edge_qs_self.uUID }}&type={{ edge_qs_self.type[0] }}
+ url: http://{{ local_mgmt_ip }}:8080/v1/analytics/groups/ax/{{ ax_group }}/servers?uuid={{ uuid }}&type={{ server_type }}
diff --git a/tests/test.yml b/tests/test.yml
index 014aba4..5232120 100644
--- a/tests/test.yml
+++ b/tests/test.yml
@@ -2,4 +2,15 @@
- hosts: localhost
remote_user: root
roles:
- - /Users/carlosfrias/apigee-workspace/opdk-workspace/apigee-opdk-setup-qpid-remove
\ No newline at end of file
+ - /Users/carlosfrias/apigee-workspace/opdk-workspace/apigee-opdk-setup-qpid-remove
+
+- hosts: ms
+ gather_facts: no
+ vars_files:
+ - ~/.apigee-secure/credentials.yml
+ roles:
+ - { role: apigee-opdk-setup-qpid-remove,
+ ax_group: axgroup001,
+ consumer_group: consumer-group-001
+ }
+