Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added storage_autogrow option to postgresqlserver #387

Merged
merged 2 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions plugins/modules/azure_rm_postgresqlserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -107,6 +112,7 @@
location: eastus
storage_mb: 1024
enforce_ssl: True
storage_autogrow: True
admin_username: cloudsa
admin_password: password
'''
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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":
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/azure_rm_postgresqlserver_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion requirements-azure.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
location: westus2
storage_mb: 51200
enforce_ssl: True
storage_autogrow: True
admin_username: zimxyz
admin_password: Password123!
tags:
Expand All @@ -116,6 +117,7 @@
location: westus2
storage_mb: 51200
enforce_ssl: True
storage_autogrow: True
admin_username: zimxyz
admin_password: Password123!
tags:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down