Skip to content

Commit 461bfb4

Browse files
authored
cs_network: Fix constraints for creating a private network (#54)
* cs_network: Fix constraints for creating a private network * add changelog fragment
1 parent 2859ce0 commit 461bfb4

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
minor_changes:
2+
- cs_network - Fix constraints when creating networks. The param `gateway` is no longer required if the param `netmask` is given (https://github.com/ngine-io/ansible-collection-cloudstack/pull/54).

plugins/modules/cs_network.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,15 @@
164164
network_offering: DefaultIsolatedNetworkOfferingWithSourceNatService
165165
network_domain: example.com
166166
167+
- name: Create a network with start and end IP
168+
ngine_io.cloudstack.cs_network:
169+
name: Private Network
170+
network_offering: PrivNet
171+
start_ip: 10.12.9.10
172+
end_ip: 10.12.9.100
173+
netmask: 255.255.255.0
174+
zone: gva-01
175+
167176
- name: Create a VPC tier
168177
ngine_io.cloudstack.cs_network:
169178
name: my VPC tier 1
@@ -597,14 +606,10 @@ def main():
597606
poll_async=dict(type='bool', default=True),
598607
tags=dict(type='list', elements='dict', aliases=['tag']),
599608
))
600-
required_together = cs_required_together()
601-
required_together.extend([
602-
['netmask', 'gateway'],
603-
])
604609

605610
module = AnsibleModule(
606611
argument_spec=argument_spec,
607-
required_together=required_together,
612+
required_together=cs_required_together(),
608613
supports_check_mode=True
609614
)
610615

0 commit comments

Comments
 (0)