Saltstack module iosconfig 详解

iosconfig.diff_text

Return the diff, as text, between the candidate and the running config.

candidate_config
    The candidate configuration sent as text. This argument is ignored when
    ``candidate_path`` is set.

candidate_path
    Absolute or remote path from where to load the candidate configuration
    text. This argument allows any URI supported by
    :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
    ``https://``, ``s3://``, ``ftp:/``, etc.

running_config
    The running configuration sent as text. This argument is ignored when
    ``running_path`` is set.

running_path
    Absolute or remote path from where to load the runing configuration
    text. This argument allows any URI supported by
    :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
    ``https://``, ``s3://``, ``ftp:/``, etc.

saltenv: ``base``
    Salt fileserver environment from which to retrieve the file.
    Ignored if ``candidate_path`` or ``running_path`` is not a
    ``salt://`` URL.

CLI Example:

    salt ‘*‘ iosconfig.diff_text candidate_path=salt://path/to/candidate.cfg running_path=salt://path/to/running.cfg

iosconfig.merge_tree

Return the merge tree of the ``initial_config`` with the ``merge_config``,
as a Python dictionary.

initial_config
    The initial configuration sent as text. This argument is ignored when
    ``initial_path`` is set.

initial_path
    Absolute or remote path from where to load the initial configuration
    text. This argument allows any URI supported by
    :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
    ``https://``, ``s3://``, ``ftp:/``, etc.

merge_config
    The config to be merged into the initial config, sent as text. This
    argument is ignored when ``merge_path`` is set.

merge_path
    Absolute or remote path from where to load the merge configuration
    text. This argument allows any URI supported by
    :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
    ``https://``, ``s3://``, ``ftp:/``, etc.

saltenv: ``base``
    Salt fileserver environment from which to retrieve the file.
    Ignored if ``initial_path`` or ``merge_path`` is not a ``salt://`` URL.

CLI Example:

    salt ‘*‘ iosconfig.merge_tree initial_path=salt://path/to/running.cfg merge_path=salt://path/to/merge.cfg

iosconfig.diff_tree

Return the diff, as Python dictionary, between the candidate and the running
configuration.

candidate_config
    The candidate configuration sent as text. This argument is ignored when
    ``candidate_path`` is set.

candidate_path
    Absolute or remote path from where to load the candidate configuration
    text. This argument allows any URI supported by
    :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
    ``https://``, ``s3://``, ``ftp:/``, etc.

running_config
    The running configuration sent as text. This argument is ignored when
    ``running_path`` is set.

running_path
    Absolute or remote path from where to load the runing configuration
    text. This argument allows any URI supported by
    :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
    ``https://``, ``s3://``, ``ftp:/``, etc.

saltenv: ``base``
    Salt fileserver environment from which to retrieve the file.
    Ignored if ``candidate_path`` or ``running_path`` is not a
    ``salt://`` URL.

CLI Example:

    salt ‘*‘ iosconfig.diff_tree candidate_path=salt://path/to/candidate.cfg running_path=salt://path/to/running.cfg

iosconfig.merge_text

Return the merge result of the ``initial_config`` with the ``merge_config``,
as plain text.

initial_config
    The initial configuration sent as text. This argument is ignored when
    ``initial_path`` is set.

initial_path
    Absolute or remote path from where to load the initial configuration
    text. This argument allows any URI supported by
    :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
    ``https://``, ``s3://``, ``ftp:/``, etc.

merge_config
    The config to be merged into the initial config, sent as text. This
    argument is ignored when ``merge_path`` is set.

merge_path
    Absolute or remote path from where to load the merge configuration
    text. This argument allows any URI supported by
    :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
    ``https://``, ``s3://``, ``ftp:/``, etc.

saltenv: ``base``
    Salt fileserver environment from which to retrieve the file.
    Ignored if ``initial_path`` or ``merge_path`` is not a ``salt://`` URL.

CLI Example:

    salt ‘*‘ iosconfig.merge_text initial_path=salt://path/to/running.cfg merge_path=salt://path/to/merge.cfg

iosconfig.clean

Return a clean version of the config, without any special signs (such as
``!`` as an individual line) or empty lines, but just lines with significant
value in the configuration of the network device.

config
    The configuration sent as text. This argument is ignored when ``path``
    is configured.

path
    Absolute or remote path from where to load the configuration text. This
    argument allows any URI supported by
    :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
    ``https://``, ``s3://``, ``ftp:/``, etc.

saltenv: ``base``
    Salt fileserver environment from which to retrieve the file.
    Ignored if ``path`` is not a ``salt://`` URL.

CLI Example:

    salt ‘*‘ iosconfig.clean path=salt://path/to/my/config.txt
    salt ‘*‘ iosconfig.clean path=https://bit.ly/2mAdq7z

iosconfig.tree

Transform Cisco IOS style configuration to structured Python dictionary.
Depending on the value of the ``with_tags`` argument, this function may
provide different views, valuable in different situations.

config
    The configuration sent as text. This argument is ignored when ``path``
    is configured.

path
    Absolute or remote path from where to load the configuration text. This
    argument allows any URI supported by
    :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
    ``https://``, ``s3://``, ``ftp:/``, etc.

with_tags: ``False``
    Whether this function should return a detailed view, with tags.

saltenv: ``base``
    Salt fileserver environment from which to retrieve the file.
    Ignored if ``path`` is not a ``salt://`` URL.

CLI Example:

    salt ‘*‘ iosconfig.tree path=salt://path/to/my/config.txt
    salt ‘*‘ iosconfig.tree path=https://bit.ly/2mAdq7z

iosconfig.merge_diff

Return the merge diff, as text, after merging the merge config into the
initial config.

initial_config
    The initial configuration sent as text. This argument is ignored when
    ``initial_path`` is set.

initial_path
    Absolute or remote path from where to load the initial configuration
    text. This argument allows any URI supported by
    :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
    ``https://``, ``s3://``, ``ftp:/``, etc.

merge_config
    The config to be merged into the initial config, sent as text. This
    argument is ignored when ``merge_path`` is set.

merge_path
    Absolute or remote path from where to load the merge configuration
    text. This argument allows any URI supported by
    :py:func:`cp.get_url <salt.modules.cp.get_url>`), e.g., ``salt://``,
    ``https://``, ``s3://``, ``ftp:/``, etc.

saltenv: ``base``
    Salt fileserver environment from which to retrieve the file.
    Ignored if ``initial_path`` or ``merge_path`` is not a ``salt://`` URL.

CLI Example:

    salt ‘*‘ iosconfig.merge_diff initial_path=salt://path/to/running.cfg merge_path=salt://path/to/merge.cfg

原文地址:https://www.cnblogs.com/randomlee/p/Saltstack_module_iosconfig.html

时间: 2024-08-30 15:12:28

Saltstack module iosconfig 详解的相关文章

Saltstack module highstate_doc 详解

highstate_doc.read_file output the contents of a file: this is a workaround if the cp.push module does not work. https://github.com/saltstack/salt/issues/37133 help the master output the contents of a document that might be saved on the minions files

Saltstack module artifactory 详解

artifactory.get_latest_snapshot Gets latest snapshot of the given artifact artifactory_url URL of artifactory instance repository Snapshot repository in artifactory to retrieve artifact from, for example: libs-snapshots group_id Group Id of the artif

Saltstack module introspect 详解

introspect.service_highstate Return running and enabled services in a highstate structure. By default also returns package dependencies for those services, which means that package definitions must be created outside this function. To drop the packag

Saltstack module inspector 详解

inspector.query Query the node for specific information. Parameters: * **scope**: Specify scope of the query. * **System**: Return system data. * **Software**: Return software information. * **Services**: Return known services. * **Identity**: Return

Saltstack module http 详解

http.query New in version 2015.5.0 Query a resource, and decode the return data Passes through all the parameters described in the :py:func:`utils.http.query function <salt.utils.http.query>`: .. autofunction:: salt.utils.http.query raise_error : Tr

Saltstack module ini 详解

ini.remove_option Remove a key/value pair from a section in an ini file. Returns the value of the removed key, or ``None`` if nothing was removed. API Example: import salt sc = salt.client.get_local_client() sc.cmd('target', 'ini.remove_option', [pat

Saltstack module glassfish 详解

glassfish.update_connector_c_pool Update a connection pool glassfish.update_jdbc_resource Update a JDBC resource glassfish.enum_connector_resource Enum connection resources glassfish.delete_jdbc_resource Delete a JDBC resource glassfish.enum_connecto

Saltstack module grafana4 详解

grafana4.get_org Show a single organization. name Name of the organization. profile Configuration profile used to connect to the Grafana instance. Default is 'grafana'. CLI Example: salt '*' grafana4.get_org <name> grafana4.delete_user Delete a user

Saltstack module genesis 详解

genesis.mksls Convert an installation file/script to an SLS file. Currently supports ``kickstart``, ``preseed``, and ``autoyast``. CLI Examples: salt <minion> genesis.mksls kickstart /path/to/kickstart.cfg salt <minion> genesis.mksls kickstart