def main(): module = AnsibleModule( argument_spec=dict( oauth_token=dict( no_log=True, # Support environment variable for Scaleway OAuth Token fallback=(env_fallback, ['SCW_TOKEN', 'SCW_API_KEY', 'SCW_OAUTH_TOKEN']), required=True, ), image=dict(required=True), name=dict(), region=dict(required=True, choices=SCALEWAY_LOCATION.keys()), commercial_type=dict(required=True, choices=SCALEWAY_COMMERCIAL_TYPES), enable_ipv6=dict(default=False, type="bool"), state=dict(choices=state_strategy.keys(), default='present'), tags=dict(type="list", default=[]), organization=dict(required=True), timeout=dict(type="int", default=30), wait=dict(type="bool", default=False), wait_timeout=dict(type="int", default=300), wait_sleep_time=dict(type="int", default=3), ), 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"), boot_type=dict(choices=['bootscript', 'local']), 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 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( 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( id=dict(required=True), 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(region=dict(required=True, choices=SCALEWAY_LOCATION.keys()), )) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True, ) try: module.exit_json( scaleway_ip_info=ScalewayIpInfo(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']), organization=dict(required=True), server=dict(), reverse=dict(), region=dict(required=True, choices=SCALEWAY_LOCATION.keys()), id=dict())) 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( ansible_facts={'scaleway_security_group_facts': ScalewaySecurityGroupFacts(module).get_resources()} ) except ScalewayException as exc: module.fail_json(msg=exc.message)
def main(): module = AnsibleModule( argument_spec=dict( region=dict(required=True, choices=SCALEWAY_LOCATION.keys()), oauth_token=dict( no_log=True, # Support environment variable for Scaleway OAuth Token fallback=(env_fallback, ['SCW_TOKEN', 'SCW_API_KEY', 'SCW_OAUTH_TOKEN']), required=True, ), state=dict(choices=['present', 'absent'], required=True), name=dict(required=True), size=dict(type='int'), organization=dict(), volume_type=dict(), timeout=dict(type='int', default=30), ), supports_check_mode=True, ) core(module)
def _get_zones(self): config_zones = self.get_option("regions") return set(SCALEWAY_LOCATION.keys()).intersection(config_zones)
def _get_zones(self, config_zones): return set(SCALEWAY_LOCATION.keys()).intersection(config_zones)