def main(): module = AnsibleModule( argument_spec=DigitalOceanHelper.digital_ocean_argument_spec(), supports_check_mode=True, ) core(module)
def main(): argument_spec = DigitalOceanHelper.digital_ocean_argument_spec() module = AnsibleModule(argument_spec=argument_spec) if module._name == 'digital_ocean_account_facts': module.deprecate("The 'digital_ocean_account_facts' module has been renamed to 'digital_ocean_account_info'", version='2.13') try: core(module) except Exception as e: module.fail_json(msg=to_native(e), exception=format_exc())
def main(): module = AnsibleModule( argument_spec=DigitalOceanHelper.digital_ocean_argument_spec(), supports_check_mode=False, ) module.deprecate( "The 'digital_ocean_sshkey_facts' module has been deprecated, use the new 'digital_ocean_sshkey_info' module", version='2.13') core(module)
def main(): argument_spec = DigitalOceanHelper.digital_ocean_argument_spec() argument_spec.update(region_name=dict(type='str', required=False), ) module = AnsibleModule(argument_spec=argument_spec) if module._name == 'digital_ocean_volume_facts': module.deprecate( "The 'digital_ocean_volume_facts' module has been renamed to 'digital_ocean_volume_info'", version='2.13') try: core(module) except Exception as e: module.fail_json(msg=to_native(e), exception=format_exc())
def main(): argument_spec = DigitalOceanHelper.digital_ocean_argument_spec() argument_spec.update( name=dict(type='str', required=True), resource_id=dict(aliases=['droplet_id'], type='str'), resource_type=dict(choices=['droplet'], default='droplet'), state=dict(choices=['present', 'absent'], default='present'), ) module = AnsibleModule(argument_spec=argument_spec) try: core(module) except Exception as e: module.fail_json(msg=to_native(e), exception=format_exc())
def main(): argument_spec = DigitalOceanHelper.digital_ocean_argument_spec() argument_spec.update(image_type=dict( type='str', required=False, choices=['all', 'application', 'distribution', 'private'], default='all')) module = AnsibleModule(argument_spec=argument_spec) if module._name == 'digital_ocean_image_facts': module.deprecate( "The 'digital_ocean_image_facts' module has been renamed to 'digital_ocean_image_info'", version='2.13') try: core(module) except Exception as e: module.fail_json(msg=to_native(e), exception=format_exc())
def main(): argument_spec = DigitalOceanHelper.digital_ocean_argument_spec() argument_spec.update( state=dict(choices=['present', 'absent'], default='present'), name=dict(type='str'), id=dict(aliases=['droplet_id'], type='int'), ip=dict(type='str') ) module = AnsibleModule( argument_spec=argument_spec, required_one_of=( ['id', 'name'], ), ) try: core(module) except Exception as e: module.fail_json(msg=to_native(e), exception=traceback.format_exc())
def main(): argument_spec = DigitalOceanHelper.digital_ocean_argument_spec() argument_spec.update( name=dict(type='str'), leaf_certificate=dict(type='str'), private_key=dict(type='str', no_log=True), state=dict(choices=['present', 'absent'], default='present'), certificate_chain=dict(type='str') ) module = AnsibleModule( argument_spec=argument_spec, required_if=[('state', 'present', ['name', 'leaf_certificate', 'private_key']), ('state', 'absent', ['name']) ], ) try: core(module) except Exception as e: module.fail_json(msg=to_native(e))
def main(): argument_spec = DigitalOceanHelper.digital_ocean_argument_spec() argument_spec.update(state=dict(choices=['present', 'absent'], required=True), command=dict(choices=['create', 'attach'], required=True), block_size=dict(type='int', required=False), volume_name=dict(type='str', required=True), description=dict(type='str'), region=dict(type='str', required=False), snapshot_id=dict(type='str', required=False), droplet_id=dict(type='int')) module = AnsibleModule(argument_spec=argument_spec) try: handle_request(module) except DOBlockStorageException as e: module.fail_json(msg=e.message, exception=traceback.format_exc()) except KeyError as e: module.fail_json(msg='Unable to load %s' % e.message, exception=traceback.format_exc())
def main(): argument_spec = DigitalOceanHelper.digital_ocean_argument_spec() argument_spec.update( snapshot_type=dict(type='str', required=False, choices=['all', 'droplet', 'volume', 'by_id'], default='all'), snapshot_id=dict(type='str', required=False), ) module = AnsibleModule( argument_spec=argument_spec, required_if=[ ['snapshot_type', 'by_id', ['snapshot_id']], ], ) if module._name == 'digital_ocean_snapshot_facts': module.deprecate("The 'digital_ocean_snapshot_facts' module has been renamed to 'digital_ocean_snapshot_info'", version='2.13') try: core(module) except Exception as e: module.fail_json(msg=to_native(e), exception=format_exc())