Search is not available for this dataset
text
stringlengths
75
104k
def get_pending_file_rename(): ''' Determine whether there are pending file rename operations that require a reboot. .. versionadded:: 2016.11.0 Returns: bool: ``True`` if there are pending file rename operations, otherwise ``False`` CLI Example: .. code-block:: bash ...
def get_pending_servermanager(): ''' Determine whether there are pending Server Manager tasks that require a reboot. .. versionadded:: 2016.11.0 Returns: bool: ``True`` if there are pending Server Manager tasks, otherwise ``False`` CLI Example: .. code-block:: bash ...
def get_pending_update(): ''' Determine whether there are pending updates that require a reboot. .. versionadded:: 2016.11.0 Returns: bool: ``True`` if there are pending updates, otherwise ``False`` CLI Example: .. code-block:: bash salt '*' system.get_pending_update '''...
def set_reboot_required_witnessed(): r''' This function is used to remember that an event indicating that a reboot is required was witnessed. This function relies on the salt-minion's ability to create the following volatile registry key in the *HKLM* hive: *SYSTEM\\CurrentControlSet\\Services\\...
def get_pending_reboot(): ''' Determine whether there is a reboot pending. .. versionadded:: 2016.11.0 Returns: bool: ``True`` if the system is pending reboot, otherwise ``False`` CLI Example: .. code-block:: bash salt '*' system.get_pending_reboot ''' # Order the c...
def present(name, if_not_exists=None, schema=None, ext_version=None, from_version=None, user=None, maintenance_db=None, db_user=None, db_password=None, db_host=None, db_port=None): ''' Ensure ...
def absent(name, if_exists=None, restrict=None, cascade=None, user=None, maintenance_db=None, db_user=None, db_password=None, db_host=None, db_port=None): ''' Ensure that the named extension is absent. name ...
def _get_file_auth_config(): ''' Setup defaults and check configuration variables for auth backends ''' config = { 'filetype': 'text', 'hashtype': 'plaintext', 'field_separator': ':', 'username_field': 1, 'password_field': 2, } for opt in __opts__['exter...
def _text(username, password, **kwargs): ''' The text file function can authenticate plaintext and digest methods that are available in the :py:func:`hashutil.digest <salt.modules.hashutil.digest>` function. ''' filename = kwargs['filename'] hashtype = kwargs['hashtype'] field_separator...
def _htpasswd(username, password, **kwargs): ''' Provide authentication via Apache-style htpasswd files ''' from passlib.apache import HtpasswdFile pwfile = HtpasswdFile(kwargs['filename']) # passlib below version 1.6 uses 'verify' function instead of 'check_password' if salt.utils.versio...
def _htdigest(username, password, **kwargs): ''' Provide authentication via Apache-style htdigest files ''' realm = kwargs.get('realm', None) if not realm: log.error('salt.auth.file: A ^realm must be defined in ' 'external_auth:file for htdigest filetype') return F...
def _htfile(username, password, **kwargs): ''' Gate function for _htpasswd and _htdigest authentication backends ''' filetype = kwargs.get('filetype', 'htpasswd').lower() try: import passlib kwargs['passlib_version'] = passlib.__version__ except ImportError: log.error('...
def auth(username, password): ''' File based authentication ^filename The path to the file to use for authentication. ^filetype The type of file: ``text``, ``htpasswd``, ``htdigest``. Default: ``text`` ^realm The realm required by htdigest authentication. .. ...
def present(name, parent=None, vlan=None): ''' Ensures that the named bridge exists, eventually creates it. Args: name: The name of the bridge. parent: The name of the parent bridge (if the bridge shall be created as a fake bridge). If specified, vlan must also be specified. ...
def absent(name): ''' Ensures that the named bridge does not exist, eventually deletes it. Args: name: The name of the bridge. ''' ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''} # Comment and change messages comment_bridge_deleted = 'Bridge {0} deleted.'.form...
def ext_pillar(minion_id, # pylint: disable=W0613 pillar, # pylint: disable=W0613 command): ''' Execute a command and read the output as YAMLEX ''' try: command = command.replace('%s', minion_id) return deserialize(__salt__['cmd.run']('{0}'.format(command)...
def deployment_absent(name, namespace='default', **kwargs): ''' Ensures that the named deployment is absent from the given namespace. name The name of the deployment namespace The name of the namespace ''' ret = {'name': name, 'changes': {}, 'result': Fal...
def deployment_present( name, namespace='default', metadata=None, spec=None, source='', template='', **kwargs): ''' Ensures that the named deployment is present inside of the specified namespace with the given metadata and spec. If the deployment e...
def service_present( name, namespace='default', metadata=None, spec=None, source='', template='', **kwargs): ''' Ensures that the named service is present inside of the specified namespace with the given metadata and spec. If the deployment exists ...
def service_absent(name, namespace='default', **kwargs): ''' Ensures that the named service is absent from the given namespace. name The name of the service namespace The name of the namespace ''' ret = {'name': name, 'changes': {}, 'result': False, ...
def namespace_absent(name, **kwargs): ''' Ensures that the named namespace is absent. name The name of the namespace ''' ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''} namespace = __salt__['kubernetes.show_namespace'](name, **kwarg...
def namespace_present(name, **kwargs): ''' Ensures that the named namespace is present. name The name of the namespace. ''' ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''} namespace = __salt__['kubernetes.show_namespace'](name, **kw...
def secret_absent(name, namespace='default', **kwargs): ''' Ensures that the named secret is absent from the given namespace. name The name of the secret namespace The name of the namespace ''' ret = {'name': name, 'changes': {}, 'result': False, ...
def secret_present( name, namespace='default', data=None, source=None, template=None, **kwargs): ''' Ensures that the named secret is present inside of the specified namespace with the given data. If the secret exists it will be replaced. name ...
def configmap_absent(name, namespace='default', **kwargs): ''' Ensures that the named configmap is absent from the given namespace. name The name of the configmap namespace The namespace holding the configmap. The 'default' one is going to be used unless a different one is spec...
def configmap_present( name, namespace='default', data=None, source=None, template=None, **kwargs): ''' Ensures that the named configmap is present inside of the specified namespace with the given data. If the configmap exists it will be replaced. nam...
def pod_absent(name, namespace='default', **kwargs): ''' Ensures that the named pod is absent from the given namespace. name The name of the pod namespace The name of the namespace ''' ret = {'name': name, 'changes': {}, 'result': False, 'comme...
def pod_present( name, namespace='default', metadata=None, spec=None, source='', template='', **kwargs): ''' Ensures that the named pod is present inside of the specified namespace with the given metadata and spec. If the pod exists it will be repl...
def node_label_absent(name, node, **kwargs): ''' Ensures that the named label is absent from the node. name The name of the label node The name of the node ''' ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''} labels = __...
def node_label_folder_absent(name, node, **kwargs): ''' Ensures the label folder doesn't exist on the specified node. name The name of label folder node The name of the node ''' ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''...
def node_label_present( name, node, value, **kwargs): ''' Ensures that the named label is set on the named node with the given value. If the label exists it will be replaced. name The name of the label. value Value of the label. node ...
def init(opts): ''' This function gets called when the proxy starts up. For login the protocol and port are cached. ''' log.debug('Initting esxvm proxy module in process %s', os.getpid()) log.debug('Validating esxvm proxy input') proxy_conf = merge(opts.get('proxy', {}), __pillar__.get('prox...
def find_credentials(): ''' Cycle through all the possible credentials and return the first one that works. ''' # if the username and password were already found don't go through the # connection process again if 'username' in DETAILS and 'password' in DETAILS: return DETAILS['usern...
def multipath_flush(device): ''' Device-Mapper Multipath flush CLI Example: .. code-block:: bash salt '*' devmap.multipath_flush mpath1 ''' if not os.path.exists(device): return '{0} does not exist'.format(device) cmd = 'multipath -f {0}'.format(device) return __salt_...
def set_file(name, source, template=None, context=None, defaults=None, **kwargs): ''' Set debconf selections from a file or a template .. code-block:: yaml <state_id>: debconf.set_file: - source: salt://pathto/pkg.selections <state_id>: debconf.set_file: ...
def set(name, data, **kwargs): ''' Set debconf selections .. code-block:: yaml <state_id>: debconf.set: - name: <name> - data: <question>: {'type': <type>, 'value': <value>} <question>: {'type': <type>, 'value': <value>} <s...
def start(docker_url='unix://var/run/docker.sock', timeout=CLIENT_TIMEOUT, tag='salt/engines/docker_events', filters=None): ''' Scan for Docker events and fire events Example Config .. code-block:: yaml engines: - docker_events: docker_url...
def _get_config(**api_opts): ''' Return configuration user passed api_opts override salt config.get vars ''' config = { 'api_sslverify': True, 'api_url': 'https://INFOBLOX/wapi/v1.2.1', 'api_user': '', 'api_key': '', } if '__salt__' in globals(): confi...
def update_host(name, data, **api_opts): ''' Update host record. This is a helper call to update_object. Find a hosts ``_ref`` then call update_object with the record data. CLI Example: .. code-block:: bash salt-call infoblox.update_host name=fqdn data={} ''' o = get_host(name=na...
def update_object(objref, data, **api_opts): ''' Update raw infoblox object. This is a low level api call. CLI Example: .. code-block:: bash salt-call infoblox.update_object objref=[ref_of_object] data={} ''' if '__opts__' in globals() and __opts__['test']: return {'Test': 'Wo...
def delete_object(objref, **api_opts): ''' Delete infoblox object. This is a low level api call. CLI Example: .. code-block:: bash salt-call infoblox.delete_object objref=[ref_of_object] ''' if '__opts__' in globals() and __opts__['test']: return {'Test': 'Would attempt to del...
def create_object(object_type, data, **api_opts): ''' Create raw infoblox object. This is a low level api call. CLI Example: .. code-block:: bash salt-call infoblox.update_object object_type=record:host data={} ''' if '__opts__' in globals() and __opts__['test']: return {'Tes...
def get_object(objref, data=None, return_fields=None, max_results=None, ensure_none_or_one_result=False, **api_opts): ''' Get raw infoblox object. This is a low level api call. CLI Example: .. code-block:: bash salt-call infoblox.get_object objref=[_ref of object] ''' i...
def create_cname(data, **api_opts): ''' Create a cname record. CLI Example: .. code-block:: bash salt-call infoblox.create_cname data={ \ "comment": "cname to example server", \ "name": "example.example.com", \ "zone": "example.com", \ "view": "...
def get_cname(name=None, canonical=None, return_fields=None, **api_opts): ''' Get CNAME information. CLI Examples: .. code-block:: bash salt-call infoblox.get_cname name=example.example.com salt-call infoblox.get_cname canonical=example-ha-0.example.com ''' infoblox = _get_inf...
def update_cname(name, data, **api_opts): ''' Update CNAME. This is a helper call to update_object. Find a CNAME ``_ref`` then call update_object with the record data. CLI Example: .. code-block:: bash salt-call infoblox.update_cname name=example.example.com data="{ 'cano...
def delete_cname(name=None, canonical=None, **api_opts): ''' Delete CNAME. This is a helper call to delete_object. If record is not found, return True CLI Examples: .. code-block:: bash salt-call infoblox.delete_cname name=example.example.com salt-call infoblox.delete_cname canon...
def get_host(name=None, ipv4addr=None, mac=None, return_fields=None, **api_opts): ''' Get host information CLI Examples: .. code-block:: bash salt-call infoblox.get_host hostname.domain.ca salt-call infoblox.get_host ipv4addr=123.123.122.12 salt-call infoblox.get_host mac=00:5...
def get_host_advanced(name=None, ipv4addr=None, mac=None, **api_opts): ''' Get all host information CLI Example: .. code-block:: bash salt-call infoblox.get_host_advanced hostname.domain.ca ''' infoblox = _get_infoblox(**api_opts) host = infoblox.get_host_advanced(name=name, mac=m...
def get_host_domainname(name, domains=None, **api_opts): ''' Get host domain name If no domains are passed, the hostname is checked for a zone in infoblox, if no zone split on first dot. If domains are provided, the best match out of the list is returned. If none are found the return is None ...
def get_host_hostname(name, domains=None, **api_opts): ''' Get hostname If no domains are passed, the hostname is checked for a zone in infoblox, if no zone split on first dot. If domains are provided, the best match out of the list is truncated from the fqdn leaving the hostname. If no m...
def get_host_mac(name=None, allow_array=False, **api_opts): ''' Get mac address from host record. Use `allow_array` to return possible multiple values. CLI Example: .. code-block:: bash salt-call infoblox.get_host_mac host=localhost.domain.com ''' data = get_host(name=name, **api...
def get_host_ipv4(name=None, mac=None, allow_array=False, **api_opts): ''' Get ipv4 address from host record. Use `allow_array` to return possible multiple values. CLI Examples: .. code-block:: bash salt-call infoblox.get_host_ipv4 host=localhost.domain.com salt-call infoblox.get...
def get_host_ipv4addr_info(ipv4addr=None, mac=None, discovered_data=None, return_fields=None, **api_opts): ''' Get host ipv4addr information CLI Examples: .. code-block:: bash salt-call infoblox.get_ipv4addr ipv4a...
def get_host_ipv6addr_info(ipv6addr=None, mac=None, discovered_data=None, return_fields=None, **api_opts): ''' Get host ipv6addr information CLI Example: .. code-block:: bash salt-call infoblox.get_host_ipv6addr_i...
def get_network(ipv4addr=None, network=None, return_fields=None, **api_opts): ''' Get list of all networks. This is helpful when looking up subnets to use with func:nextavailableip This call is offen slow and not cached! some return_fields comment,network,network_view,ddns_domainname,disable,e...
def delete_host(name=None, mac=None, ipv4addr=None, **api_opts): ''' Delete host CLI Example: .. code-block:: bash salt-call infoblox.delete_host name=example.domain.com salt-call infoblox.delete_host ipv4addr=123.123.122.12 salt-call infoblox.delete_host ipv4addr=123.123.122....
def get_ipv4_range(start_addr=None, end_addr=None, return_fields=None, **api_opts): ''' Get ip range CLI Example: .. code-block:: bash salt-call infoblox.get_ipv4_range start_addr=123.123.122.12 ''' infoblox = _get_infoblox(**api_opts) return infoblox.get_range(start_addr, end_add...
def delete_ipv4_range(start_addr=None, end_addr=None, **api_opts): ''' Delete ip range. CLI Example: .. code-block:: bash salt-call infoblox.delete_ipv4_range start_addr=123.123.122.12 ''' r = get_ipv4_range(start_addr, end_addr, **api_opts) if r: return delete_object(r['_...
def get_a(name=None, ipv4addr=None, allow_array=True, **api_opts): ''' Get A record CLI Examples: .. code-block:: bash salt-call infoblox.get_a name=abc.example.com salt-call infoblox.get_a ipv4addr=192.168.3.5 ''' data = {} if name: data['name'] = name if ipv4...
def delete_a(name=None, ipv4addr=None, allow_array=False, **api_opts): ''' Delete A record If the A record is used as a round robin you can set ``allow_array=True`` to delete all records for the hostname. CLI Examples: .. code-block:: bash salt-call infoblox.delete_a name=abc.example...
def present(name=None, ipv4addr=None, data=None, ensure_data=True, **api_opts): ''' Ensure infoblox A record. When you wish to update a hostname ensure `name` is set to the hostname of the current record. You can give a new name in the `data.name`. State example: .. code-block:: yaml ...
def absent(name=None, ipv4addr=None, **api_opts): ''' Ensure infoblox A record is removed. State example: .. code-block:: yaml infoblox_a.absent: - name: example-ha-0.domain.com infoblox_a.absent: - name: - ipv4addr: 127.0.23.23 ''' ret = {...
def _get_url(): ''' Get the kapacitor URL. ''' protocol = __salt__['config.option']('kapacitor.protocol', 'http') host = __salt__['config.option']('kapacitor.host', 'localhost') port = __salt__['config.option']('kapacitor.port', 9092) return '{0}://{1}:{2}'.format(protocol, host, port)
def get_task(name): ''' Get a dict of data on a task. name Name of the task to get information about. CLI Example: .. code-block:: bash salt '*' kapacitor.get_task cpu ''' url = _get_url() if version() < '0.13': task_url = '{0}/task?name={1}'.format(url, name...
def _run_cmd(cmd): ''' Run a Kapacitor task and return a dictionary of info. ''' ret = {} env_vars = { 'KAPACITOR_URL': _get_url(), 'KAPACITOR_UNSAFE_SSL': __salt__['config.option']('kapacitor.unsafe_ssl', 'false'), } result = __salt__['cmd.run_all'](cmd, env=env_vars) i...
def define_task(name, tick_script, task_type='stream', database=None, retention_policy='default', dbrps=None): ''' Define a task. Serves as both create/update. name Name of the task. tick_script Path to the...
def _ip_ifaces(): ''' Parse output from 'ip a' ''' tmp = {} ret = {} if_ = None at_ = None out = __salt__['cmd.run']('ip a') for line in out.splitlines(): if not line.startswith(' '): comps = line.split(':') if_ = comps[1].strip() opts_comp...
def _parse_routes(): ''' Parse the contents of ``/proc/net/route`` ''' with salt.utils.files.fopen('/proc/net/route', 'r') as fp_: out = salt.utils.stringutils.to_unicode(fp_.read()) ret = {} for line in out.splitlines(): tmp = {} if not line.strip(): continu...
def _hex_to_octets(addr): ''' Convert hex fields from /proc/net/route to octects ''' return '{0}:{1}:{2}:{3}'.format( int(addr[6:8], 16), int(addr[4:6], 16), int(addr[2:4], 16), int(addr[0:2], 16), )
def _route_flags(rflags): ''' https://github.com/torvalds/linux/blob/master/include/uapi/linux/route.h https://github.com/torvalds/linux/blob/master/include/uapi/linux/ipv6_route.h ''' flags = '' fmap = { 0x0001: 'U', # RTF_UP, route is up 0x0002: 'G', # RTF_GATEWAY, use gatewa...
def _get_state(): ''' Returns the state of connman ''' try: return pyconnman.ConnManager().get_property('State') except KeyError: return 'offline' except dbus.DBusException as exc: raise salt.exceptions.CommandExecutionError('Connman daemon error: {0}'.format(exc))
def _get_technologies(): ''' Returns the technologies of connman ''' tech = '' technologies = pyconnman.ConnManager().get_technologies() for path, params in technologies: tech += '{0}\n\tName = {1}\n\tType = {2}\n\tPowered = {3}\n\tConnected = {4}\n'.format( path, params['Nam...
def _get_services(): ''' Returns a list with all connman services ''' serv = [] services = pyconnman.ConnManager().get_services() for path, _ in services: serv.append(six.text_type(path[len(SERVICE_PATH):])) return serv
def _connected(service): ''' Verify if a connman service is connected ''' state = pyconnman.ConnService(os.path.join(SERVICE_PATH, service)).get_property('State') return state == 'online' or state == 'ready'
def _space_delimited_list(value): ''' validate that a value contains one or more space-delimited values ''' if isinstance(value, six.string_types): items = value.split(' ') valid = items and all(items) else: valid = hasattr(value, '__iter__') and (value != []) if valid: ...
def _validate_ipv4(value): ''' validate ipv4 values ''' if len(value) == 3: if not salt.utils.validate.net.ipv4_addr(value[0].strip()): return False, 'Invalid ip address: {0} for ipv4 option'.format(value[0]) if not salt.utils.validate.net.netmask(value[1].strip()): ...
def _interface_to_service(iface): ''' returns the coresponding service to given interface if exists, otherwise return None ''' for _service in _get_services(): service_info = pyconnman.ConnService(os.path.join(SERVICE_PATH, _service)) if service_info.get_property('Ethernet')['Interface']...
def _get_service_info(service): ''' return details about given connman service ''' service_info = pyconnman.ConnService(os.path.join(SERVICE_PATH, service)) data = { 'label': service, 'wireless': service_info.get_property('Type') == 'wifi', 'connectionid': six.text_type(servi...
def _get_dns_info(): ''' return dns list ''' dns_list = [] try: with salt.utils.files.fopen('/etc/resolv.conf', 'r+') as dns_info: lines = dns_info.readlines() for line in lines: if 'nameserver' in line: dns = line.split()[1].strip(...
def _load_config(section, options, default_value='', filename=INI_FILE): ''' Get values for some options and a given section from a config file. :param section: Section Name :param options: List of options :param default_value: Default value if an option doesn't have a value. Default is empty strin...
def _get_request_mode_info(interface): ''' return requestmode for given interface ''' settings = _load_config(interface, ['linklocalenabled', 'dhcpenabled'], -1) link_local_enabled = int(settings['linklocalenabled']) dhcp_enabled = int(settings['dhcpenabled']) if dhcp_enabled == 1: ...
def _get_possible_adapter_modes(interface, blacklist): ''' Return possible adapter modes for a given interface using a blacklist. :param interface: interface name :param blacklist: given blacklist :return: list of possible adapter modes ''' adapter_modes = [] protocols = _load_config('l...
def _get_static_info(interface): ''' Return information about an interface from config file. :param interface: interface label ''' data = { 'connectionid': interface.name, 'label': interface.name, 'hwaddr': interface.hwaddr[:-1], 'up': False, 'ipv4': { ...
def _get_base_interface_info(interface): ''' return base details about given interface ''' blacklist = { 'tcpip': { 'name': [], 'type': [], 'additional_protocol': False }, 'disabled': { 'name': ['eth0'], 'type': ['gadget...
def _get_ethercat_interface_info(interface): ''' return details about given ethercat interface ''' base_information = _get_base_interface_info(interface) base_information['ethercat'] = { 'masterid': _load_config(interface.name, ['MasterID'])['MasterID'] } return base_information
def _get_tcpip_interface_info(interface): ''' return details about given tcpip interface ''' base_information = _get_base_interface_info(interface) if base_information['ipv4']['requestmode'] == 'static': settings = _load_config(interface.name, ['IP_Address', 'Subnet_Mask', 'Gateway', 'DNS_Ad...
def _get_interface_info(interface): ''' return details about given interface ''' adapter_mode = _get_adapter_mode_info(interface.name) if adapter_mode == 'disabled': return _get_base_interface_info(interface) elif adapter_mode == 'ethercat': return _get_ethercat_interface_info(in...
def _dict_to_string(dictionary): ''' converts a dictionary object into a list of strings ''' ret = '' for key, val in sorted(dictionary.items()): if isinstance(val, dict): for line in _dict_to_string(val): ret += six.text_type(key) + '-' + line + '\n' elif...
def get_interfaces_details(): ''' Get details about all the interfaces on the minion :return: information about all interfaces omitting loopback :rtype: dictionary CLI Example: .. code-block:: bash salt '*' ip.get_interfaces_details ''' _interfaces = [interface for interface ...
def _change_state_legacy(interface, new_state): ''' Enable or disable an interface on a legacy distro Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param interface: interface label :param new_state: up or down :return: True if the service w...
def _change_state(interface, new_state): ''' Enable or disable an interface Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param interface: interface label :param new_state: up or down :return: True if the service was enabled, otherwise an e...
def _save_config(section, token, value): ''' Helper function to persist a configuration in the ini file ''' cmd = NIRTCFG_PATH cmd += ' --set section={0},token=\'{1}\',value=\'{2}\''.format(section, token, value) if __salt__['cmd.run_all'](cmd)['retcode'] != 0: exc_msg = 'Error: could no...
def set_ethercat(interface, master_id): ''' Configure specified adapter to use EtherCAT adapter mode. If successful, the target will need reboot if it doesn't already use EtherCAT adapter mode, otherwise will return true. :param interface: interface label :param master_id: EtherCAT Master ID :r...
def set_dhcp_linklocal_all(interface): ''' Configure specified adapter to use DHCP with linklocal fallback Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param str interface: interface label :return: True if the settings were applied, otherwise ...
def set_dhcp_only_all(interface): ''' Configure specified adapter to use DHCP only Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param str interface: interface label :return: True if the settings were applied, otherwise an exception will be thr...
def _configure_static_interface(interface, **settings): ''' Configure an interface that is not detected as a service by Connman (i.e. link is down) :param interface: interface label :param settings: - ip - netmask - gateway - dns - name :r...
def set_static_all(interface, address, netmask, gateway, nameservers=None): ''' Configure specified adapter to use ipv4 manual settings Change adapter mode to TCP/IP. If previous adapter mode was EtherCAT, the target will need reboot. :param str interface: interface label :param str address: ipv4 ...
def get_interface(iface): ''' Returns details about given interface. CLI Example: .. code-block:: bash salt '*' ip.get_interface eth0 ''' _interfaces = get_interfaces_details() for _interface in _interfaces['interfaces']: if _interface['connectionid'] == iface: ...
def build_interface(iface, iface_type, enabled, **settings): ''' Build an interface script for a network interface. CLI Example: .. code-block:: bash salt '*' ip.build_interface eth0 eth <settings> ''' if __grains__['lsb_distrib_id'] == 'nilrt': raise salt.exceptions.CommandEx...