Tried this:

ngine_io.cloudstack.cs_vlan_ip_range:
        start_ip: 192.168.1.10
        end_ip: 192.168.1.20
        netmask: 255.255.255.0
        gateway: 192.168.1.1
        for_virtual_network: true
        physical_network:  {{
zone.phyisical_network_with_management_label.id }}
        pod: "{{ pod.id }}"
        zone: "{{ zone.id }}"
        for_system_vms: true

There is no public label because the Zone is with Security groups enabled.
The output is:
 "msg": "CloudStackException: HTTP 431 response from CloudStack, error:
{'uuidList': [], 'errorcode': 431, 'cserrorcode': 4350, 'errortext':
\"Can't add virtual ip range into a zone with security group enabled\"}",
"physical_network": "management-network", "zone": "test-zone"}

assuming this can be created manually it means that the command still does
not pass the required arguments.
when launched manually i see this in the management server log:
podid={{ pod.id }}&gateway=192.168.1.1&netmask=255.255.255.0&startip=
192.168.1.10&endip=192.168.1.20&forsystemvms=true&command=
*createManagementNetworkIpRange*&response=json

the output of the ansible task above, shown in the log is:
zoneid={{ zone.id }}&startip=192.168.1.10&endip=192.168.1.20
&netmask=255.255.255.0&gateway=192.168.1.1&forvirtualnetwork=True&forsystemvms=True&podid={{
pod.id }}&physicalnetworkid={{ phys_net.id }}&apiKey=xxxx&command=
*createVlanIpRange*

when for_virtual_networks is set to false:
zoneid={{ zone.id }}&startip=192.168.1.10&endip=192.168.1.20
&netmask=255.255.255.0&gateway=192.168.1.1&forvirtualnetwork=False&forsystemvms=True&podid={{
pod.id }}&physicalnetworkid={{ phys_net.id }}&apiKey=xxxx&command=
*createVlanIpRange*

After downloading & grepping the NGINE IO CS repository it seems that there
is the module cannot execute such command.
-  grep 'self.query_api' ansible-collection-cloudstack/plugins/*/*  - lists
all commands modules can execute
-  grep 'createM' ansible-collection-cloudstack/plugins/*/*  - has no output

So it seems that is not possible.

Regards,
Jordan



On Tue, Oct 25, 2022 at 11:25 AM Wei ZHOU <ustcweiz...@gmail.com> wrote:

> I think you need to
> - add for_virtual_network=true
> - add physical_network (id of physical network which has traffic type
> 'Public')
> - remove network
>
> -Wei
> On Tue, 25 Oct 2022 at 09:32, jordan j <yordan...@gmail.com> wrote:
>
> > Hey everyone,
> >
> > Working on an ACS config deployed via ansible using ngine_io.cloudstack
> > modules (https://galaxy.ansible.com/ngine_io/cloudstack)
> > I would like to deploy a secondary IP range in the management network
> only
> > for the use of system vms, is it possible to accomplish this via those
> > modules?
> >
> > from what I could find the only submodule that configure networks and
> have
> > anything to do with system_vm_only check is cs_vlan_ip_range (
> >
> >
> https://docs.ansible.com/ansible/latest/collections/ngine_io/cloudstack/cs_vlan_ip_range_module.html
> > )
> > but unfortunately examples are scarce and whatever i did try so far is
> not
> > working.
> >
> > The code below shows an error that NETWORK var item is required but
> > PHYISICAL_NETWORK is passed in already so it does not make sense. -
> name:
> > add secondary management network for system vms
> >       ngine_io.cloudstack.cs_vlan_ip_range:
> >         start_ip: 192.168.1.10
> >         end_ip: 192.168.1.20
> >         netmask: 255.255.255.0
> >         gateway: 192.168.1.1
> >         physical_network:  {{
> > zone.phyisical_network_with_management_label.id }}
> >         pod: "{{ pod.id }}"
> >         zone: "{{ zone.id }}"
> >         for_system_vms: true
> >
> >  when i add the NETWORK var is added with a string value ("test" for
> > example) the error output is *Network not available*.
> >
> > Is this possible at all with this module or is my configuration at fault?
> >
> > Regards,
> > Jordan
> >
>
> On Tue, 25 Oct 2022 at 09:32, jordan j <yordan...@gmail.com> wrote:
>
> > Hey everyone,
> >
> > Working on an ACS config deployed via ansible using ngine_io.cloudstack
> > modules (https://galaxy.ansible.com/ngine_io/cloudstack)
> > I would like to deploy a secondary IP range in the management network
> only
> > for the use of system vms, is it possible to accomplish this via those
> > modules?
> >
> > from what I could find the only submodule that configure networks and
> have
> > anything to do with system_vm_only check is cs_vlan_ip_range (
> >
> >
> https://docs.ansible.com/ansible/latest/collections/ngine_io/cloudstack/cs_vlan_ip_range_module.html
> > )
> > but unfortunately examples are scarce and whatever i did try so far is
> not
> > working.
> >
> > The code below shows an error that NETWORK var item is required but
> > PHYISICAL_NETWORK is passed in already so it does not make sense. -
> name:
> > add secondary management network for system vms
> >       ngine_io.cloudstack.cs_vlan_ip_range:
> >         start_ip: 192.168.1.10
> >         end_ip: 192.168.1.20
> >         netmask: 255.255.255.0
> >         gateway: 192.168.1.1
> >         physical_network:  {{
> > zone.phyisical_network_with_management_label.id }}
> >         pod: "{{ pod.id }}"
> >         zone: "{{ zone.id }}"
> >         for_system_vms: true
> >
> >  when i add the NETWORK var is added with a string value ("test" for
> > example) the error output is *Network not available*.
> >
> > Is this possible at all with this module or is my configuration at fault?
> >
> > Regards,
> > Jordan
> >
>

Reply via email to