ansible/test/integration/targets/azure_rm_monitorlogprofile/tasks/main.yml
Yunge Zhu 749662d776 add azure monitor log profile module (#54702)
* add azure monitor log profile module

* fix version

* fix lint

* mark test as unsupported

* fix lint

* fix lint

* Fix the error prompted in the comments
2019-08-27 05:00:28 +08:00

104 lines
2.2 KiB
YAML

- name: Prepare random number
set_fact:
profile_name: "profile{{ resource_group | hash('md5') | truncate(5, True, '') }}{{ 1000 | random }}"
location: eastus
run_once: yes
- name: create Azure storage account
azure_rm_storageaccount:
name: '{{ profile_name }}'
resource_group: "{{ resource_group }}"
account_type: Standard_LRS
- name: create log profile (idempotence)
azure_rm_monitorlogprofile:
name: "{{ profile_name }}"
location: "{{ location }}"
locations:
- eastus
- westus
categories:
- Write
- Action
retention_policy:
enabled: False
days: 1
storage_account:
resource_group: "{{ resource_group }}"
name: "{{ profile_name }}"
check_mode: yes
register: output
- name: assert create idempotence
assert:
that:
- output.changed
- name: create log profile
azure_rm_monitorlogprofile:
name: "{{ profile_name }}"
location: "{{ location }}"
locations:
- eastus
- westus
categories:
- Write
- Action
retention_policy:
enabled: False
days: 1
storage_account:
resource_group: "{{ resource_group }}"
name: "{{ profile_name }}"
register: output
- name: assert create
assert:
that:
- output.changed
- output.id
- name: update log profile (idempotence)
azure_rm_monitorlogprofile:
name: "{{ profile_name }}"
location: "{{ location }}"
locations:
- eastus
- westus
categories:
- Write
- Action
retention_policy:
enabled: False
days: 1
storage_account:
resource_group: "{{ resource_group }}"
name: "{{ storage_name }}"
register: output
- name: assert update idempotence
assert:
that:
- output.changed == False
- name: update log profile
azure_rm_monitorlogprofile:
name: "{{ profile_name }}"
location: "{{ location }}"
locations:
- eastus
categories:
- Write
- Action
retention_policy:
enabled: False
days: 2
storage_account:
resource_group: "{{ resource_group }}"
name: "{{ profile_name }}"
register: output
- name: assert update
assert:
that:
- output.changed