diff --git a/plugins/modules/azure_rm_postgresqlserver.py b/plugins/modules/azure_rm_postgresqlserver.py index 0f48153df..ad33cd237 100644 --- a/plugins/modules/azure_rm_postgresqlserver.py +++ b/plugins/modules/azure_rm_postgresqlserver.py @@ -69,6 +69,11 @@ - Enable SSL enforcement. type: bool default: False + storage_autogrow: + description: + - Enable storage autogrow. + type: bool + default: False admin_username: description: - The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation). @@ -107,6 +112,7 @@ location: eastus storage_mb: 1024 enforce_ssl: True + storage_autogrow: True admin_username: cloudsa admin_password: password ''' @@ -185,6 +191,10 @@ def __init__(self): type='bool', default=False ), + storage_autogrow=dict( + type='bool', + default=False + ), create_mode=dict( type='str', default='Default' @@ -235,6 +245,9 @@ def exec_module(self, **kwargs): self.parameters["location"] = kwargs[key] elif key == "storage_mb": self.parameters.setdefault("properties", {}).setdefault("storage_profile", {})["storage_mb"] = kwargs[key] + elif key == "storage_autogrow": + self.parameters.setdefault("properties", {}).setdefault("storage_profile", {})["storage_autogrow"] = ('Enabled' if kwargs[key] + else 'Disabled') elif key == "version": self.parameters.setdefault("properties", {})["version"] = kwargs[key] elif key == "enforce_ssl": diff --git a/plugins/modules/azure_rm_postgresqlserver_info.py b/plugins/modules/azure_rm_postgresqlserver_info.py index f553a2a39..3fbc8c7d3 100644 --- a/plugins/modules/azure_rm_postgresqlserver_info.py +++ b/plugins/modules/azure_rm_postgresqlserver_info.py @@ -244,6 +244,7 @@ def format_item(self, item): 'sku': d['sku'], 'location': d['location'], 'storage_mb': d['storage_profile']['storage_mb'], + 'storage_autogrow': (d['storage_profile']['storage_autogrow'] == 'Enabled'), 'version': d['version'], 'enforce_ssl': (d['ssl_enforcement'] == 'Enabled'), 'admin_username': d['administrator_login'], diff --git a/requirements-azure.txt b/requirements-azure.txt index d0b84379e..1e00fcf71 100644 --- a/requirements-azure.txt +++ b/requirements-azure.txt @@ -21,7 +21,7 @@ azure-mgmt-nspkg==2.0.0 azure-mgmt-privatedns==0.1.0 azure-mgmt-redis==5.0.0 azure-mgmt-resource==10.2.0 -azure-mgmt-rdbms==1.4.1 +azure-mgmt-rdbms==1.9.0 azure-mgmt-servicebus==0.5.3 azure-mgmt-sql==0.10.0 azure-mgmt-storage==11.1.0 diff --git a/tests/integration/targets/azure_rm_postgresqlserver/tasks/main.yml b/tests/integration/targets/azure_rm_postgresqlserver/tasks/main.yml index 8cd59161d..e441d2e8f 100644 --- a/tests/integration/targets/azure_rm_postgresqlserver/tasks/main.yml +++ b/tests/integration/targets/azure_rm_postgresqlserver/tasks/main.yml @@ -101,6 +101,7 @@ location: westus2 storage_mb: 51200 enforce_ssl: True + storage_autogrow: True admin_username: zimxyz admin_password: Password123! tags: @@ -116,6 +117,7 @@ location: westus2 storage_mb: 51200 enforce_ssl: True + storage_autogrow: True admin_username: zimxyz admin_password: Password123! tags: @@ -125,7 +127,7 @@ azure_rm_postgresqlserver_info: resource_group: "{{ resource_group }}" name: postgresqlsrv{{ rpfx }}second - register: output + register: output - name: Assert that facts are returned assert: @@ -255,7 +257,7 @@ resource_group: "{{ resource_group }}" server_name: postgresqlsrv{{ rpfx }} name: testdatabase - register: output + register: output - name: Assert that facts are returned assert: