Example #1
0
 def define_module():
     return AnsibleModule(
         argument_spec=dict(network={
             "type": "str",
             "required": True
         },
                            network_zone={
                                "type": "str",
                                "required": True
                            },
                            type={
                                "type": "str",
                                "required": True,
                                "choices": ["server", "cloud", "vswitch"]
                            },
                            ip_range={
                                "type": "str",
                                "required": True
                            },
                            vswitch_id={"type": "int"},
                            state={
                                "choices": ["absent", "present"],
                                "default": "present",
                            },
                            **Hcloud.base_module_arguments()),
         supports_check_mode=True,
     )
Example #2
0
 def define_module():
     return AnsibleModule(
         argument_spec=dict(type={
             "type": "str",
             "required": True,
             "choices": ["server", "label_selector", "ip"]
         },
                            load_balancer={
                                "type": "str",
                                "required": True
                            },
                            server={"type": "str"},
                            label_selector={"type": "str"},
                            ip={"type": "str"},
                            use_private_ip={
                                "type": "bool",
                                "default": False
                            },
                            state={
                                "choices": ["absent", "present"],
                                "default": "present",
                            },
                            **Hcloud.base_module_arguments()),
         supports_check_mode=True,
     )
Example #3
0
 def define_module():
     return AnsibleModule(
         argument_spec=dict(id={"type": "int"},
                            name={"type": "str"},
                            **Hcloud.base_module_arguments()),
         supports_check_mode=True,
     )
 def define_module():
     return AnsibleModule(
         argument_spec=dict(id={"type": "int"},
                            name={"type": "str"},
                            size={"type": "int"},
                            location={"type": "str"},
                            server={"type": "str"},
                            labels={"type": "dict"},
                            automount={
                                "type": "bool",
                                "default": False
                            },
                            format={
                                "type": "str",
                                "choices": ['xfs', 'ext4'],
                            },
                            delete_protection={"type": "bool"},
                            state={
                                "choices": ["absent", "present"],
                                "default": "present",
                            },
                            **Hcloud.base_module_arguments()),
         required_one_of=[['id', 'name']],
         mutually_exclusive=[["location", "server"]],
         supports_check_mode=True,
     )
Example #5
0
 def define_module():
     return AnsibleModule(
         argument_spec=dict(
             id={"type": "int"},
             name={"type": "str"},
             image={"type": "str"},
             server_type={"type": "str"},
             location={"type": "str"},
             datacenter={"type": "str"},
             user_data={"type": "str"},
             ssh_keys={"type": "list", "elements": "str"},
             volumes={"type": "list", "elements": "str"},
             firewalls={"type": "list", "elements": "str"},
             labels={"type": "dict"},
             backups={"type": "bool", "default": False},
             upgrade_disk={"type": "bool", "default": False},
             force_upgrade={"type": "bool", "default": False},
             rescue_mode={"type": "str"},
             delete_protection={"type": "bool"},
             rebuild_protection={"type": "bool"},
             state={
                 "choices": ["absent", "present", "restarted", "started", "stopped", "rebuild"],
                 "default": "present",
             },
             **Hcloud.base_module_arguments()
         ),
         required_one_of=[['id', 'name']],
         mutually_exclusive=[["location", "datacenter"]],
         required_together=[["delete_protection", "rebuild_protection"]],
         supports_check_mode=True,
     )
Example #6
0
 def define_module():
     return AnsibleModule(
         argument_spec=dict(id={"type": "int"},
                            name={"type": "str"},
                            label_selector={"type": "str"},
                            type={
                                "choices": ["system", "snapshot", "backup"],
                                "default": "system",
                                "type": "str"
                            },
                            **Hcloud.base_module_arguments()),
         supports_check_mode=True,
     )
 def define_module():
     return AnsibleModule(
         argument_spec=dict(
             server={"type": "str", "required": True},
             ip_address={"type": "str", "required": True},
             dns_ptr={"type": "str"},
             state={
                 "choices": ["absent", "present"],
                 "default": "present",
             },
             **Hcloud.base_module_arguments()
         ),
         supports_check_mode=True,
     )
 def define_module():
     return AnsibleModule(
         argument_spec=dict(
             network={"type": "str", "required": True},
             destination={"type": "str", "required": True},
             gateway={"type": "str", "required": True},
             state={
                 "choices": ["absent", "present"],
                 "default": "present",
             },
             **Hcloud.base_module_arguments()
         ),
         supports_check_mode=True,
     )
 def define_module():
     return AnsibleModule(
         argument_spec=dict(id={"type": "int"},
                            name={"type": "str"},
                            ip_range={"type": "str"},
                            labels={"type": "dict"},
                            delete_protection={"type": "bool"},
                            state={
                                "choices": ["absent", "present"],
                                "default": "present",
                            },
                            **Hcloud.base_module_arguments()),
         required_one_of=[['id', 'name']],
         supports_check_mode=True,
     )
 def define_module():
     return AnsibleModule(
         argument_spec=dict(
             network={"type": "str", "required": True},
             server={"type": "str", "required": True},
             ip={"type": "str"},
             alias_ips={"type": "list"},
             state={
                 "choices": ["absent", "present"],
                 "default": "present",
             },
             **Hcloud.base_module_arguments()
         ),
         supports_check_mode=True,
     )
Example #11
0
 def define_module():
     return AnsibleModule(
         argument_spec=dict(id={"type": "int"},
                            name={"type": "str"},
                            labels={"type": "dict"},
                            type={"type": "str"},
                            state={
                                "choices": ["absent", "present"],
                                "default": "present",
                            },
                            **Hcloud.base_module_arguments()),
         required_one_of=[['id', 'name']],
         required_if=[['state', 'present', ['name']]],
         supports_check_mode=True,
     )
Example #12
0
 def define_module():
     return AnsibleModule(
         argument_spec=dict(
             server={"type": "str"},
             floating_ip={"type": "str"},
             ip_address={"type": "str", "required": True},
             dns_ptr={"type": "str"},
             state={
                 "choices": ["absent", "present"],
                 "default": "present",
             },
             **Hcloud.base_module_arguments()
         ),
         required_one_of=[['server', 'floating_ip']],
         mutually_exclusive=[["server", "floating_ip"]],
         supports_check_mode=True,
     )
Example #13
0
 def define_module():
     return AnsibleModule(
         argument_spec=dict(id={"type": "int"},
                            name={"type": "str"},
                            load_balancer_type={"type": "str"},
                            location={"type": "str"},
                            network_zone={"type": "str"},
                            labels={"type": "dict"},
                            delete_protection={"type": "bool"},
                            disable_public_interface={"type": "bool"},
                            state={
                                "choices": ["absent", "present"],
                                "default": "present",
                            },
                            **Hcloud.base_module_arguments()),
         required_one_of=[['id', 'name']],
         mutually_exclusive=[["location", "network_zone"]],
         supports_check_mode=True,
     )
 def define_module():
     return AnsibleModule(
         argument_spec=dict(
             id={"type": "int"},
             name={"type": "str"},
             rules=dict(
                 type="list",
                 elements="dict",
                 options=dict(
                     direction={
                         "type": "str",
                         "choices": ["in", "out"]
                     },
                     protocol={
                         "type": "str",
                         "choices": ["icmp", "udp", "tcp"]
                     },
                     port={"type": "str"},
                     source_ips={
                         "type": "list",
                         "elements": "str",
                         "default": []
                     },
                     destination_ips={
                         "type": "list",
                         "elements": "str",
                         "default": []
                     },
                     description={"type": "str"},
                 ),
                 required_together=[["direction", "protocol"]],
             ),
             labels={"type": "dict"},
             state={
                 "choices": ["absent", "present"],
                 "default": "present",
             },
             **Hcloud.base_module_arguments()),
         required_one_of=[['id', 'name']],
         required_if=[['state', 'present', ['name']]],
         supports_check_mode=True,
     )
 def define_module():
     return AnsibleModule(
         argument_spec=dict(id={"type": "int"},
                            name={"type": "str"},
                            description={"type": "str"},
                            server={"type": "str"},
                            home_location={"type": "str"},
                            force={"type": "bool"},
                            type={"choices": ["ipv4", "ipv6"]},
                            labels={"type": "dict"},
                            delete_protection={"type": "bool"},
                            state={
                                "choices": ["absent", "present"],
                                "default": "present",
                            },
                            **Hcloud.base_module_arguments()),
         required_one_of=[['id', 'name']],
         mutually_exclusive=[['home_location', 'server']],
         supports_check_mode=True,
     )
 def define_module():
     return AnsibleModule(
         argument_spec=dict(
             id={"type": "int"},
             name={"type": "str"},
             type={
                 "choices": ["uploaded", "managed"],
                 "default": "uploaded",
             },
             domain_names={"type": "list", "elements": "str", "default": []},
             certificate={"type": "str"},
             private_key={"type": "str", "no_log": True},
             labels={"type": "dict"},
             state={
                 "choices": ["absent", "present"],
                 "default": "present",
             },
             **Hcloud.base_module_arguments()
         ),
         required_one_of=[['id', 'name']],
         required_if=[['state', 'present', ['name']]],
         supports_check_mode=True,
     )
 def __init__(self, module):
     Hcloud.__init__(self, module, "hcloud_volume")
     self.hcloud_volume = None
Example #18
0
 def __init__(self, module):
     Hcloud.__init__(self, module, "hcloud_ssh_key_info")
     self.hcloud_ssh_key_info = None
Example #19
0
 def __init__(self, module):
     Hcloud.__init__(self, module, "hcloud_certificate_info")
     self.hcloud_certificate_info = None
 def __init__(self, module):
     Hcloud.__init__(self, module, "hcloud_rdns")
     self.hcloud_resource = None
     self.hcloud_rdns = None
 def __init__(self, module):
     Hcloud.__init__(self, module, "hcloud_firewall")
     self.hcloud_firewall = None
Example #22
0
    def define_module():
        return AnsibleModule(
            argument_spec=dict(
                load_balancer={"type": "str", "required": True},
                listen_port={"type": "int", "required": True},
                destination_port={"type": "int"},
                protocol={
                    "type": "str",
                    "choices": ["http", "https", "tcp"],
                },
                proxyprotocol={"type": "bool", "default": False},
                http={
                    "type": "dict",
                    "options": dict(
                        cookie_name={
                            "type": "str"
                        },
                        cookie_lifetime={
                            "type": "int"
                        },
                        sticky_sessions={
                            "type": "bool",
                            "default": False
                        },
                        redirect_http={
                            "type": "bool",
                            "default": False
                        },
                        certificates={
                            "type": "list",
                            "elements": "str"
                        },

                    )
                },
                health_check={
                    "type": "dict",
                    "options": dict(
                        protocol={
                            "type": "str",
                            "choices": ["http", "https", "tcp"],
                        },
                        port={
                            "type": "int"
                        },
                        interval={
                            "type": "int"
                        },
                        timeout={
                            "type": "int"
                        },
                        retries={
                            "type": "int"
                        },
                        http={
                            "type": "dict",
                            "options": dict(
                                domain={
                                    "type": "str"
                                },
                                path={
                                    "type": "str"
                                },
                                response={
                                    "type": "str"
                                },
                                status_codes={
                                    "type": "list",
                                    "elements": "str"
                                },
                                tls={
                                    "type": "bool",
                                    "default": False
                                },
                            )
                        }
                    )

                },
                state={
                    "choices": ["absent", "present"],
                    "default": "present",
                },
                **Hcloud.base_module_arguments()
            ),
            supports_check_mode=True,
        )
Example #23
0
 def __init__(self, module):
     Hcloud.__init__(self, module, "hcloud_load_balancer_service")
     self.hcloud_load_balancer = None
     self.hcloud_load_balancer_service = None
Example #24
0
 def __init__(self, module):
     Hcloud.__init__(self, module, "hcloud_image_info")
     self.hcloud_image_info = None
Example #25
0
 def __init__(self, module):
     Hcloud.__init__(self, module, "hcloud_load_balancer_network")
     self.hcloud_network = None
     self.hcloud_load_balancer = None
     self.hcloud_load_balancer_network = None
 def __init__(self, module):
     Hcloud.__init__(self, module, "hcloud_floating_ip_info")
     self.hcloud_floating_ip_info = None
Example #27
0
 def __init__(self, module):
     Hcloud.__init__(self, module, "hcloud_load_balancer")
     self.hcloud_load_balancer = None
Example #28
0
 def __init__(self, module):
     Hcloud.__init__(self, module, "hcloud_placement_group")
     self.hcloud_placement_group = None
Example #29
0
 def __init__(self, module):
     Hcloud.__init__(self, module, "hcloud_datacenter_info")
     self.hcloud_datacenter_info = None
 def __init__(self, module):
     Hcloud.__init__(self, module, "hcloud_server_info")
     self.hcloud_server_info = None