2018-08-08 00:54:31 +02:00
|
|
|
- name: Prepare facts
|
|
|
|
set_fact:
|
|
|
|
linux_plan_resource_group: "{{ resource_group_secondary }}"
|
|
|
|
win_plan_name: "{{ (resource_prefix | replace('-','x'))[-8:] }}winplan"
|
2018-08-16 10:13:32 +02:00
|
|
|
linux_plan_name: "{{ (resource_prefix | replace('-','x'))[-8:] }}linplan"
|
2018-08-08 00:54:31 +02:00
|
|
|
|
|
|
|
- name: create a windows plan
|
|
|
|
azure_rm_appserviceplan:
|
|
|
|
name: "{{ win_plan_name }}1"
|
|
|
|
resource_group: "{{ resource_group }}"
|
|
|
|
sku: B1
|
|
|
|
register: output
|
|
|
|
|
|
|
|
- name: assert app service was created
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- output.changed
|
|
|
|
- output.id
|
|
|
|
|
|
|
|
- name: create a linux plan
|
|
|
|
azure_rm_appserviceplan:
|
|
|
|
resource_group: "{{ linux_plan_resource_group }}"
|
|
|
|
name: "{{ linux_plan_name }}1"
|
|
|
|
sku: S1
|
|
|
|
is_linux: true
|
|
|
|
number_of_workers: 1
|
|
|
|
register: output
|
|
|
|
|
|
|
|
- name: assert app service was created
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- output.changed
|
|
|
|
- output.id
|
|
|
|
|
2018-08-16 10:13:32 +02:00
|
|
|
- name: get app service plan by name
|
|
|
|
azure_rm_appserviceplan_facts:
|
|
|
|
resource_group: "{{ linux_plan_resource_group }}"
|
|
|
|
name: "{{ linux_plan_name }}1"
|
|
|
|
register: output
|
|
|
|
|
|
|
|
- name: assert is_linux is True
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- output.appserviceplans | length == 1
|
|
|
|
- output.appserviceplans[0].is_linux == True
|
|
|
|
|
2018-08-08 00:54:31 +02:00
|
|
|
- name: create linux app service plan idempotent
|
|
|
|
azure_rm_appserviceplan:
|
|
|
|
resource_group: "{{ linux_plan_resource_group }}"
|
|
|
|
name: "{{ linux_plan_name }}1"
|
|
|
|
sku: S1
|
|
|
|
is_linux: true
|
|
|
|
number_of_workers: 1
|
|
|
|
register: output
|
|
|
|
|
|
|
|
- name: assert app service was created
|
|
|
|
assert:
|
|
|
|
that: not output.changed
|
|
|
|
|
|
|
|
- name: update a windows plan sku
|
|
|
|
azure_rm_appserviceplan:
|
|
|
|
name: "{{ win_plan_name }}1"
|
|
|
|
resource_group: "{{ resource_group }}"
|
|
|
|
sku: B2
|
|
|
|
register: output
|
|
|
|
|
|
|
|
- name: assert app service was updated
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- output.changed
|
|
|
|
|
|
|
|
- name: update a linux plan number of workers
|
|
|
|
azure_rm_appserviceplan:
|
|
|
|
resource_group: "{{ linux_plan_resource_group }}"
|
|
|
|
name: "{{ linux_plan_name }}1"
|
|
|
|
sku: S1
|
|
|
|
is_linux: true
|
|
|
|
number_of_workers: 2
|
|
|
|
register: output
|
|
|
|
|
|
|
|
- name: assert app service was updated
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- output.changed
|