12345678910111213141516171819202122232425262728293031323334 |
- ---
- # Calls Prism Central to obtain a list of networks/subnets
- # Returns a list of dictionaries containing the name and uuid of the subnets
- # Example output:
- # [
- # {'name': 'subnetA', 'uuid': '00056e15-0223-d74a-497a-ecf4bbd9b8f0'},
- # {'name': 'subnetB', 'uuid': '00056e15-0223-d74a-497a-ecf4bbd9b8f1'}
- # ]
- - name: Get Subnet List
- uri:
- url: "{{ pc_api_url }}/subnets/list"
- body:
- length: 100
- offset: 0
- filter: ""
- method: POST
- validate_certs: no
- body_format: json
- status_code: 200
- headers:
- Cookie: "{{ pc_session_cookie }}"
- register: json_images_result
- ignore_errors: yes
- - name: Store the subnet names/UUIDs
- set_fact:
- subnet_uuids: "{{ subnet_uuids|default([]) + [ {'name': item.spec.name, 'uuid': item.metadata.uuid } ] }}"
- with_items: "{{ json_images_result.json.entities }}"
- - name: Debug | Print Subnet names/UUIDs
- debug:
- msg: "Subnet names/uuids are: {{ subnet_uuids }}"
- when: global_debug|bool
|