Backport/2.6/45378 (#52448)
* backporting fix for sql tags * removed unnecessary tests
This commit is contained in:
parent
07e0de6cf1
commit
c9449694b8
3 changed files with 9 additions and 0 deletions
2
changelogs/fragments/45378-fix-sql-tags.yml
Normal file
2
changelogs/fragments/45378-fix-sql-tags.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- azure_rm_sqlserver - fix for tags support
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue