forked from Azure-Samples/ansible-playbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appserviceplan_scale.yml
49 lines (42 loc) · 1.24 KB
/
appserviceplan_scale.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Description
# ===========
# This playbook covers below scenario:
# - An Azure app service plan with sku=S1(stanard tier 1)
# - Scale up the app service plan to sku=s2(stardard tier 2)
#
# This playbook requires Ansible version >=2.7,
# If you're using Ansible < 2.7, just add role 'azure_preview_modules' like commented out lines 16-17.
- hosts: localhost
connection: local
vars:
location: eastus
plan_name: myAppServicePlan
# roles:
# - azure.azure_preview_modules
tasks:
- name: Create resource group
azure_rm_resourcegroup:
name: "{{ resource_group_name }}"
location: "{{ location }}"
- name: Create App Service Plan
azure_rm_appserviceplan:
resource_group: "{{ resource_group_name }}"
name: "{{ plan_name }}"
is_linux: true
sku: S1
number_of_workers: 1
- name: Scale up the App Service Plan
azure_rm_appserviceplan:
resource_group: "{{ resource_group_name }}"
name: "{{ plan_name }}"
is_linux: true
sku: S2
number_of_workers: 1
- name: Get facts
azure_rm_appserviceplan_facts:
resource_group: "{{ resource_group_name }}"
name: "{{ plan_name }}"
register: output
- name: Display facts output
debug:
var: output