From 60d80ef0f286d1f3da443686150e59cc572fe11e Mon Sep 17 00:00:00 2001 From: ckunaparaju Date: Fri, 7 May 2021 14:07:42 -0700 Subject: [PATCH 1/2] Add private network field to ipConfiguration settings --- plugins/modules/gcp_sql_instance.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/modules/gcp_sql_instance.py b/plugins/modules/gcp_sql_instance.py index 48d170059..0810bbfe0 100644 --- a/plugins/modules/gcp_sql_instance.py +++ b/plugins/modules/gcp_sql_instance.py @@ -250,6 +250,11 @@ required: false type: dict suboptions: + private_network: + description: + - Private network the instance need to be associated with. + required: false + type: str ipv4_enabled: description: - Whether the instance should be assigned an IP address or not. @@ -859,6 +864,7 @@ def main(): ip_configuration=dict( type='dict', options=dict( + private_network=dict(type='str'), ipv4_enabled=dict(type='bool'), authorized_networks=dict( type='list', elements='dict', options=dict(expiration_time=dict(type='str'), name=dict(type='str'), value=dict(type='str')) @@ -1250,6 +1256,7 @@ def __init__(self, request, module): def to_request(self): return remove_nones_from_dict( { + u'privateNetwork': self.request.get('private_network'), u'ipv4Enabled': self.request.get('ipv4_enabled'), u'authorizedNetworks': InstanceAuthorizednetworksArray(self.request.get('authorized_networks', []), self.module).to_request(), u'requireSsl': self.request.get('require_ssl'), @@ -1259,6 +1266,7 @@ def to_request(self): def from_response(self): return remove_nones_from_dict( { + u'privateNetwork': self.request.get(u'privateNetwork'), u'ipv4Enabled': self.request.get(u'ipv4Enabled'), u'authorizedNetworks': InstanceAuthorizednetworksArray(self.request.get(u'authorizedNetworks', []), self.module).from_response(), u'requireSsl': self.request.get(u'requireSsl'), From e6065dd4d40422ca5a0b70bea3eb0ecd71dc1c2e Mon Sep 17 00:00:00 2001 From: ckunaparaju Date: Fri, 7 May 2021 17:48:18 -0700 Subject: [PATCH 2/2] Add format into description --- plugins/modules/gcp_sql_instance.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/modules/gcp_sql_instance.py b/plugins/modules/gcp_sql_instance.py index 0810bbfe0..79840fd84 100644 --- a/plugins/modules/gcp_sql_instance.py +++ b/plugins/modules/gcp_sql_instance.py @@ -253,6 +253,7 @@ private_network: description: - Private network the instance need to be associated with. + Format: "projects/{{ project }}/global/networks/{{ network.name }}" required: false type: str ipv4_enabled: