You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
- name: Prepare random number
|
|
|
|
set_fact:
|
|
|
|
nsgname: "{{ resource_group | hash('md5') | truncate(7, True, '') }}{{ 1000 | random }}"
|
|
|
|
run_once: yes
|
|
|
|
|
|
|
|
- name: Call REST API
|
|
|
|
azure_rm_resource:
|
|
|
|
api_version: '2018-02-01'
|
|
|
|
resource_group: "{{ resource_group }}"
|
|
|
|
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
|
|
|
|
|
|
|
|
- name: Call REST API
|
|
|
|
azure_rm_resource:
|
|
|
|
api_version: '2018-02-01'
|
|
|
|
resource_group: "{{ resource_group }}"
|
|
|
|
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
|
|
|
|
|
|
|
|
- name: Call REST API
|
|
|
|
azure_rm_resource:
|
|
|
|
api_version: '2018-02-01'
|
|
|
|
resource_group: "{{ resource_group }}"
|
|
|
|
provider: network
|
|
|
|
resource_type: networksecuritygroups
|
|
|
|
resource_name: "{{ nsgname }}"
|
|
|
|
body:
|
|
|
|
location: eastus
|
|
|
|
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:
|
|
|
|
api_version: '2018-02-01'
|
|
|
|
resource_group: "{{ resource_group }}"
|
|
|
|
provider: network
|
|
|
|
resource_type: networksecuritygroups
|
|
|
|
resource_name: "{{ nsgname }}"
|
|
|
|
register: output
|