|
|
|
@ -2,6 +2,10 @@
|
|
|
|
|
- name: Create server group in check mode
|
|
|
|
|
cloudscale_server_group:
|
|
|
|
|
name: '{{ cloudscale_resource_prefix }}-grp'
|
|
|
|
|
tags:
|
|
|
|
|
project: ansible-test
|
|
|
|
|
stage: production
|
|
|
|
|
sla: 24-7
|
|
|
|
|
register: grp
|
|
|
|
|
check_mode: yes
|
|
|
|
|
- name: 'VERIFY: Create server group in check mode'
|
|
|
|
@ -14,6 +18,10 @@
|
|
|
|
|
- name: Create server group
|
|
|
|
|
cloudscale_server_group:
|
|
|
|
|
name: '{{ cloudscale_resource_prefix }}-grp'
|
|
|
|
|
tags:
|
|
|
|
|
project: ansible-test
|
|
|
|
|
stage: production
|
|
|
|
|
sla: 24-7
|
|
|
|
|
register: grp
|
|
|
|
|
- name: 'VERIFY: Create server group'
|
|
|
|
|
assert:
|
|
|
|
@ -22,6 +30,9 @@
|
|
|
|
|
- grp.type == 'anti-affinity'
|
|
|
|
|
- grp.name == '{{ cloudscale_resource_prefix }}-grp'
|
|
|
|
|
- grp.uuid
|
|
|
|
|
- grp.tags.project == 'ansible-test'
|
|
|
|
|
- grp.tags.stage == 'production'
|
|
|
|
|
- grp.tags.sla == '24-7'
|
|
|
|
|
|
|
|
|
|
- name: Remember uuid
|
|
|
|
|
set_fact:
|
|
|
|
@ -30,6 +41,10 @@
|
|
|
|
|
- name: Create server group idempotence
|
|
|
|
|
cloudscale_server_group:
|
|
|
|
|
name: '{{ cloudscale_resource_prefix }}-grp'
|
|
|
|
|
tags:
|
|
|
|
|
project: ansible-test
|
|
|
|
|
stage: production
|
|
|
|
|
sla: 24-7
|
|
|
|
|
register: grp
|
|
|
|
|
- name: 'VERIFY: Create server group idempotence'
|
|
|
|
|
assert:
|
|
|
|
@ -37,11 +52,18 @@
|
|
|
|
|
- grp is not changed
|
|
|
|
|
- grp.name == '{{ cloudscale_resource_prefix }}-grp'
|
|
|
|
|
- grp.uuid == server_group_uuid
|
|
|
|
|
- grp.tags.project == 'ansible-test'
|
|
|
|
|
- grp.tags.stage == 'production'
|
|
|
|
|
- grp.tags.sla == '24-7'
|
|
|
|
|
|
|
|
|
|
- name: Update server group in check mode
|
|
|
|
|
cloudscale_server_group:
|
|
|
|
|
uuid: '{{ server_group_uuid }}'
|
|
|
|
|
name: '{{ cloudscale_resource_prefix }}-grp2'
|
|
|
|
|
tags:
|
|
|
|
|
project: ansible-test
|
|
|
|
|
stage: staging
|
|
|
|
|
sla: 8-5
|
|
|
|
|
register: grp
|
|
|
|
|
check_mode: yes
|
|
|
|
|
- name: 'VERIFY: Update server group in check mode'
|
|
|
|
@ -50,11 +72,18 @@
|
|
|
|
|
- grp is changed
|
|
|
|
|
- grp.name == '{{ cloudscale_resource_prefix }}-grp'
|
|
|
|
|
- grp.uuid == server_group_uuid
|
|
|
|
|
- grp.tags.project == 'ansible-test'
|
|
|
|
|
- grp.tags.stage == 'production'
|
|
|
|
|
- grp.tags.sla == '24-7'
|
|
|
|
|
|
|
|
|
|
- name: Update server group
|
|
|
|
|
cloudscale_server_group:
|
|
|
|
|
uuid: '{{ server_group_uuid }}'
|
|
|
|
|
name: '{{ cloudscale_resource_prefix }}-grp2'
|
|
|
|
|
tags:
|
|
|
|
|
project: ansible-test
|
|
|
|
|
stage: staging
|
|
|
|
|
sla: 8-5
|
|
|
|
|
register: grp
|
|
|
|
|
- name: 'VERIFY: Update server group'
|
|
|
|
|
assert:
|
|
|
|
@ -62,11 +91,18 @@
|
|
|
|
|
- grp is changed
|
|
|
|
|
- grp.name == '{{ cloudscale_resource_prefix }}-grp2'
|
|
|
|
|
- grp.uuid == server_group_uuid
|
|
|
|
|
- grp.tags.project == 'ansible-test'
|
|
|
|
|
- grp.tags.stage == 'staging'
|
|
|
|
|
- grp.tags.sla == '8-5'
|
|
|
|
|
|
|
|
|
|
- name: Update server group idempotence
|
|
|
|
|
cloudscale_server_group:
|
|
|
|
|
uuid: '{{ server_group_uuid }}'
|
|
|
|
|
name: '{{ cloudscale_resource_prefix }}-grp2'
|
|
|
|
|
tags:
|
|
|
|
|
project: ansible-test
|
|
|
|
|
stage: staging
|
|
|
|
|
sla: 8-5
|
|
|
|
|
register: grp
|
|
|
|
|
- name: 'VERIFY: Update server group idempotence'
|
|
|
|
|
assert:
|
|
|
|
@ -74,6 +110,9 @@
|
|
|
|
|
- grp is not changed
|
|
|
|
|
- grp.name == '{{ cloudscale_resource_prefix }}-grp2'
|
|
|
|
|
- grp.uuid == server_group_uuid
|
|
|
|
|
- grp.tags.project == 'ansible-test'
|
|
|
|
|
- grp.tags.stage == 'staging'
|
|
|
|
|
- grp.tags.sla == '8-5'
|
|
|
|
|
|
|
|
|
|
- name: Delete server group in check mode
|
|
|
|
|
cloudscale_server_group:
|
|
|
|
|