ansible/test/integration/targets/azure_rm_containerregistry/tasks/main.yml
Matt Davis b91117dac8
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
2017-12-06 20:30:28 -08:00

55 lines
No EOL
1.8 KiB
YAML

- 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