def __init__(self): self.argument_spec = netapp_utils.ontap_sf_host_argument_spec() self.argument_spec.update(dict( state=dict(required=True, choices=['present', 'absent']), name=dict(required=True, type='str'), flexvol_name=dict(type='str'), vserver=dict(required=True, type='str'), )) self.module = AnsibleModule( argument_spec=self.argument_spec, required_if=[ ('state', 'present', ['flexvol_name']) ], supports_check_mode=True ) p = self.module.params # set up state variables self.state = p['state'] self.name = p['name'] self.flexvol_name = p['flexvol_name'] self.vserver = p['vserver'] if HAS_NETAPP_LIB is False: self.module.fail_json(msg="the python NetApp-Lib module is required") else: self.server = netapp_utils.setup_ontap_zapi(module=self.module, vserver=self.vserver)
def __init__(self): self.argument_spec = netapp_utils.ontap_sf_host_argument_spec() self.argument_spec.update( dict( serial_number=dict(required=False, type='str', default=None), remove_unused=dict(default=False, type='bool'), remove_expired=dict(default=False, type='bool'), licenses=dict(default=False, type='dict'), )) self.module = AnsibleModule(argument_spec=self.argument_spec, supports_check_mode=False) p = self.module.params # set up state variables self.serial_number = p['serial_number'] self.remove_unused = p['remove_unused'] self.remove_expired = p['remove_expired'] self.licenses = p['licenses'] if HAS_NETAPP_LIB is False: self.module.fail_json( msg="the python NetApp-Lib module is required") else: self.server = netapp_utils.setup_ontap_zapi(module=self.module)
def __init__(self): self.argument_spec = netapp_utils.ontap_sf_host_argument_spec() self.argument_spec.update( dict( state=dict(required=True, choices=['present', 'absent']), name=dict(required=True, type='str'), command_directory_name=dict(required=True, type='str'), access_level=dict(required=False, type='str', default='all', choices=['none', 'readonly', 'all']), vserver=dict(required=True, type='str'), )) self.module = AnsibleModule(argument_spec=self.argument_spec, supports_check_mode=True) p = self.module.params # set up state variables self.state = p['state'] self.name = p['name'] self.command_directory_name = p['command_directory_name'] self.access_level = p['access_level'] self.vserver = p['vserver'] if HAS_NETAPP_LIB is False: self.module.fail_json( msg="the python NetApp-Lib module is required") else: self.server = netapp_utils.setup_ontap_zapi(module=self.module)
def __init__(self): self._size_unit_map = dict(bytes=1, b=1, kb=1024, mb=1024**2, gb=1024**3, tb=1024**4, pb=1024**5, eb=1024**6, zb=1024**7, yb=1024**8) self.argument_spec = netapp_utils.ontap_sf_host_argument_spec() self.argument_spec.update( dict( state=dict(required=True, choices=['present', 'absent']), name=dict(required=True, type='str'), size=dict(type='int'), size_unit=dict(default='gb', choices=[ 'bytes', 'b', 'kb', 'mb', 'gb', 'tb', 'pb', 'eb', 'zb', 'yb' ], type='str'), force_resize=dict(default=False, type='bool'), force_remove=dict(default=False, type='bool'), force_remove_fenced=dict(default=False, type='bool'), flexvol_name=dict(type='str'), vserver=dict(required=True, type='str'), )) self.module = AnsibleModule(argument_spec=self.argument_spec, required_if=[('state', 'present', ['flexvol_name', 'size'])], supports_check_mode=True) p = self.module.params # set up state variables self.state = p['state'] self.name = p['name'] self.size_unit = p['size_unit'] if p['size'] is not None: self.size = p['size'] * self._size_unit_map[self.size_unit] else: self.size = None self.force_resize = p['force_resize'] self.force_remove = p['force_remove'] self.force_remove_fenced = p['force_remove_fenced'] self.flexvol_name = p['flexvol_name'] self.vserver = p['vserver'] if HAS_NETAPP_LIB is False: self.module.fail_json( msg="the python NetApp-Lib module is required") else: self.server = netapp_utils.setup_ontap_zapi(module=self.module, vserver=self.vserver)
def __init__(self): self.argument_spec = netapp_utils.ontap_sf_host_argument_spec() self.argument_spec.update( dict( state=dict(required=True, choices=['present', 'absent']), name=dict(required=True, type='str'), application=dict(required=True, type='str', choices=[ 'console', 'http', 'ontapi', 'rsh', 'snmp', 'sp', 'ssh', 'telnet' ]), authentication_method=dict(required=True, type='str', choices=[ 'community', 'password', 'publickey', 'domain', 'nsswitch', 'usm' ]), set_password=dict(required=False, type='str', default=None), role_name=dict(required=False, type='str'), vserver=dict(required=True, type='str'), )) self.module = AnsibleModule(argument_spec=self.argument_spec, required_if=[('state', 'present', ['role_name'])], supports_check_mode=True) p = self.module.params # set up state variables self.state = p['state'] self.name = p['name'] self.application = p['application'] self.authentication_method = p['authentication_method'] self.set_password = p['set_password'] self.role_name = p['role_name'] self.vserver = p['vserver'] if HAS_NETAPP_LIB is False: self.module.fail_json( msg="the python NetApp-Lib module is required") else: self.server = netapp_utils.setup_ontap_zapi(module=self.module)
def __init__(self): self.argument_spec = netapp_utils.ontap_sf_host_argument_spec() self.argument_spec.update(dict( state=dict(required=True, choices=['present', 'absent']), name=dict(required=True, type='str'), root_volume=dict(type='str'), root_volume_aggregate=dict(type='str'), root_volume_security_style=dict(type='str', choices=['unix', 'ntfs', 'mixed', 'unified' ]), )) self.module = AnsibleModule( argument_spec=self.argument_spec, required_if=[ ('state', 'present', ['root_volume', 'root_volume_aggregate', 'root_volume_security_style']) ], supports_check_mode=True ) p = self.module.params # set up state variables self.state = p['state'] self.name = p['name'] self.root_volume = p['root_volume'] self.root_volume_aggregate = p['root_volume_aggregate'] self.root_volume_security_style = p['root_volume_security_style'] if HAS_NETAPP_LIB is False: self.module.fail_json(msg="the python NetApp-Lib module is required") else: self.server = netapp_utils.setup_ontap_zapi(module=self.module)
def __init__(self): self._size_unit_map = dict(bytes=1, b=1, kb=1024, mb=1024**2, gb=1024**3, tb=1024**4, pb=1024**5, eb=1024**6, zb=1024**7, yb=1024**8) self.argument_spec = netapp_utils.ontap_sf_host_argument_spec() self.argument_spec.update( dict( state=dict(required=True, choices=['present', 'absent']), name=dict(required=True, type='str'), is_infinite=dict(required=False, type='bool', default=False, aliases=['infinite']), is_online=dict(required=False, type='bool', default=True, aliases=['online']), size=dict(type='int'), size_unit=dict(default='gb', choices=[ 'bytes', 'b', 'kb', 'mb', 'gb', 'tb', 'pb', 'eb', 'zb', 'yb' ], type='str'), aggregate_name=dict(type='str'), vserver=dict(required=True, type='str', default=None), junction_path=dict(required=False, type='str', default=None), export_policy=dict(required=False, type='str', default='default'), snapshot_policy=dict(required=False, type='str', default='default'), )) self.module = AnsibleModule(argument_spec=self.argument_spec, required_if=[('state', 'present', ['aggregate_name', 'size'])], supports_check_mode=True) p = self.module.params # set up state variables self.state = p['state'] self.name = p['name'] self.is_infinite = p['is_infinite'] self.is_online = p['is_online'] self.size_unit = p['size_unit'] self.vserver = p['vserver'] self.junction_path = p['junction_path'] self.export_policy = p['export_policy'] self.snapshot_policy = p['snapshot_policy'] if p['size'] is not None: self.size = p['size'] * self._size_unit_map[self.size_unit] else: self.size = None self.aggregate_name = p['aggregate_name'] if HAS_NETAPP_LIB is False: self.module.fail_json( msg="the python NetApp-Lib module is required") else: self.server = netapp_utils.setup_ontap_zapi(module=self.module, vserver=self.vserver)