Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated options from netconf_config #183

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ venv.bak/
/site

# mypy
.mypy_cache/
.mypy_cache/
2 changes: 2 additions & 0 deletions changelogs/fragments/remove-netconf_config-args.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
major_changes:
- Remove deprecated connection arguments from netconf_config
147 changes: 0 additions & 147 deletions docs/ansible.netcommon.netconf_config_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -281,40 +281,6 @@ Parameters
<div>This argument specifies the XML string which acts as a filter to restrict the portions of the data retrieved from the remote device when comparing the before and after state of the device following calls to edit_config. When not specified, the entire configuration or state data is returned for comparison depending on the value of <code>source</code> option. The <code>get_filter</code> value can be either XML string or XPath or JSON string or native python dictionary, if the filter is in XPath format the NETCONF server running on remote host should support xpath capability else it will result in an error.</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>host</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div>Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport.</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>hostkey_verify</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li>no</li>
<li><div style="color: blue"><b>yes</b>&nbsp;&larr;</div></li>
</ul>
</td>
<td>
<div>If set to <code>yes</code>, the ssh host key of the device must match a ssh key present on the host if set to <code>no</code>, the ssh host key of the device is not checked.</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
Expand All @@ -335,56 +301,6 @@ Parameters
<div>Instructs the module to explicitly lock the datastore specified as <code>target</code>. By setting the option value <em>always</em> is will explicitly lock the datastore mentioned in <code>target</code> option. It the value is <em>never</em> it will not lock the <code>target</code> datastore. The value <em>if-supported</em> lock the <code>target</code> datastore only if it is supported by the remote Netconf server.</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>look_for_keys</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li>no</li>
<li><div style="color: blue"><b>yes</b>&nbsp;&larr;</div></li>
</ul>
</td>
<td>
<div>Enables looking in the usual locations for the ssh keys (e.g. :file:`~/.ssh/id_*`)</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>password</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div>Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable <code>ANSIBLE_NET_PASSWORD</code> will be used instead.</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>port</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">integer</span>
</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">830</div>
</td>
<td>
<div>Specifies the port to use when building the connection to the remote device. The port value will default to port 830.</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
Expand Down Expand Up @@ -420,36 +336,6 @@ Parameters
<div style="font-size: small; color: darkgreen"><br/>aliases: source</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>src</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">path</span>
</div>
</td>
<td>
</td>
<td>
<div>Specifies the source path to the xml file that contains the configuration or configuration template to load. The path to the source file can either be the full path on the Ansible control host or a relative path from the playbook or role root directory. This argument is mutually exclusive with <em>xml</em>.</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>ssh_keyfile</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">path</span>
</div>
</td>
<td>
</td>
<td>
<div>Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable <code>ANSIBLE_NET_SSH_KEYFILE</code> will be used instead.</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
Expand All @@ -471,37 +357,6 @@ Parameters
<div style="font-size: small; color: darkgreen"><br/>aliases: datastore</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>timeout</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">integer</span>
</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">10</div>
</td>
<td>
<div>Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error.</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>username</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div>Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable <code>ANSIBLE_NET_USERNAME</code> will be used instead.</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
Expand Down Expand Up @@ -532,8 +387,6 @@ Notes
- This module requires the netconf system service be enabled on the remote device being managed.
- This module supports devices with and without the candidate and confirmed-commit capabilities. It will always use the safer feature.
- This module supports the use of connection=netconf
- For information on using netconf see the :ref:`Platform Options guide using Netconf<netconf_enabled_platform_options>`
- For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>`
- This module is supported on ``ansible_network_os`` network platforms. See the :ref:`Network Platform Options <platform_options>` for details.


Expand Down
68 changes: 0 additions & 68 deletions plugins/doc_fragments/netconf.py

This file was deleted.

72 changes: 4 additions & 68 deletions plugins/modules/netconf_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
and detects if there was a configuration change.
version_added: 1.0.0
extends_documentation_fragment:
- ansible.netcommon.netconf
- ansible.netcommon.network_agnostic
options:
content:
Expand Down Expand Up @@ -167,13 +166,6 @@
capability.
type: bool
default: false
src:
description:
- Specifies the source path to the xml file that contains the configuration or
configuration template to load. The path to the source file can either be the
full path on the Ansible control host or a relative path from the playbook or
role root directory. This argument is mutually exclusive with I(xml).
type: path
backup_options:
description:
- This is a dict object containing configurable options related to backup file
Expand Down Expand Up @@ -399,7 +391,7 @@
"""

from ansible.module_utils._text import to_text
from ansible.module_utils.basic import AnsibleModule, env_fallback
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.connection import Connection, ConnectionError
from ansible_collections.ansible.netcommon.plugins.module_utils.utils.data import (
validate_and_normalize_data,
Expand Down Expand Up @@ -468,67 +460,11 @@ def main():
get_filter=dict(type="raw"),
)

# deprecated options
netconf_top_spec = {
"src": dict(
type="path",
removed_at_date="2020-12-01",
removed_from_collection="ansible.netcommon",
),
"host": dict(
removed_at_date="2020-12-01",
removed_from_collection="ansible.netcommon",
),
"port": dict(
removed_at_date="2020-12-01",
removed_from_collection="ansible.netcommon",
type="int",
default=830,
),
"username": dict(
fallback=(env_fallback, ["ANSIBLE_NET_USERNAME"]),
removed_at_date="2020-12-01",
removed_from_collection="ansible.netcommon",
no_log=True,
),
"password": dict(
fallback=(env_fallback, ["ANSIBLE_NET_PASSWORD"]),
removed_at_date="2020-12-01",
removed_from_collection="ansible.netcommon",
no_log=True,
),
"ssh_keyfile": dict(
fallback=(env_fallback, ["ANSIBLE_NET_SSH_KEYFILE"]),
removed_at_date="2020-12-01",
removed_from_collection="ansible.netcommon",
type="path",
),
"hostkey_verify": dict(
removed_at_date="2020-12-01",
removed_from_collection="ansible.netcommon",
type="bool",
default=True,
),
"look_for_keys": dict(
removed_at_date="2020-12-01",
removed_from_collection="ansible.netcommon",
type="bool",
default=True,
),
"timeout": dict(
removed_at_date="2020-12-01",
removed_from_collection="ansible.netcommon",
type="int",
default=10,
),
}
argument_spec.update(netconf_top_spec)

mutually_exclusive = [
("content", "src", "source_datastore", "delete", "confirm_commit")
("content", "source_datastore", "delete", "confirm_commit")
]
required_one_of = [
("content", "src", "source_datastore", "delete", "confirm_commit")
("content", "source_datastore", "delete", "confirm_commit")
]

module = AnsibleModule(
Expand All @@ -538,7 +474,7 @@ def main():
supports_check_mode=True,
)

config = module.params["content"] or module.params["src"]
config = module.params["content"]
target = module.params["target"]
lock = module.params["lock"]
source = module.params["source_datastore"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
ansible.netcommon.cli_config:
config: restconf
vars:
ansible_network_os: cisco.ios.ios
ansible_network_os: cisco.ios.ios
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Last reset
plugin
Core Plugin, Ethernet Plugin

Active Package(s):
Active Package(s):
Loading