mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
126 lines
2.8 KiB
YAML
126 lines
2.8 KiB
YAML
|
- name: Create sample container instance
|
||
|
azure_rm_containerinstance:
|
||
|
resource_group: "{{ resource_group }}"
|
||
|
name: "aci{{ resource_group | hash('md5') | truncate(7, True, '') }}"
|
||
|
os_type: linux
|
||
|
ip_address: public
|
||
|
location: eastus
|
||
|
ports:
|
||
|
- 80
|
||
|
containers:
|
||
|
- name: mycontainer1
|
||
|
image: httpd
|
||
|
memory: 1.5
|
||
|
ports:
|
||
|
- 80
|
||
|
- 81
|
||
|
- name: mycontainer2
|
||
|
image: httpd
|
||
|
memory: 1.5
|
||
|
register: output
|
||
|
|
||
|
- name: Assert the container instance is well created
|
||
|
assert:
|
||
|
that:
|
||
|
- output.changed
|
||
|
- output.provisioning_state == 'Creating'
|
||
|
|
||
|
- name: Create sample container instance
|
||
|
azure_rm_containerinstance:
|
||
|
resource_group: "{{ resource_group }}"
|
||
|
name: "aci{{ resource_group | hash('md5') | truncate(7, True, '') }}"
|
||
|
os_type: linux
|
||
|
ip_address: public
|
||
|
location: eastus
|
||
|
ports:
|
||
|
- 80
|
||
|
containers:
|
||
|
- name: mycontainer1
|
||
|
image: httpd
|
||
|
memory: 1.5
|
||
|
ports:
|
||
|
- 80
|
||
|
- 81
|
||
|
- name: mycontainer2
|
||
|
image: httpd
|
||
|
memory: 1.5
|
||
|
register: output
|
||
|
|
||
|
- name: Assert the container instance is well created
|
||
|
assert:
|
||
|
that:
|
||
|
- output.changed == False
|
||
|
|
||
|
- name: Create sample container instance
|
||
|
azure_rm_containerinstance:
|
||
|
resource_group: "{{ resource_group }}"
|
||
|
name: "aci{{ resource_group | hash('md5') | truncate(7, True, '') }}"
|
||
|
os_type: linux
|
||
|
ip_address: public
|
||
|
location: eastus
|
||
|
ports:
|
||
|
- 80
|
||
|
containers:
|
||
|
- name: mycontainer1
|
||
|
image: httpd
|
||
|
memory: 1.5
|
||
|
ports:
|
||
|
- 80
|
||
|
- 81
|
||
|
force_update: yes
|
||
|
register: output
|
||
|
|
||
|
- name: Assert the container instance is well created
|
||
|
assert:
|
||
|
that:
|
||
|
- output.changed
|
||
|
- output.provisioning_state == 'Creating'
|
||
|
|
||
|
- name: Remove container instance
|
||
|
azure_rm_containerinstance:
|
||
|
resource_group: "{{ resource_group }}"
|
||
|
name: "aci{{ resource_group | hash('md5') | truncate(7, True, '') }}"
|
||
|
os_type: linux
|
||
|
ip_address: public
|
||
|
location: eastus
|
||
|
ports:
|
||
|
- 80
|
||
|
containers:
|
||
|
- name: mycontainer1
|
||
|
image: httpd
|
||
|
memory: 1.5
|
||
|
ports:
|
||
|
- 80
|
||
|
- 81
|
||
|
state: absent
|
||
|
register: output
|
||
|
|
||
|
- name: Assert the container instance is deleted
|
||
|
assert:
|
||
|
that:
|
||
|
- output.changed
|
||
|
|
||
|
- name: Remove container instance again
|
||
|
azure_rm_containerinstance:
|
||
|
resource_group: "{{ resource_group }}"
|
||
|
name: "aci{{ resource_group | hash('md5') | truncate(7, True, '') }}"
|
||
|
os_type: linux
|
||
|
ip_address: public
|
||
|
location: eastus
|
||
|
ports:
|
||
|
- 80
|
||
|
containers:
|
||
|
- name: mycontainer1
|
||
|
image: httpd
|
||
|
memory: 1.5
|
||
|
ports:
|
||
|
- 80
|
||
|
- 81
|
||
|
state: absent
|
||
|
register: output
|
||
|
|
||
|
- name: Assert the changed is false
|
||
|
assert:
|
||
|
that:
|
||
|
- output.changed == False
|