ansible/test/integration/targets/azure_rm_resource/tasks/main.yml

66 lines
1.5 KiB
YAML
Raw Normal View History

- name: Prepare random number
set_fact:
2018-06-07 06:11:00 +00:00
nsgname: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
run_once: yes
2018-06-07 06:11:00 +00:00
- name: Call REST API
azure_rm_resource:
2018-06-07 06:11:00 +00:00
api_version: '2018-02-01'
resource_group: "{{ resource_group }}"
2018-06-07 06:11:00 +00:00
provider: network
resource_type: networksecuritygroups
resource_name: "{{ nsgname }}"
body:
location: eastus
idempotency: yes
register: output
- name: Assert that something has changed
assert:
that: output.changed
2018-06-07 06:11:00 +00:00
- name: Call REST API
azure_rm_resource:
2018-06-07 06:11:00 +00:00
api_version: '2018-02-01'
resource_group: "{{ resource_group }}"
2018-06-07 06:11:00 +00:00
provider: network
resource_type: networksecuritygroups
resource_name: "{{ nsgname }}"
body:
location: eastus
idempotency: yes
register: output
- name: Assert that nothing has changed
assert:
that: not output.changed
2018-06-07 06:11:00 +00:00
- name: Call REST API
azure_rm_resource:
2018-06-07 06:11:00 +00:00
api_version: '2018-02-01'
resource_group: "{{ resource_group }}"
2018-06-07 06:11:00 +00:00
provider: network
resource_type: networksecuritygroups
resource_name: "{{ nsgname }}"
body:
location: eastus
2018-06-07 06:11:00 +00:00
tags:
a: "abc"
b: "cde"
idempotency: yes
register: output
- name: Assert that something has changed
assert:
that: output.changed
- name: Try to get information about account
azure_rm_resource_facts:
2018-06-07 06:11:00 +00:00
api_version: '2018-02-01'
resource_group: "{{ resource_group }}"
2018-06-07 06:11:00 +00:00
provider: network
resource_type: networksecuritygroups
resource_name: "{{ nsgname }}"
register: output