def main(): argument_spec = scaleway_argument_spec() argument_spec.update( state=dict(type='str', default='present', choices=['absent', 'present']), region=dict(type='str', required=True, choices=SCALEWAY_LOCATION.keys()), protocol=dict(type='str', required=True, choices=['TCP', 'UDP', 'ICMP']), port=dict(type='int', required=True), ip_range=dict(type='str', default='0.0.0.0/0'), direction=dict(type='str', required=True, choices=['inbound', 'outbound']), action=dict(type='str', required=True, choices=['accept', 'drop']), security_group=dict(type='str', required=True), ) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True, ) core(module)
def main(): argument_spec = scaleway_argument_spec() argument_spec.update( dict( state=dict(type='str', default='present', choices=['absent', 'present']), organization=dict(type='str', required=True), name=dict(type='str', required=True), description=dict(type='str'), region=dict(type='str', required=True, choices=SCALEWAY_LOCATION.keys()), stateful=dict(type='bool', required=True), inbound_default_policy=dict(type='str', choices=['accept', 'drop']), outbound_default_policy=dict(type='str', choices=['accept', 'drop']), organization_default=dict(type='bool'), )) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True, required_if=[[ 'stateful', True, ['inbound_default_policy', 'outbound_default_policy'] ]]) core(module)
def main(): argument_spec = scaleway_argument_spec() argument_spec.update( dict( region=dict(required=True, choices=SCALEWAY_LOCATION.keys()), user_data=dict(type="dict"), server_id=dict(required=True), )) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True, ) core(module)
def main(): argument_spec = scaleway_argument_spec() argument_spec.update( dict(region=dict(required=True, choices=SCALEWAY_LOCATION.keys()), )) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True, ) try: module.exit_json( scaleway_image_info=ScalewayImageInfo(module).get_resources()) except ScalewayException as exc: module.fail_json(msg=exc.message)
def main(): argument_spec = scaleway_argument_spec() argument_spec.update(dict( region=dict(required=True, choices=SCALEWAY_LOCATION.keys()), )) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True, ) try: module.exit_json( ansible_facts={'scaleway_security_group_facts': ScalewaySecurityGroupFacts(module).get_resources()} ) except ScalewayException as exc: module.fail_json(msg=exc.message)
def main(): argument_spec = scaleway_argument_spec() argument_spec.update(dict( state=dict(default='present', choices=['absent', 'present']), name=dict(required=True), size=dict(type='int'), organization=dict(), volume_type=dict(), region=dict(required=True, choices=SCALEWAY_LOCATION.keys()), )) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True, ) core(module)
def main(): argument_spec = scaleway_argument_spec() argument_spec.update( dict( image=dict(required=True), name=dict(), region=dict(required=True, choices=SCALEWAY_LOCATION.keys()), commercial_type=dict(required=True), enable_ipv6=dict(default=False, type="bool"), public_ip=dict(default="absent"), state=dict(choices=state_strategy.keys(), default='present'), tags=dict(type="list", default=[]), organization=dict(required=True), wait=dict(type="bool", default=False), wait_timeout=dict(type="int", default=300), wait_sleep_time=dict(type="int", default=3), security_group=dict(), )) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True, ) core(module)
def _get_zones(self, config_zones): return set(SCALEWAY_LOCATION.keys()).intersection(config_zones)