|
|
@ -1,14 +1,18 @@
|
|
|
|
|
|
|
|
- name: Fix resource prefix
|
|
|
|
|
|
|
|
set_fact:
|
|
|
|
|
|
|
|
fixed_resource_prefix: "{{ resource_prefix | replace('-','x') }}"
|
|
|
|
|
|
|
|
|
|
|
|
- name: create storage account for function apps
|
|
|
|
- name: create storage account for function apps
|
|
|
|
azure_rm_storageaccount:
|
|
|
|
azure_rm_storageaccount:
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
name: azfunccistor4
|
|
|
|
name: sa{{ fixed_resource_prefix }}
|
|
|
|
account_type: Standard_LRS
|
|
|
|
account_type: Standard_LRS
|
|
|
|
|
|
|
|
|
|
|
|
- name: create basic function app
|
|
|
|
- name: create basic function app
|
|
|
|
azure_rm_functionapp:
|
|
|
|
azure_rm_functionapp:
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
name: azfuncci
|
|
|
|
name: af{{ fixed_resource_prefix }}
|
|
|
|
storage_account: azfunccistor4
|
|
|
|
storage_account: sa{{ fixed_resource_prefix }}
|
|
|
|
register: output
|
|
|
|
register: output
|
|
|
|
|
|
|
|
|
|
|
|
- name: assert the function was created
|
|
|
|
- name: assert the function was created
|
|
|
@ -18,19 +22,19 @@
|
|
|
|
- name: list facts for function
|
|
|
|
- name: list facts for function
|
|
|
|
azure_rm_functionapp_facts:
|
|
|
|
azure_rm_functionapp_facts:
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
name: azfuncci
|
|
|
|
name: af{{ fixed_resource_prefix }}
|
|
|
|
register: results
|
|
|
|
register: results
|
|
|
|
|
|
|
|
|
|
|
|
- name: assert the facts were retrieved
|
|
|
|
- name: assert the facts were retrieved
|
|
|
|
assert:
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
that:
|
|
|
|
- results.ansible_facts.azure_functionapps|length == 1
|
|
|
|
- results.ansible_facts.azure_functionapps|length == 1
|
|
|
|
- results.ansible_facts.azure_functionapps[0].name == 'azfuncci'
|
|
|
|
- results.ansible_facts.azure_functionapps[0].name == 'af{{ fixed_resource_prefix }}'
|
|
|
|
|
|
|
|
|
|
|
|
- name: delete basic function app
|
|
|
|
- name: delete basic function app
|
|
|
|
azure_rm_functionapp:
|
|
|
|
azure_rm_functionapp:
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
name: azfuncci
|
|
|
|
name: af{{ fixed_resource_prefix }}
|
|
|
|
state: absent
|
|
|
|
state: absent
|
|
|
|
register: output
|
|
|
|
register: output
|
|
|
|
|
|
|
|
|
|
|
@ -41,8 +45,8 @@
|
|
|
|
- name: create a function with app settings
|
|
|
|
- name: create a function with app settings
|
|
|
|
azure_rm_functionapp:
|
|
|
|
azure_rm_functionapp:
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
name: azfuncci
|
|
|
|
name: af{{ fixed_resource_prefix }}
|
|
|
|
storage_account: azfunccistor4
|
|
|
|
storage_account: sa{{ fixed_resource_prefix }}
|
|
|
|
app_settings:
|
|
|
|
app_settings:
|
|
|
|
hello: world
|
|
|
|
hello: world
|
|
|
|
things: more stuff
|
|
|
|
things: more stuff
|
|
|
@ -55,8 +59,8 @@
|
|
|
|
- name: change app settings
|
|
|
|
- name: change app settings
|
|
|
|
azure_rm_functionapp:
|
|
|
|
azure_rm_functionapp:
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
name: azfuncci
|
|
|
|
name: af{{ fixed_resource_prefix }}
|
|
|
|
storage_account: azfunccistor4
|
|
|
|
storage_account: sa{{ fixed_resource_prefix }}
|
|
|
|
app_settings:
|
|
|
|
app_settings:
|
|
|
|
hello: world
|
|
|
|
hello: world
|
|
|
|
things: more stuff
|
|
|
|
things: more stuff
|
|
|
@ -70,7 +74,7 @@
|
|
|
|
- name: delete the function app
|
|
|
|
- name: delete the function app
|
|
|
|
azure_rm_functionapp:
|
|
|
|
azure_rm_functionapp:
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
name: azfuncci
|
|
|
|
name: af{{ fixed_resource_prefix }}
|
|
|
|
state: absent
|
|
|
|
state: absent
|
|
|
|
register: output
|
|
|
|
register: output
|
|
|
|
|
|
|
|
|
|
|
@ -81,5 +85,5 @@
|
|
|
|
- name: delete storage account
|
|
|
|
- name: delete storage account
|
|
|
|
azure_rm_storageaccount:
|
|
|
|
azure_rm_storageaccount:
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
resource_group: '{{ resource_group }}'
|
|
|
|
name: azfunccistor4
|
|
|
|
name: sa{{ fixed_resource_prefix }}
|
|
|
|
state: absent
|
|
|
|
state: absent
|
|
|
|