def __init__(self):
        """
        Create a new Dimension Data VLAN module.
        """

        super(DimensionDataVlanModule, self).__init__(module=AnsibleModule(
            argument_spec=DimensionDataModule.argument_spec_with_wait(
                name=dict(required=True, type='str'),
                description=dict(default='', type='str'),
                network_domain=dict(required=True, type='str'),
                private_ipv4_base_address=dict(default='', type='str'),
                private_ipv4_prefix_size=dict(default=0, type='int'),
                allow_expand=dict(required=False, default=False, type='bool'),
                state=dict(default='present',
                           choices=['present', 'absent', 'readonly'])),
            required_together=DimensionDataModule.required_together()))

        self.name = self.module.params['name']
        self.description = self.module.params['description']
        self.network_domain_selector = self.module.params['network_domain']
        self.private_ipv4_base_address = self.module.params[
            'private_ipv4_base_address']
        self.private_ipv4_prefix_size = self.module.params[
            'private_ipv4_prefix_size']
        self.state = self.module.params['state']
        self.allow_expand = self.module.params['allow_expand']

        if self.wait and self.state != 'present':
            self.module.fail_json(
                msg=
                'The wait parameter is only supported when state is "present".'
            )
Ejemplo n.º 2
0
    def __init__(self):
        """
        Create a new Dimension Data network module.
        """

        super(DimensionDataNetworkModule, self).__init__(module=AnsibleModule(
            argument_spec=DimensionDataModule.argument_spec_with_wait(
                name=dict(type='str', required=True),
                description=dict(type='str', required=False),
                service_plan=dict(default='ESSENTIALS',
                                  choices=['ADVANCED', 'ESSENTIALS']),
                state=dict(default='present', choices=['present', 'absent'])),
            required_together=DimensionDataModule.required_together()))

        self.name = self.module.params['name']
        self.description = self.module.params['description']
        self.service_plan = self.module.params['service_plan']
        self.state = self.module.params['state']