mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-21 00:19:09 -07:00
azure_rm_containerservice (#33597)
* add acr * acr * acr * fix a minor error * add tests and fixes as suggested * use get_mgmt_svc_client to enable bi * fixes as zim suggested * code refinement * get acr instance before update * fix a bug * remove Classic sku as it's going to deprecate * pass sanity test * fix sanity * fixes based on comments * fix broken namespace unregistered error * fix a bug * fix a bug * fix * add register namespace * fixes tests * remove pdb * add ci azure test * removed required: false * renamed acr -> containerregistry * fixed spelling mistake * fixed idempotence * fix for idempotence was wrong * fixed a few issues * different log when exception different than ResourceNotFound * self.fail instead of log * updated sample return value * added login server in results * fixed else * fixed line too long * cmp -> __ne__ * fixed trailing whitespace * output.changed is false when instance updated * fix for state change * one more update * update instance only when location or sku has changed * fixed syntax error * fixed acr test * just removed unnecessary comment to trigger ci * update return value shape * flatten `state` * change credential dictionary state * add credentials to integration tests
This commit is contained in:
parent
4c242ad2e7
commit
b91117dac8
6 changed files with 493 additions and 2 deletions
|
@ -0,0 +1,3 @@
|
|||
cloud/azure
|
||||
posix/ci/cloud/group2/azure
|
||||
destructive
|
|
@ -0,0 +1,2 @@
|
|||
dependencies:
|
||||
- setup_azure
|
|
@ -0,0 +1,55 @@
|
|||
- name: Create an container registry
|
||||
azure_rm_containerregistry:
|
||||
name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}"
|
||||
resource_group: "{{ resource_group }}"
|
||||
location: eastus2
|
||||
state: present
|
||||
admin_user_enabled: true
|
||||
sku: Premium
|
||||
tags:
|
||||
Release: beta1
|
||||
Environment: Production
|
||||
register: output
|
||||
|
||||
- name: Assert the container registry instance is well created
|
||||
assert:
|
||||
that:
|
||||
- output.changed
|
||||
- output.admin_user_enabled
|
||||
- output.location == 'eastus2'
|
||||
- output.sku == 'Premium'
|
||||
- output.tags['Environment'] == 'Production'
|
||||
- output.tags['Release'] == 'beta1'
|
||||
- output.provisioning_state == 'Succeeded'
|
||||
- output.credentials['password'] is defined
|
||||
- output.credentials['password2'] is defined
|
||||
|
||||
- name: Update the ACS instance sku, tags and admin_user_enabled
|
||||
azure_rm_containerregistry:
|
||||
name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}"
|
||||
resource_group: "{{ resource_group }}"
|
||||
location: eastus2
|
||||
admin_user_enabled: false
|
||||
sku: Standard
|
||||
tags:
|
||||
NewTag: newtag
|
||||
Release: beta1
|
||||
Environment: Production
|
||||
register: output
|
||||
|
||||
- name: Assert the ACS instance is well updated
|
||||
assert:
|
||||
that:
|
||||
- output.changed == True
|
||||
- output.admin_user_enabled == False
|
||||
- output.sku == 'Standard'
|
||||
- output.tags['NewTag'] == 'newtag'
|
||||
- output.credentials | length == 0
|
||||
- output.credentials['password'] is not defined
|
||||
- output.credentials['password2'] is not defined
|
||||
|
||||
- name: Delete an container registry
|
||||
azure_rm_containerregistry:
|
||||
name: "acr{{ resource_group | hash('md5') | truncate(7, True, '') }}"
|
||||
resource_group: "{{ resource_group }}"
|
||||
state: absent
|
Loading…
Add table
Add a link
Reference in a new issue