mirror of
https://github.com/trailofbits/algo.git
synced 2025-08-13 08:13:01 +02:00
replaced external command w/ default zones
This commit is contained in:
parent
1ed3e40e90
commit
ed9bb84817
2 changed files with 50 additions and 7 deletions
|
@ -1,2 +1,49 @@
|
|||
---
|
||||
cloudstack_venv: "{{ playbook_dir }}/configs/.venvs/cloudstack"
|
||||
cloudstack_venv: "{{ playbook_dir }}/configs/.venvs/cloudstack"
|
||||
_cloudstack_zones: >
|
||||
[
|
||||
{
|
||||
"allocationstate": "Enabled",
|
||||
"dhcpprovider": "VirtualRouter",
|
||||
"id": "1128bd56-b4d9-4ac6-a7b9-c715b187ce11",
|
||||
"localstorageenabled": true,
|
||||
"name": "ch-gva-2",
|
||||
"networktype": "Basic",
|
||||
"securitygroupsenabled": true,
|
||||
"tags": [],
|
||||
"zonetoken": "token"
|
||||
},
|
||||
{
|
||||
"allocationstate": "Enabled",
|
||||
"dhcpprovider": "VirtualRouter",
|
||||
"id": "91e5e9e4-c9ed-4b76-bee4-427004b3baf9",
|
||||
"localstorageenabled": true,
|
||||
"name": "ch-dk-2",
|
||||
"networktype": "Basic",
|
||||
"securitygroupsenabled": true,
|
||||
"tags": [],
|
||||
"zonetoken": "token"
|
||||
},
|
||||
{
|
||||
"allocationstate": "Enabled",
|
||||
"dhcpprovider": "VirtualRouter",
|
||||
"id": "4da1b188-dcd6-4ff5-b7fd-bde984055548",
|
||||
"localstorageenabled": true,
|
||||
"name": "at-vie-1",
|
||||
"networktype": "Basic",
|
||||
"securitygroupsenabled": true,
|
||||
"tags": [],
|
||||
"zonetoken": "token"
|
||||
},
|
||||
{
|
||||
"allocationstate": "Enabled",
|
||||
"dhcpprovider": "VirtualRouter",
|
||||
"id": "35eb7739-d19e-45f7-a581-4687c54d6d02",
|
||||
"localstorageenabled": true,
|
||||
"name": "de-fra-1",
|
||||
"networktype": "Basic",
|
||||
"securitygroupsenabled": true,
|
||||
"tags": [],
|
||||
"zonetoken": "token"
|
||||
}
|
||||
]
|
|
@ -1,16 +1,12 @@
|
|||
---
|
||||
- block:
|
||||
- name: List zones on configured cloud provider
|
||||
local_action: shell "{{ cloudstack_venv }}/bin/cs" listZones
|
||||
register: cs_zones_list
|
||||
|
||||
- name: Parse zones from output
|
||||
set_fact:
|
||||
_cs_zones: "{{cs_zones_list.stdout | from_json }}"
|
||||
_cs_zones: "{{ _cloudstack_zones | from_json }}"
|
||||
|
||||
- name: Extract zones from output
|
||||
set_fact:
|
||||
cs_zones: "{{ _cs_zones.zone | sort(attribute='name') }}"
|
||||
cs_zones: "{{ _cs_zones | sort(attribute='name') }}"
|
||||
|
||||
- name: Set the default zone
|
||||
set_fact:
|
||||
|
|
Loading…
Add table
Reference in a new issue