Backport/2.6/45378 (#52448)

* backporting fix for sql tags

* removed unnecessary tests
This commit is contained in:
Zim Kalinowski 2019-02-19 02:10:23 +08:00 committed by Toshio Kuratomi
parent 07e0de6cf1
commit c9449694b8
3 changed files with 9 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- azure_rm_sqlserver - fix for tags support

View file

@ -164,6 +164,7 @@ class AzureRMServers(AzureRMModuleBase):
self.resource_group = None
self.name = None
self.parameters = dict()
self.tags = None
self.results = dict(changed=False)
self.mgmt_client = None
@ -218,6 +219,9 @@ class AzureRMServers(AzureRMModuleBase):
self.to_do = Actions.Delete
elif self.state == 'present':
self.log("Need to check if SQL Server instance has to be deleted or may be updated")
update_tags, newtags = self.update_tags(old_response.get('tags', dict()))
if update_tags:
self.tags = newtags
self.to_do = Actions.Update
if (self.to_do == Actions.Create) or (self.to_do == Actions.Update):
@ -227,6 +231,7 @@ class AzureRMServers(AzureRMModuleBase):
self.results['changed'] = True
return self.results
self.parameters['tags'] = self.tags
response = self.create_update_sqlserver()
response.pop('administrator_login_password', None)

View file

@ -24,6 +24,8 @@
location: eastus
admin_username: mylogin
admin_password: Testpasswordxyz12!
tags:
aaa: bbb
register: output
- name: Assert the resource instance is well created
assert: