Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: localhost
- vars:
- solace:
- url: "{{ lookup('env','SOLACE_URL') }}"
- user: "{{ lookup('env','SOLACE_USER') }}"
- password: "{{ lookup('env','SOLACE_PASSWORD') }}"
- tasks:
- - name: Get msgVpns in solace cluster
- uri:
- url: "{{ solace.url }}/msgVpns"
- method: GET
- user: "{{ solace.user}}"
- password: "{{ solace.password }}"
- status_code: 200
- register: msgVpns
- - name: Get the first msgVpns information in the solace cluster
- set_fact:
- firstMsgVpn: "{{ msgVpns.json.links[0] }}"
- - name: Get the queues endpoints
- uri:
- url: "{{ firstMsgVpn.queuesUri }}"
- method: GET
- user: "{{ solace.user}}"
- password: "{{ solace.password }}"
- status_code: 200
- register: queues
- - name: Getting a look of the queues
- debug:
- var: queues
- - name: Creating the queues
- uri:
- url: "{{ firstMsgVpn.queuesUri }}"
- method: POST
- user: "{{ solace.user}}"
- password: "{{ solace.password }}"
- body:
- accessType: non-exclusive
- permission: consume
- queueName: "{{ item }}"
- respectTtlEnabled: true
- egressEnabled: true
- ingressEnabled: true
- body_format: json
- register: queuesCreation
- when: item not in (queues|json_query('json.data[*].queueName'))
- with_items:
- - veredi
- - parhippi
- - moulari
- - name: Getting a look of the queues
- debug:
- var: queuesCreation
- - name: Get the queues subscriptions
- uri:
- url: "{{ firstMsgVpn.queuesUri }}/moulari/subscriptions"
- method: GET
- user: "{{ solace.user}}"
- password: "{{ solace.password }}"
- status_code: 200
- register: subscriptions
- - name: Getting a look of the subscriptions
- debug:
- var: subscriptions
- - name: Add the queues subscriptions
- uri:
- url: "{{ firstMsgVpn.queuesUri }}/moulari/subscriptions"
- method: POST
- user: "{{ solace.user}}"
- password: "{{ solace.password }}"
- status_code: 200
- body:
- subscriptionTopic: "{{ item }}"
- body_format: json
- register: subscriptionsResponse
- when: item not in (subscriptions|json_query('json.data[*].subscriptionTopic'))
- with_items:
- - request/>
- - name: Getting a look of the subscriptions
- debug:
- var: subscriptionsResponse
- # - name: Get the all rest endpoints
- # uri:
- # url: "{{ firstMsgVpn.topicEndpointsUri }}"
- # method: GET
- # user: "{{ solace.user}}"
- # password: "{{ solace.password }}"
- # status_code: 200
- # register: topics
- # - name: Getting a look of the topics
- # debug:
- # var: topics
- # - name: Get the topics endpoints
- # uri:
- # url: "{{ firstMsgVpn.topicEndpointsUri }}"
- # method: POST
- # user: "{{ solace.user}}"
- # password: "{{ solace.password }}"
- # status_code: 200
- # body:
- # egressEnabled: true
- # ingressEnabled: true
- # maxTtl: 3600
- # permission: consume
- # topicEndpointName: "{{ item }}"
- # respectTtlEnabled: true
- # body_format: json
- # register: topicsCreation
- # when: item not in (topics|json_query('json.data[*].topicEndpointName'))
- # with_items:
- # - request
- # - metric
- # - name: Getting a look of the topics
- # debug:
- # var: topicsCreation
Add Comment
Please, Sign In to add comment