mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 04:24:00 -07:00
Add support for Azure Functions (#28566)
* add template for az func * (wip) add basic azure functions support * add support to add app settings to azure function * add support for updating based off of app settings * add integration tests and refactor required param * support check mode and add facts module * add test for azure functions facts module * add necessary checks and registrations for web client * fix documentation * change return type from complex to dict * disable azure_rm_functionapp tests until stable * remove dict comprehension for py2.6 * pepe has whitespace tumor
This commit is contained in:
parent
ef660f87b0
commit
8a6ae51f90
7 changed files with 610 additions and 1 deletions
2
test/integration/targets/azure_rm_functionapp/aliases
Normal file
2
test/integration/targets/azure_rm_functionapp/aliases
Normal file
|
@ -0,0 +1,2 @@
|
|||
cloud/azure
|
||||
destructive
|
|
@ -0,0 +1,2 @@
|
|||
dependencies:
|
||||
- setup_azure
|
82
test/integration/targets/azure_rm_functionapp/tasks/main.yml
Normal file
82
test/integration/targets/azure_rm_functionapp/tasks/main.yml
Normal file
|
@ -0,0 +1,82 @@
|
|||
- name: create storage account for function apps
|
||||
azure_rm_storageaccount:
|
||||
resource_group: '{{ resource_group }}'
|
||||
name: azfunccistor4
|
||||
account_type: Standard_LRS
|
||||
|
||||
- name: create basic function app
|
||||
azure_rm_functionapp:
|
||||
resource_group: '{{ resource_group }}'
|
||||
name: azfuncci
|
||||
storage_account: azfunccistor4
|
||||
register: output
|
||||
|
||||
- name: assert the function was created
|
||||
assert:
|
||||
that: output.changed
|
||||
|
||||
- name: list facts for function
|
||||
azure_rm_functionapp_facts:
|
||||
resource_group: '{{ resource_group }}'
|
||||
name: azfuncci
|
||||
|
||||
- name: assert the facts were retrieved
|
||||
assert:
|
||||
that: '{{ ansible_facts.azure_functionapps|length == 1 }}'
|
||||
|
||||
- name: delete basic function app
|
||||
azure_rm_functionapp:
|
||||
resource_group: '{{ resource_group }}'
|
||||
name: azfuncci
|
||||
state: absent
|
||||
register: output
|
||||
|
||||
- name: assert the function was deleted
|
||||
assert:
|
||||
that: output.changed
|
||||
|
||||
- name: create a function with app settings
|
||||
azure_rm_functionapp:
|
||||
resource_group: '{{ resource_group }}'
|
||||
name: azfuncci
|
||||
storage_account: azfunccistor4
|
||||
app_settings:
|
||||
hello: world
|
||||
things: more stuff
|
||||
register: output
|
||||
|
||||
- name: assert the function with app settings was created
|
||||
assert:
|
||||
that: output.changed
|
||||
|
||||
- name: change app settings
|
||||
azure_rm_functionapp:
|
||||
resource_group: '{{ resource_group }}'
|
||||
name: azfuncci
|
||||
storage_account: azfunccistor4
|
||||
app_settings:
|
||||
hello: world
|
||||
things: more stuff
|
||||
another: one
|
||||
register: output
|
||||
|
||||
- name: assert the function was changed
|
||||
assert:
|
||||
that: output.changed
|
||||
|
||||
- name: delete the function app
|
||||
azure_rm_functionapp:
|
||||
resource_group: '{{ resource_group }}'
|
||||
name: azfuncci
|
||||
state: absent
|
||||
register: output
|
||||
|
||||
- name: assert the function was deleted
|
||||
assert:
|
||||
that: output.changed
|
||||
|
||||
- name: delete storage account
|
||||
azure_rm_storageaccount:
|
||||
resource_group: '{{ resource_group }}'
|
||||
name: azfunccistor4
|
||||
state: absent
|
Loading…
Add table
Add a link
Reference in a new issue