start/stop/restart azure webapp (#44498)

* add webapp start/stop/restart

* disable test with facts

* fix lint

* fix lint

* fix check mode

* rename power_action to app_state

* refine names of choices

* fix renaming bug
This commit is contained in:
Yunge Zhu 2018-08-29 07:41:11 +08:00 committed by Zim Kalinowski
commit 2bd0a66c08
2 changed files with 85 additions and 2 deletions

View file

@ -22,6 +22,31 @@
plan: "{{ win_plan_name }}"
register: output
- name: stop the web app
azure_rm_webapp:
resource_group: "{{ resource_group }}"
name: "{{ win_app_name }}2"
plan: "{{ win_plan_name }}"
app_state: stopped
register: output
- name: assert output changed
assert:
that:
output.changed
# enable after webapp_facts merged
# - name: get the web app
# azure_rm_webapp_facts:
# resource_group: "{{ resource_group }}"
# name: "{{ win_app_name }}2"
# register: stopped
# - name: assert web app is stopped
# assert:
# that:
# - stopped.properties.state == "Stopped"
- name: Create a windows web app with existing app service plan, try to update some root level params
azure_rm_webapp:
resource_group: "{{ resource_group }}"
@ -251,4 +276,4 @@
- name: Assert the web app was created
assert:
that: output.changed
that: output.changed