diff options
author | Kate Case <kcase@redhat.com> | 2022-10-13 13:11:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-13 13:11:19 -0400 |
commit | 5c6a97ae5052684aed513427f81dc1da96c094e3 (patch) | |
tree | 62cf80483b7f46551fec0bbcc7f5c5b50db1b2a5 | |
parent | 7712afd90de9a2b4f6d91f3fbea77de20d6ed40e (diff) | |
download | vyos.vyos-5c6a97ae5052684aed513427f81dc1da96c094e3.tar.gz vyos.vyos-5c6a97ae5052684aed513427f81dc1da96c094e3.zip |
Remove deprecated modules and provider (#277)
* Remove deprecated modules and provider
* Remove tests for removed modules
* Remove references to vyos_argument_spec
74 files changed, 46 insertions, 7584 deletions
@@ -44,15 +44,10 @@ Name | Description [vyos.vyos.vyos_firewall_interfaces](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_firewall_interfaces_module.rst)|FIREWALL interfaces resource module [vyos.vyos.vyos_firewall_rules](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_firewall_rules_module.rst)|FIREWALL rules resource module [vyos.vyos.vyos_hostname](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_hostname_module.rst)|Manages hostname resource module -[vyos.vyos.vyos_interface](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_interface_module.rst)|(deprecated, removed after 2022-06-01) Manage Interface on VyOS network devices [vyos.vyos.vyos_interfaces](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_interfaces_module.rst)|Interfaces resource module -[vyos.vyos.vyos_l3_interface](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_l3_interface_module.rst)|(deprecated, removed after 2022-06-01) Manage L3 interfaces on VyOS network devices [vyos.vyos.vyos_l3_interfaces](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_l3_interfaces_module.rst)|L3 interfaces resource module [vyos.vyos.vyos_lag_interfaces](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_lag_interfaces_module.rst)|LAG interfaces resource module -[vyos.vyos.vyos_linkagg](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_linkagg_module.rst)|(deprecated, removed after 2022-06-01) Manage link aggregation groups on VyOS network devices -[vyos.vyos.vyos_lldp](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_lldp_module.rst)|(deprecated, removed after 2022-06-01) Manage LLDP configuration on VyOS network devices [vyos.vyos.vyos_lldp_global](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_lldp_global_module.rst)|LLDP global resource module -[vyos.vyos.vyos_lldp_interface](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_lldp_interface_module.rst)|(deprecated, removed after 2022-06-01) Manage LLDP interfaces configuration on VyOS network devices [vyos.vyos.vyos_lldp_interfaces](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_lldp_interfaces_module.rst)|LLDP interfaces resource module [vyos.vyos.vyos_logging](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_logging_module.rst)|Manage logging on network devices [vyos.vyos.vyos_logging_global](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_logging_global_module.rst)|Logging resource module @@ -64,7 +59,6 @@ Name | Description [vyos.vyos.vyos_prefix_lists](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_prefix_lists_module.rst)|Prefix-Lists resource module for VyOS [vyos.vyos.vyos_route_maps](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_route_maps_module.rst)|Route Map Resource Module. [vyos.vyos.vyos_snmp_server](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_snmp_server_module.rst)|Manages snmp_server resource module -[vyos.vyos.vyos_static_route](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_static_route_module.rst)|(deprecated, removed after 2022-06-01) Manage static IP routes on Vyatta VyOS network devices [vyos.vyos.vyos_static_routes](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_static_routes_module.rst)|Static routes resource module [vyos.vyos.vyos_system](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_system_module.rst)|Run `set system` commands on VyOS devices [vyos.vyos.vyos_user](https://github.com/ansible-collections/vyos.vyos/blob/main/docs/vyos.vyos.vyos_user_module.rst)|Manage the collection of local users on VyOS device diff --git a/changelogs/fragments/2H22-removal.yaml b/changelogs/fragments/2H22-removal.yaml new file mode 100644 index 0000000..04646ca --- /dev/null +++ b/changelogs/fragments/2H22-removal.yaml @@ -0,0 +1,10 @@ +--- +removed_features: + - vyos_interface - use vyos_interfaces instead. + - vyos_l3_interface - use vyos_l3_interfaces instead. + - vyos_linkagg - use vyos_lag_interfaces instead. + - vyos_lldp_interface - use vyos_lldp_interfaces instead. + - vyos_lldp - use vyos_lldp_global instead. + - vyos_static_route - use vyos_static_routes instead. +major_changes: + - "Use of connection: local and the provider option are no longer valid on any modules in this collection." diff --git a/docs/vyos.vyos.vyos_banner_module.rst b/docs/vyos.vyos.vyos_banner_module.rst index f42364a..4a847f7 100644 --- a/docs/vyos.vyos.vyos_banner_module.rst +++ b/docs/vyos.vyos.vyos_banner_module.rst @@ -29,12 +29,12 @@ Parameters <table border=0 cellpadding=0 class="documentation-table"> <tr> - <th colspan="2">Parameter</th> + <th colspan="1">Parameter</th> <th>Choices/<font color="blue">Defaults</font></th> <th width="100%">Comments</th> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>banner</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -54,124 +54,8 @@ Parameters </td> </tr> <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> <td colspan="1"> <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> <b>state</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> <div style="font-size: small"> @@ -189,7 +73,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>text</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> diff --git a/docs/vyos.vyos.vyos_command_module.rst b/docs/vyos.vyos.vyos_command_module.rst index bb79752..c6ce2cc 100644 --- a/docs/vyos.vyos.vyos_command_module.rst +++ b/docs/vyos.vyos.vyos_command_module.rst @@ -30,12 +30,12 @@ Parameters <table border=0 cellpadding=0 class="documentation-table"> <tr> - <th colspan="2">Parameter</th> + <th colspan="1">Parameter</th> <th>Choices/<font color="blue">Defaults</font></th> <th width="100%">Comments</th> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>commands</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -53,7 +53,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>interval</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -69,7 +69,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>match</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -88,124 +88,8 @@ Parameters </td> </tr> <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> <td colspan="1"> <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> <b>retries</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> <div style="font-size: small"> @@ -220,7 +104,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>wait_for</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> diff --git a/docs/vyos.vyos.vyos_config_module.rst b/docs/vyos.vyos.vyos_config_module.rst index ddd1c53..a99e264 100644 --- a/docs/vyos.vyos.vyos_config_module.rst +++ b/docs/vyos.vyos.vyos_config_module.rst @@ -169,122 +169,6 @@ Parameters <tr> <td colspan="2"> <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> <b>save</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> <div style="font-size: small"> diff --git a/docs/vyos.vyos.vyos_facts_module.rst b/docs/vyos.vyos.vyos_facts_module.rst index 66e8498..af39283 100644 --- a/docs/vyos.vyos.vyos_facts_module.rst +++ b/docs/vyos.vyos.vyos_facts_module.rst @@ -29,12 +29,12 @@ Parameters <table border=0 cellpadding=0 class="documentation-table"> <tr> - <th colspan="2">Parameter</th> + <th colspan="1">Parameter</th> <th>Choices/<font color="blue">Defaults</font></th> <th width="100%">Comments</th> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>available_network_resources</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -53,7 +53,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>gather_network_resources</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -69,7 +69,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>gather_subset</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -85,122 +85,6 @@ Parameters <div>When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument include <code>all</code>, <code>default</code>, <code>config</code>, <code>neighbors</code> and <code>min</code>. Can specify a list of values to include a larger subset. Values can also be used with an initial <code>!</code> to specify that a specific subset should not be collected.</div> </td> </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </table> <br/> diff --git a/docs/vyos.vyos.vyos_interface_module.rst b/docs/vyos.vyos.vyos_interface_module.rst deleted file mode 100644 index 6232977..0000000 --- a/docs/vyos.vyos.vyos_interface_module.rst +++ /dev/null @@ -1,684 +0,0 @@ -.. _vyos.vyos.vyos_interface_module: - - -************************ -vyos.vyos.vyos_interface -************************ - -**(deprecated, removed after 2022-06-01) Manage Interface on VyOS network devices** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - -DEPRECATED ----------- -:Removed in collection release after 2022-06-01 -:Why: Updated modules released with more functionality. -:Alternative: vyos_interfaces - - - -Synopsis --------- -- This module provides declarative management of Interfaces on VyOS network devices. - - - - -Parameters ----------- - -.. raw:: html - - <table border=0 cellpadding=0 class="documentation-table"> - <tr> - <th colspan="3">Parameter</th> - <th>Choices/<font color="blue">Defaults</font></th> - <th width="100%">Comments</th> - </tr> - <tr> - <td colspan="3"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>aggregate</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - / <span style="color: purple">elements=dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div>List of Interfaces definitions.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>delay</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> - </td> - <td> - <div>Time in seconds to wait before checking for the operational state on remote device. This wait is applicable for operational state argument which are <em>state</em> with values <code>up</code>/<code>down</code> and <em>neighbors</em>.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>description</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>Description of Interface.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>duplex</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li>full</li> - <li>half</li> - <li>auto</li> - </ul> - </td> - <td> - <div>Interface link status.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>enabled</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>yes</li> - </ul> - </td> - <td> - <div>Interface link status.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>mtu</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> - </td> - <td> - <div>Maximum size of transmit packet.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>name</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">string</span> - / <span style="color: red">required</span> - </div> - </td> - <td> - </td> - <td> - <div>Name of the Interface.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>neighbors</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - / <span style="color: purple">elements=dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div>Check the operational state of given interface <code>name</code> for LLDP neighbor.</div> - <div>The following suboptions are available.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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>LLDP neighbor host for given interface <code>name</code>.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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">string</span> - </div> - </td> - <td> - </td> - <td> - <div>LLDP neighbor port to which given interface <code>name</code> is connected.</div> - </td> - </tr> - - <tr> - <td class="elbow-placeholder"></td> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>speed</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>Interface link speed.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>state</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li>present</li> - <li>absent</li> - <li>up</li> - <li>down</li> - </ul> - </td> - <td> - <div>State of the Interface configuration, <code>up</code> means present and operationally up and <code>down</code> means present and operationally <code>down</code></div> - </td> - </tr> - - <tr> - <td colspan="3"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>delay</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>Time in seconds to wait before checking for the operational state on remote device. This wait is applicable for operational state argument which are <em>state</em> with values <code>up</code>/<code>down</code> and <em>neighbors</em>.</div> - </td> - </tr> - <tr> - <td colspan="3"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>description</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>Description of Interface.</div> - </td> - </tr> - <tr> - <td colspan="3"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>duplex</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li>full</li> - <li>half</li> - <li>auto</li> - </ul> - </td> - <td> - <div>Interface link status.</div> - </td> - </tr> - <tr> - <td colspan="3"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>enabled</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> ←</div></li> - </ul> - </td> - <td> - <div>Interface link status.</div> - </td> - </tr> - <tr> - <td colspan="3"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>mtu</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> - </td> - <td> - <div>Maximum size of transmit packet.</div> - </td> - </tr> - <tr> - <td colspan="3"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>name</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>Name of the Interface.</div> - </td> - </tr> - <tr> - <td colspan="3"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>neighbors</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - / <span style="color: purple">elements=dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div>Check the operational state of given interface <code>name</code> for LLDP neighbor.</div> - <div>The following suboptions are available.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <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>LLDP neighbor host for given interface <code>name</code>.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <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">string</span> - </div> - </td> - <td> - </td> - <td> - <div>LLDP neighbor port to which given interface <code>name</code> is connected.</div> - </td> - </tr> - - <tr> - <td colspan="3"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <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 class="elbow-placeholder"></td> - <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 class="elbow-placeholder"></td> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <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 class="elbow-placeholder"></td> - <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> - </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 class="elbow-placeholder"></td> - <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="3"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>speed</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>Interface link speed.</div> - </td> - </tr> - <tr> - <td colspan="3"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>state</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li><div style="color: blue"><b>present</b> ←</div></li> - <li>absent</li> - <li>up</li> - <li>down</li> - </ul> - </td> - <td> - <div>State of the Interface configuration, <code>up</code> means present and operationally up and <code>down</code> means present and operationally <code>down</code></div> - </td> - </tr> - </table> - <br/> - - -Notes ------ - -.. note:: - - Tested against VYOS 1.1.7 - - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>` - - - -Examples --------- - -.. code-block:: yaml - - - name: configure interface - vyos.vyos.vyos_interface: - name: eth0 - description: test-interface - - - name: remove interface - vyos.vyos.vyos_interface: - name: eth0 - state: absent - - - name: make interface down - vyos.vyos.vyos_interface: - name: eth0 - enabled: false - - - name: make interface up - vyos.vyos.vyos_interface: - name: eth0 - enabled: true - - - name: Configure interface speed, mtu, duplex - vyos.vyos.vyos_interface: - name: eth5 - state: present - speed: 100 - mtu: 256 - duplex: full - - - name: Set interface using aggregate - vyos.vyos.vyos_interface: - aggregate: - - {name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512} - - {name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256} - - - name: Disable interface on aggregate - net_interface: - aggregate: - - name: eth1 - - name: eth2 - enabled: false - - - name: Delete interface using aggregate - net_interface: - aggregate: - - name: eth1 - - name: eth2 - state: absent - - - name: Check lldp neighbors intent arguments - vyos.vyos.vyos_interface: - name: eth0 - neighbors: - - port: eth0 - host: netdev - - - name: Config + intent - vyos.vyos.vyos_interface: - name: eth1 - enabled: false - state: down - - - -Return Values -------------- -Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module: - -.. raw:: html - - <table border=0 cellpadding=0 class="documentation-table"> - <tr> - <th colspan="1">Key</th> - <th>Returned</th> - <th width="100%">Description</th> - </tr> - <tr> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="return-"></div> - <b>commands</b> - <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - </div> - </td> - <td>always, except for the platforms that use Netconf transport to manage the device.</td> - <td> - <div>The list of configuration mode commands to send to the device</div> - <br/> - <div style="font-size: smaller"><b>Sample:</b></div> - <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">['set interfaces ethernet eth0 description "test-interface"', 'set interfaces ethernet eth0 speed 100', 'set interfaces ethernet eth0 mtu 256', 'set interfaces ethernet eth0 duplex full']</div> - </td> - </tr> - </table> - <br/><br/> - - -Status ------- - - -- This module will be removed in a release after 2022-06-01. *[deprecated]* -- For more information see `DEPRECATED`_. - - -Authors -~~~~~~~ - -- Ganesh Nalawade (@ganeshrn) diff --git a/docs/vyos.vyos.vyos_l3_interface_module.rst b/docs/vyos.vyos.vyos_l3_interface_module.rst deleted file mode 100644 index 8f639f5..0000000 --- a/docs/vyos.vyos.vyos_l3_interface_module.rst +++ /dev/null @@ -1,396 +0,0 @@ -.. _vyos.vyos.vyos_l3_interface_module: - - -*************************** -vyos.vyos.vyos_l3_interface -*************************** - -**(deprecated, removed after 2022-06-01) Manage L3 interfaces on VyOS network devices** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - -DEPRECATED ----------- -:Removed in collection release after 2022-06-01 -:Why: Updated modules released with more functionality. -:Alternative: vyos_l3_interfaces - - - -Synopsis --------- -- This module provides declarative management of L3 interfaces on VyOS network devices. - - - - -Parameters ----------- - -.. raw:: html - - <table border=0 cellpadding=0 class="documentation-table"> - <tr> - <th colspan="2">Parameter</th> - <th>Choices/<font color="blue">Defaults</font></th> - <th width="100%">Comments</th> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>aggregate</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - / <span style="color: purple">elements=dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div>List of L3 interfaces definitions</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>ipv4</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>IPv4 of the L3 interface.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>ipv6</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>IPv6 of the L3 interface.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>name</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">string</span> - / <span style="color: red">required</span> - </div> - </td> - <td> - </td> - <td> - <div>Name of the L3 interface.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>state</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li>present</li> - <li>absent</li> - </ul> - </td> - <td> - <div>State of the L3 interface configuration.</div> - </td> - </tr> - - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>ipv4</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>IPv4 of the L3 interface.</div> - </td> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>ipv6</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>IPv6 of the L3 interface.</div> - </td> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>name</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>Name of the L3 interface.</div> - </td> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - <b>state</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li><div style="color: blue"><b>present</b> ←</div></li> - <li>absent</li> - </ul> - </td> - <td> - <div>State of the L3 interface configuration.</div> - </td> - </tr> - </table> - <br/> - - -Notes ------ - -.. note:: - - Tested against VYOS 1.1.7 - - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>` - - - -Examples --------- - -.. code-block:: yaml - - - name: Set eth0 IPv4 address - vyos.vyos.vyos_l3_interface: - name: eth0 - ipv4: 192.168.0.1/24 - - - name: Remove eth0 IPv4 address - vyos.vyos.vyos_l3_interface: - name: eth0 - state: absent - - - name: Set IP addresses on aggregate - vyos.vyos.vyos_l3_interface: - aggregate: - - {name: eth1, ipv4: 192.168.2.10/24} - - {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"} - - - name: Remove IP addresses on aggregate - vyos.vyos.vyos_l3_interface: - aggregate: - - {name: eth1, ipv4: 192.168.2.10/24} - - {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"} - state: absent - - - -Return Values -------------- -Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module: - -.. raw:: html - - <table border=0 cellpadding=0 class="documentation-table"> - <tr> - <th colspan="1">Key</th> - <th>Returned</th> - <th width="100%">Description</th> - </tr> - <tr> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="return-"></div> - <b>commands</b> - <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - </div> - </td> - <td>always, except for the platforms that use Netconf transport to manage the device.</td> - <td> - <div>The list of configuration mode commands to send to the device</div> - <br/> - <div style="font-size: smaller"><b>Sample:</b></div> - <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">["set interfaces ethernet eth0 address '192.168.0.1/24'"]</div> - </td> - </tr> - </table> - <br/><br/> - - -Status ------- - - -- This module will be removed in a release after 2022-06-01. *[deprecated]* -- For more information see `DEPRECATED`_. - - -Authors -~~~~~~~ - -- Ricardo Carrillo Cruz (@rcarrillocruz) diff --git a/docs/vyos.vyos.vyos_linkagg_module.rst b/docs/vyos.vyos.vyos_linkagg_module.rst deleted file mode 100644 index a294804..0000000 --- a/docs/vyos.vyos.vyos_linkagg_module.rst +++ /dev/null @@ -1,424 +0,0 @@ -.. _vyos.vyos.vyos_linkagg_module: - - -********************** -vyos.vyos.vyos_linkagg -********************** - -**(deprecated, removed after 2022-06-01) Manage link aggregation groups on VyOS network devices** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - -DEPRECATED ----------- -:Removed in collection release after 2022-06-01 -:Why: Updated modules released with more functionality. -:Alternative: vyos_lag_interfaces - - - -Synopsis --------- -- This module provides declarative management of link aggregation groups on VyOS network devices. - - - - -Parameters ----------- - -.. raw:: html - - <table border=0 cellpadding=0 class="documentation-table"> - <tr> - <th colspan="2">Parameter</th> - <th>Choices/<font color="blue">Defaults</font></th> - <th width="100%">Comments</th> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>aggregate</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - / <span style="color: purple">elements=dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div>List of link aggregation definitions.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>members</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - / <span style="color: purple">elements=string</span> - </div> - </td> - <td> - </td> - <td> - <div>List of members of the link aggregation group.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>mode</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li>802.3ad</li> - <li>active-backup</li> - <li>broadcast</li> - <li>round-robin</li> - <li>transmit-load-balance</li> - <li>adaptive-load-balance</li> - <li>xor-hash</li> - <li>on</li> - </ul> - </td> - <td> - <div>Mode of the link aggregation group.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>name</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">string</span> - / <span style="color: red">required</span> - </div> - </td> - <td> - </td> - <td> - <div>Name of the link aggregation group.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>state</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li>present</li> - <li>absent</li> - <li>up</li> - <li>down</li> - </ul> - </td> - <td> - <div>State of the link aggregation group.</div> - </td> - </tr> - - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>members</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - / <span style="color: purple">elements=string</span> - </div> - </td> - <td> - </td> - <td> - <div>List of members of the link aggregation group.</div> - </td> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>mode</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li><div style="color: blue"><b>802.3ad</b> ←</div></li> - <li>active-backup</li> - <li>broadcast</li> - <li>round-robin</li> - <li>transmit-load-balance</li> - <li>adaptive-load-balance</li> - <li>xor-hash</li> - <li>on</li> - </ul> - </td> - <td> - <div>Mode of the link aggregation group.</div> - </td> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>name</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>Name of the link aggregation group.</div> - </td> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - <b>state</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li><div style="color: blue"><b>present</b> ←</div></li> - <li>absent</li> - <li>up</li> - <li>down</li> - </ul> - </td> - <td> - <div>State of the link aggregation group.</div> - </td> - </tr> - </table> - <br/> - - -Notes ------ - -.. note:: - - Tested against VYOS 1.1.7 - - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>` - - - -Examples --------- - -.. code-block:: yaml - - - name: configure link aggregation group - vyos.vyos.vyos_linkagg: - name: bond0 - members: - - eth0 - - eth1 - - - name: remove configuration - vyos.vyos.vyos_linkagg: - name: bond0 - state: absent - - - name: Create aggregate of linkagg definitions - vyos.vyos.vyos_linkagg: - aggregate: - - {name: bond0, members: [eth1]} - - {name: bond1, members: [eth2]} - - - name: Remove aggregate of linkagg definitions - vyos.vyos.vyos_linkagg: - aggregate: - - name: bond0 - - name: bond1 - state: absent - - - -Return Values -------------- -Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module: - -.. raw:: html - - <table border=0 cellpadding=0 class="documentation-table"> - <tr> - <th colspan="1">Key</th> - <th>Returned</th> - <th width="100%">Description</th> - </tr> - <tr> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="return-"></div> - <b>commands</b> - <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - </div> - </td> - <td>always, except for the platforms that use Netconf transport to manage the device.</td> - <td> - <div>The list of configuration mode commands to send to the device</div> - <br/> - <div style="font-size: smaller"><b>Sample:</b></div> - <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">['set interfaces bonding bond0', "set interfaces ethernet eth0 bond-group 'bond0'", "set interfaces ethernet eth1 bond-group 'bond0'"]</div> - </td> - </tr> - </table> - <br/><br/> - - -Status ------- - - -- This module will be removed in a release after 2022-06-01. *[deprecated]* -- For more information see `DEPRECATED`_. - - -Authors -~~~~~~~ - -- Ricardo Carrillo Cruz (@rcarrillocruz) diff --git a/docs/vyos.vyos.vyos_lldp_interface_module.rst b/docs/vyos.vyos.vyos_lldp_interface_module.rst deleted file mode 100644 index b93f13c..0000000 --- a/docs/vyos.vyos.vyos_lldp_interface_module.rst +++ /dev/null @@ -1,344 +0,0 @@ -.. _vyos.vyos.vyos_lldp_interface_module: - - -***************************** -vyos.vyos.vyos_lldp_interface -***************************** - -**(deprecated, removed after 2022-06-01) Manage LLDP interfaces configuration on VyOS network devices** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - -DEPRECATED ----------- -:Removed in collection release after 2022-06-01 -:Why: Updated modules released with more functionality. -:Alternative: vyos_lldp_interfaces - - - -Synopsis --------- -- This module provides declarative management of LLDP interfaces configuration on VyOS network devices. - - - - -Parameters ----------- - -.. raw:: html - - <table border=0 cellpadding=0 class="documentation-table"> - <tr> - <th colspan="2">Parameter</th> - <th>Choices/<font color="blue">Defaults</font></th> - <th width="100%">Comments</th> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>aggregate</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - / <span style="color: purple">elements=dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div>List of interfaces LLDP should be configured on.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>name</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">string</span> - / <span style="color: red">required</span> - </div> - </td> - <td> - </td> - <td> - <div>Name of the interface LLDP should be configured on.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>state</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li>present</li> - <li>absent</li> - <li>enabled</li> - <li>disabled</li> - </ul> - </td> - <td> - <div>State of the LLDP configuration.</div> - </td> - </tr> - - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>name</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>Name of the interface LLDP should be configured on.</div> - </td> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - <b>state</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li><div style="color: blue"><b>present</b> ←</div></li> - <li>absent</li> - <li>enabled</li> - <li>disabled</li> - </ul> - </td> - <td> - <div>State of the LLDP configuration.</div> - </td> - </tr> - </table> - <br/> - - -Notes ------ - -.. note:: - - Tested against VYOS 1.1.7 - - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>` - - - -Examples --------- - -.. code-block:: yaml - - - name: Enable LLDP on eth1 - net_lldp_interface: - state: present - - - name: Enable LLDP on specific interfaces - net_lldp_interface: - interfaces: - - eth1 - - eth2 - state: present - - - name: Disable LLDP globally - net_lldp_interface: - state: disabled - - - name: Create aggregate of LLDP interface configurations - vyos.vyos.vyos_lldp_interface: - aggregate: - - name: eth1 - - name: eth2 - state: present - - - name: Delete aggregate of LLDP interface configurations - vyos.vyos.vyos_lldp_interface: - aggregate: - - name: eth1 - - name: eth2 - state: absent - - - -Return Values -------------- -Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module: - -.. raw:: html - - <table border=0 cellpadding=0 class="documentation-table"> - <tr> - <th colspan="1">Key</th> - <th>Returned</th> - <th width="100%">Description</th> - </tr> - <tr> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="return-"></div> - <b>commands</b> - <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - </div> - </td> - <td>always, except for the platforms that use Netconf transport to manage the device.</td> - <td> - <div>The list of configuration mode commands to send to the device</div> - <br/> - <div style="font-size: smaller"><b>Sample:</b></div> - <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">['set service lldp eth1', 'set service lldp eth2 disable']</div> - </td> - </tr> - </table> - <br/><br/> - - -Status ------- - - -- This module will be removed in a release after 2022-06-01. *[deprecated]* -- For more information see `DEPRECATED`_. - - -Authors -~~~~~~~ - -- Ricardo Carrillo Cruz (@rcarrillocruz) diff --git a/docs/vyos.vyos.vyos_lldp_module.rst b/docs/vyos.vyos.vyos_lldp_module.rst deleted file mode 100644 index c0a0d22..0000000 --- a/docs/vyos.vyos.vyos_lldp_module.rst +++ /dev/null @@ -1,268 +0,0 @@ -.. _vyos.vyos.vyos_lldp_module: - - -******************* -vyos.vyos.vyos_lldp -******************* - -**(deprecated, removed after 2022-06-01) Manage LLDP configuration on VyOS network devices** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - -DEPRECATED ----------- -:Removed in collection release after 2022-06-01 -:Why: Updated modules released with more functionality. -:Alternative: vyos_lldp_global - - - -Synopsis --------- -- This module provides declarative management of LLDP service on VyOS network devices. - - - - -Parameters ----------- - -.. raw:: html - - <table border=0 cellpadding=0 class="documentation-table"> - <tr> - <th colspan="2">Parameter</th> - <th>Choices/<font color="blue">Defaults</font></th> - <th width="100%">Comments</th> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>interfaces</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - / <span style="color: purple">elements=string</span> - </div> - </td> - <td> - </td> - <td> - <div>Name of the interfaces.</div> - </td> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - <b>state</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li><div style="color: blue"><b>present</b> ←</div></li> - <li>absent</li> - <li>enabled</li> - <li>disabled</li> - </ul> - </td> - <td> - <div>State of the link aggregation group.</div> - </td> - </tr> - </table> - <br/> - - -Notes ------ - -.. note:: - - Tested against VYOS 1.1.7 - - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>` - - - -Examples --------- - -.. code-block:: yaml - - - name: Enable LLDP service - vyos.vyos.vyos_lldp: - state: present - - - name: Disable LLDP service - vyos.vyos.vyos_lldp: - state: absent - - - -Return Values -------------- -Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module: - -.. raw:: html - - <table border=0 cellpadding=0 class="documentation-table"> - <tr> - <th colspan="1">Key</th> - <th>Returned</th> - <th width="100%">Description</th> - </tr> - <tr> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="return-"></div> - <b>commands</b> - <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - </div> - </td> - <td>always, except for the platforms that use Netconf transport to manage the device.</td> - <td> - <div>The list of configuration mode commands to send to the device</div> - <br/> - <div style="font-size: smaller"><b>Sample:</b></div> - <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">['set service lldp']</div> - </td> - </tr> - </table> - <br/><br/> - - -Status ------- - - -- This module will be removed in a release after 2022-06-01. *[deprecated]* -- For more information see `DEPRECATED`_. - - -Authors -~~~~~~~ - -- Ricardo Carrillo Cruz (@rcarrillocruz) diff --git a/docs/vyos.vyos.vyos_logging_module.rst b/docs/vyos.vyos.vyos_logging_module.rst index c846cf9..969190b 100644 --- a/docs/vyos.vyos.vyos_logging_module.rst +++ b/docs/vyos.vyos.vyos_logging_module.rst @@ -218,122 +218,6 @@ Parameters <tr> <td colspan="2"> <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> <b>state</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> <div style="font-size: small"> diff --git a/docs/vyos.vyos.vyos_ping_module.rst b/docs/vyos.vyos.vyos_ping_module.rst index 7b2e2d0..e18552b 100644 --- a/docs/vyos.vyos.vyos_ping_module.rst +++ b/docs/vyos.vyos.vyos_ping_module.rst @@ -33,12 +33,12 @@ Parameters <table border=0 cellpadding=0 class="documentation-table"> <tr> - <th colspan="2">Parameter</th> + <th colspan="1">Parameter</th> <th>Choices/<font color="blue">Defaults</font></th> <th width="100%">Comments</th> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>count</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -54,7 +54,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>dest</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -70,7 +70,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>interval</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -85,124 +85,8 @@ Parameters </td> </tr> <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> <td colspan="1"> <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> <b>size</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> <div style="font-size: small"> @@ -216,7 +100,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>source</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -231,7 +115,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>state</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -250,7 +134,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>ttl</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> diff --git a/docs/vyos.vyos.vyos_static_route_module.rst b/docs/vyos.vyos.vyos_static_route_module.rst deleted file mode 100644 index 98200af..0000000 --- a/docs/vyos.vyos.vyos_static_route_module.rst +++ /dev/null @@ -1,437 +0,0 @@ -.. _vyos.vyos.vyos_static_route_module: - - -*************************** -vyos.vyos.vyos_static_route -*************************** - -**(deprecated, removed after 2022-06-01) Manage static IP routes on Vyatta VyOS network devices** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - -DEPRECATED ----------- -:Removed in collection release after 2022-06-01 -:Why: Updated modules released with more functionality. -:Alternative: vyos_static_routes - - - -Synopsis --------- -- This module provides declarative management of static IP routes on Vyatta VyOS network devices. - - - - -Parameters ----------- - -.. raw:: html - - <table border=0 cellpadding=0 class="documentation-table"> - <tr> - <th colspan="2">Parameter</th> - <th>Choices/<font color="blue">Defaults</font></th> - <th width="100%">Comments</th> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>admin_distance</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> - </td> - <td> - <div>Admin distance of the static route.</div> - </td> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>aggregate</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - / <span style="color: purple">elements=dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div>List of static route definitions</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>admin_distance</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> - </td> - <td> - <div>Admin distance of the static route.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>mask</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>Network prefix mask of the static route.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>next_hop</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>Next hop IP of the static route.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>prefix</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">string</span> - / <span style="color: red">required</span> - </div> - </td> - <td> - </td> - <td> - <div>Network prefix of the static route. <code>mask</code> param should be ignored if <code>prefix</code> is provided with <code>mask</code> value <code>prefix/mask</code>.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>state</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li>present</li> - <li>absent</li> - </ul> - </td> - <td> - <div>State of the static route configuration.</div> - </td> - </tr> - - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>mask</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>Network prefix mask of the static route.</div> - </td> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>next_hop</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>Next hop IP of the static route.</div> - </td> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>prefix</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>Network prefix of the static route. <code>mask</code> param should be ignored if <code>prefix</code> is provided with <code>mask</code> value <code>prefix/mask</code>.</div> - </td> - </tr> - <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - <b>state</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> - <ul style="margin: 0; padding: 0"><b>Choices:</b> - <li><div style="color: blue"><b>present</b> ←</div></li> - <li>absent</li> - </ul> - </td> - <td> - <div>State of the static route configuration.</div> - </td> - </tr> - </table> - <br/> - - -Notes ------ - -.. note:: - - Tested against VyOS 1.1.8 (helium). - - This module works with connection ``ansible.netcommon.network_cli``. See `the VyOS OS Platform Options <../network/user_guide/platform_vyos.html>`_. - - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>` - - - -Examples --------- - -.. code-block:: yaml - - - name: configure static route - vyos.vyos.vyos_static_route: - prefix: 192.168.2.0 - mask: 24 - next_hop: 10.0.0.1 - - - name: configure static route prefix/mask - vyos.vyos.vyos_static_route: - prefix: 192.168.2.0/16 - next_hop: 10.0.0.1 - - - name: remove configuration - vyos.vyos.vyos_static_route: - prefix: 192.168.2.0 - mask: 16 - next_hop: 10.0.0.1 - state: absent - - - name: configure aggregates of static routes - vyos.vyos.vyos_static_route: - aggregate: - - {prefix: 192.168.2.0, mask: 24, next_hop: 10.0.0.1} - - {prefix: 192.168.3.0, mask: 16, next_hop: 10.0.2.1} - - {prefix: 192.168.3.0/16, next_hop: 10.0.2.1} - - - name: Remove static route collections - vyos.vyos.vyos_static_route: - aggregate: - - {prefix: 172.24.1.0/24, next_hop: 192.168.42.64} - - {prefix: 172.24.3.0/24, next_hop: 192.168.42.64} - state: absent - - - -Return Values -------------- -Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module: - -.. raw:: html - - <table border=0 cellpadding=0 class="documentation-table"> - <tr> - <th colspan="1">Key</th> - <th>Returned</th> - <th width="100%">Description</th> - </tr> - <tr> - <td colspan="1"> - <div class="ansibleOptionAnchor" id="return-"></div> - <b>commands</b> - <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a> - <div style="font-size: small"> - <span style="color: purple">list</span> - </div> - </td> - <td>always</td> - <td> - <div>The list of configuration mode commands to send to the device</div> - <br/> - <div style="font-size: smaller"><b>Sample:</b></div> - <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">['set protocols static route 192.168.2.0/16 next-hop 10.0.0.1']</div> - </td> - </tr> - </table> - <br/><br/> - - -Status ------- - - -- This module will be removed in a release after 2022-06-01. *[deprecated]* -- For more information see `DEPRECATED`_. - - -Authors -~~~~~~~ - -- Trishna Guha (@trishnaguha) diff --git a/docs/vyos.vyos.vyos_system_module.rst b/docs/vyos.vyos.vyos_system_module.rst index b3b51e8..b5524e7 100644 --- a/docs/vyos.vyos.vyos_system_module.rst +++ b/docs/vyos.vyos.vyos_system_module.rst @@ -29,12 +29,12 @@ Parameters <table border=0 cellpadding=0 class="documentation-table"> <tr> - <th colspan="2">Parameter</th> + <th colspan="1">Parameter</th> <th>Choices/<font color="blue">Defaults</font></th> <th width="100%">Comments</th> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>domain_name</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -49,7 +49,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>domain_search</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -65,7 +65,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>host_name</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -80,7 +80,7 @@ Parameters </td> </tr> <tr> - <td colspan="2"> + <td colspan="1"> <div class="ansibleOptionAnchor" id="parameter-"></div> <b>name_server</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> @@ -97,124 +97,8 @@ Parameters </td> </tr> <tr> - <td colspan="2"> - <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> <td colspan="1"> <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> <b>state</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> <div style="font-size: small"> diff --git a/docs/vyos.vyos.vyos_user_module.rst b/docs/vyos.vyos.vyos_user_module.rst index 3af7248..8fb47b8 100644 --- a/docs/vyos.vyos.vyos_user_module.rst +++ b/docs/vyos.vyos.vyos_user_module.rst @@ -63,7 +63,7 @@ Parameters <td> </td> <td> - <div>The password to be configured on the VyOS device. The password needs to be provided in clear and it will be encrypted on the device. Please note that this option is not same as <code>provider password</code>.</div> + <div>The password to be configured on the VyOS device. The password needs to be provided in clear and it will be encrypted on the device.</div> </td> </tr> <tr> @@ -113,7 +113,7 @@ Parameters <td> </td> <td> - <div>The username to be configured on the VyOS device. This argument accepts a string value and is mutually exclusive with the <code>aggregate</code> argument. Please note that this option is not same as <code>provider username</code>.</div> + <div>The username to be configured on the VyOS device. This argument accepts a string value and is mutually exclusive with the <code>aggregate</code> argument.</div> </td> </tr> <tr> @@ -169,7 +169,7 @@ Parameters <td> </td> <td> - <div>The password to be configured on the VyOS device. The password needs to be provided in clear and it will be encrypted on the device. Please note that this option is not same as <code>provider password</code>.</div> + <div>The password to be configured on the VyOS device. The password needs to be provided in clear and it will be encrypted on the device.</div> </td> </tr> <tr> @@ -215,128 +215,12 @@ Parameters <td> </td> <td> - <div>The username to be configured on the VyOS device. This argument accepts a string value and is mutually exclusive with the <code>aggregate</code> argument. Please note that this option is not same as <code>provider username</code>.</div> + <div>The username to be configured on the VyOS device. This argument accepts a string value and is mutually exclusive with the <code>aggregate</code> argument.</div> </td> </tr> <tr> <td colspan="2"> <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> <b>purge</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> <div style="font-size: small"> diff --git a/docs/vyos.vyos.vyos_vlan_module.rst b/docs/vyos.vyos.vyos_vlan_module.rst index 970928f..601cda9 100644 --- a/docs/vyos.vyos.vyos_vlan_module.rst +++ b/docs/vyos.vyos.vyos_vlan_module.rst @@ -251,122 +251,6 @@ Parameters <tr> <td colspan="2"> <div class="ansibleOptionAnchor" id="parameter-"></div> - <b>provider</b> - <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> - <div style="font-size: small"> - <span style="color: purple">dictionary</span> - </div> - </td> - <td> - </td> - <td> - <div><b>Deprecated</b></div> - <div>Starting with Ansible 2.5 we recommend using <code>connection: ansible.netcommon.network_cli</code>.</div> - <div>For more information please see the <a href='../network/getting_started/network_differences.html#multiple-communication-protocols'>Network Guide</a>.</div> - <div><hr/></div> - <div>A dict object containing connection details.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </td> - <td> - <div>Specifies the port to use when building the connection to the remote device.</div> - </td> - </tr> - <tr> - <td class="elbow-placeholder"></td> - <td colspan="1"> - <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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> - </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 class="elbow-placeholder"></td> - <td colspan="1"> - <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> <b>purge</b> <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a> <div style="font-size: small"> diff --git a/meta/runtime.yml b/meta/runtime.yml index 8bd9d88..8c7c766 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -22,59 +22,14 @@ plugin_routing: redirect: vyos.vyos.vyos_firewall_rules hostname: redirect: vyos.vyos.vyos_hostname - interface: - redirect: vyos.vyos.vyos_interface - deprecation: - removal_date: "2022-06-01" - warning_text: See the plugin documentation for more details - vyos_interface: - deprecation: - removal_date: "2022-06-01" - warning_text: See the plugin documentation for more details interfaces: redirect: vyos.vyos.vyos_interfaces - l3_interface: - redirect: vyos.vyos.vyos_l3_interface - deprecation: - removal_date: "2022-06-01" - warning_text: See the plugin documentation for more details - vyos_l3_interface: - deprecation: - removal_date: "2022-06-01" - warning_text: See the plugin documentation for more details l3_interfaces: redirect: vyos.vyos.vyos_l3_interfaces lag_interfaces: redirect: vyos.vyos.vyos_lag_interfaces - linkagg: - redirect: vyos.vyos.vyos_linkagg - deprecation: - removal_date: "2022-06-01" - warning_text: See the plugin documentation for more details - vyos_linkagg: - deprecation: - removal_date: "2022-06-01" - warning_text: See the plugin documentation for more details - lldp: - redirect: vyos.vyos.vyos_lldp - deprecation: - removal_date: "2022-06-01" - warning_text: See the plugin documentation for more details - vyos_lldp: - deprecation: - removal_date: "2022-06-01" - warning_text: See the plugin documentation for more details lldp_global: redirect: vyos.vyos.vyos_lldp_global - lldp_interface: - redirect: vyos.vyos.vyos_lldp_interface - deprecation: - removal_date: "2022-06-01" - warning_text: See the plugin documentation for more details - vyos_lldp_interface: - deprecation: - removal_date: "2022-06-01" - warning_text: See the plugin documentation for more details lldp_interfaces: redirect: vyos.vyos.vyos_lldp_interfaces logging: @@ -102,15 +57,6 @@ plugin_routing: redirect: vyos.vyos.vyos_prefix_lists snmp_server: redirect: vyos.vyos.vyos_snmp_servers - static_route: - redirect: vyos.vyos.vyos_static_route - deprecation: - removal_date: "2022-06-01" - warning_text: See the plugin documentation for more details - vyos_static_route: - deprecation: - removal_date: "2022-06-01" - warning_text: See the plugin documentation for more details static_routes: redirect: vyos.vyos.vyos_static_routes system: diff --git a/plugins/action/vyos.py b/plugins/action/vyos.py index 61f377b..f6f9aad 100644 --- a/plugins/action/vyos.py +++ b/plugins/action/vyos.py @@ -20,18 +20,9 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -import sys -import copy - from ansible_collections.ansible.netcommon.plugins.action.network import ( ActionModule as ActionNetworkModule, ) -from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import ( - load_provider, -) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_provider_spec, -) from ansible.utils.display import Display display = Display() @@ -48,75 +39,7 @@ class ActionModule(ActionNetworkModule): persistent_connection = self._play_context.connection.split(".")[-1] warnings = [] - if persistent_connection == "network_cli": - provider = self._task.args.get("provider", {}) - if any(provider.values()): - display.warning( - "provider is unnecessary when using network_cli and will be ignored" - ) - del self._task.args["provider"] - elif self._play_context.connection == "local": - provider = load_provider(vyos_provider_spec, self._task.args) - pc = copy.deepcopy(self._play_context) - pc.connection = "ansible.netcommon.network_cli" - pc.network_os = "vyos.vyos.vyos" - pc.remote_addr = provider["host"] or self._play_context.remote_addr - pc.port = int(provider["port"] or self._play_context.port or 22) - pc.remote_user = ( - provider["username"] or self._play_context.connection_user - ) - pc.password = provider["password"] or self._play_context.password - pc.private_key_file = ( - provider["ssh_keyfile"] or self._play_context.private_key_file - ) - - connection = self._shared_loader_obj.connection_loader.get( - "ansible.netcommon.persistent", - pc, - sys.stdin, - task_uuid=self._task._uuid, - ) - - # TODO: Remove below code after ansible minimal is cut out - if connection is None: - pc.connection = "network_cli" - pc.network_os = "vyos" - connection = self._shared_loader_obj.connection_loader.get( - "persistent", pc, sys.stdin, task_uuid=self._task._uuid - ) - - display.vvv( - "using connection plugin %s (was local)" % pc.connection, - pc.remote_addr, - ) - - command_timeout = ( - int(provider["timeout"]) - if provider["timeout"] - else connection.get_option("persistent_command_timeout") - ) - connection.set_options( - direct={"persistent_command_timeout": command_timeout} - ) - - pc.timeout = command_timeout - socket_path = connection.run() - display.vvvv("socket_path: %s" % socket_path, pc.remote_addr) - if not socket_path: - return { - "failed": True, - "msg": "unable to open shell. Please see: " - + "https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell", - } - - task_vars["ansible_socket"] = socket_path - warnings.append( - [ - "connection local support for this module is deprecated and will be removed in version 2.14, use connection %s" - % pc.connection - ] - ) - else: + if persistent_connection != "network_cli": return { "failed": True, "msg": "Connection type %s is not valid for this module" diff --git a/plugins/doc_fragments/vyos.py b/plugins/doc_fragments/vyos.py index 745ba5a..c6abc21 100644 --- a/plugins/doc_fragments/vyos.py +++ b/plugins/doc_fragments/vyos.py @@ -10,53 +10,7 @@ __metaclass__ = type class ModuleDocFragment(object): # Standard files documentation fragment - DOCUMENTATION = r"""options: - provider: - description: - - B(Deprecated) - - 'Starting with Ansible 2.5 we recommend using C(connection: ansible.netcommon.network_cli).' - - For more information please see the L(Network Guide, ../network/getting_started/network_differences.html#multiple-communication-protocols). - - HORIZONTALLINE - - A dict object containing connection details. - type: dict - suboptions: - host: - description: - - 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. - type: str - port: - description: - - Specifies the port to use when building the connection to the remote device. - type: int - username: - description: - - 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 C(ANSIBLE_NET_USERNAME) - will be used instead. - type: str - password: - description: - - 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 C(ANSIBLE_NET_PASSWORD) - will be used instead. - type: str - timeout: - description: - - 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. - type: int - ssh_keyfile: - description: - - 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 C(ANSIBLE_NET_SSH_KEYFILE) will be used instead. - type: path + DOCUMENTATION = r"""options: {} notes: - For more information on using Ansible to manage network devices see the :ref:`Ansible Network Guide <network_guide>` diff --git a/plugins/module_utils/network/vyos/vyos.py b/plugins/module_utils/network/vyos/vyos.py index 4ab36b9..42fc57c 100644 --- a/plugins/module_utils/network/vyos/vyos.py +++ b/plugins/module_utils/network/vyos/vyos.py @@ -31,36 +31,10 @@ __metaclass__ = type import json from ansible.module_utils._text import to_text -from ansible.module_utils.basic import env_fallback from ansible.module_utils.connection import Connection, ConnectionError _DEVICE_CONFIGS = {} -vyos_provider_spec = { - "host": dict(), - "port": dict(type="int"), - "username": dict(fallback=(env_fallback, ["ANSIBLE_NET_USERNAME"])), - "password": dict( - fallback=(env_fallback, ["ANSIBLE_NET_PASSWORD"]), no_log=True - ), - "ssh_keyfile": dict( - fallback=(env_fallback, ["ANSIBLE_NET_SSH_KEYFILE"]), type="path" - ), - "timeout": dict(type="int"), -} -vyos_argument_spec = { - "provider": dict( - type="dict", - options=vyos_provider_spec, - removed_at_date="2022-06-01", - removed_from_collection="vyos.vyos", - ) -} - - -def get_provider_argspec(): - return vyos_provider_spec - def get_connection(module): if hasattr(module, "_vyos_connection"): diff --git a/plugins/modules/vyos_banner.py b/plugins/modules/vyos_banner.py index 07b5a28..a5f3fb9 100644 --- a/plugins/modules/vyos_banner.py +++ b/plugins/modules/vyos_banner.py @@ -95,9 +95,6 @@ from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import get_config, load_config, ) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) def spec_to_commands(updates, module): @@ -164,8 +161,6 @@ def main(): state=dict(default="present", choices=["present", "absent"]), ) - argument_spec.update(vyos_argument_spec) - required_if = [("state", "present", ("text",))] module = AnsibleModule( diff --git a/plugins/modules/vyos_command.py b/plugins/modules/vyos_command.py index c0df9ce..d5ab918 100644 --- a/plugins/modules/vyos_command.py +++ b/plugins/modules/vyos_command.py @@ -154,9 +154,6 @@ from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.u from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( run_commands, ) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) def parse_commands(module, warnings): @@ -183,8 +180,6 @@ def main(): interval=dict(default=1, type="int"), ) - spec.update(vyos_argument_spec) - module = AnsibleModule(argument_spec=spec, supports_check_mode=True) warnings = list() diff --git a/plugins/modules/vyos_config.py b/plugins/modules/vyos_config.py index 0142b8c..4b2b31d 100644 --- a/plugins/modules/vyos_config.py +++ b/plugins/modules/vyos_config.py @@ -203,7 +203,6 @@ from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import run_commands, ) from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, get_connection, ) @@ -340,8 +339,6 @@ def main(): save=dict(type="bool", default=False), ) - argument_spec.update(vyos_argument_spec) - mutually_exclusive = [("lines", "src")] module = AnsibleModule( diff --git a/plugins/modules/vyos_facts.py b/plugins/modules/vyos_facts.py index 9effee6..5e57821 100644 --- a/plugins/modules/vyos_facts.py +++ b/plugins/modules/vyos_facts.py @@ -146,9 +146,6 @@ from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.facts.facts Facts, FACT_RESOURCE_SUBSETS, ) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) def main(): @@ -158,7 +155,6 @@ def main(): :returns: ansible_facts """ argument_spec = FactsArgs.argument_spec - argument_spec.update(vyos_argument_spec) module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True diff --git a/plugins/modules/vyos_interface.py b/plugins/modules/vyos_interface.py deleted file mode 100644 index 04fd85d..0000000 --- a/plugins/modules/vyos_interface.py +++ /dev/null @@ -1,554 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -# (c) 2017, Ansible by Red Hat, inc -# -# This file is part of Ansible by Red Hat -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. -# - -from __future__ import absolute_import, division, print_function - -__metaclass__ = type - -DOCUMENTATION = """ -module: vyos_interface -author: Ganesh Nalawade (@ganeshrn) -short_description: (deprecated, removed after 2022-06-01) Manage Interface on VyOS - network devices -description: -- This module provides declarative management of Interfaces on VyOS network devices. -version_added: 1.0.0 -deprecated: - alternative: vyos_interfaces - why: Updated modules released with more functionality. - removed_at_date: '2022-06-01' -notes: -- Tested against VYOS 1.1.7 -options: - name: - description: - - Name of the Interface. - type: str - description: - description: - - Description of Interface. - type: str - enabled: - description: - - Interface link status. - type: bool - default: True - speed: - description: - - Interface link speed. - type: str - mtu: - description: - - Maximum size of transmit packet. - type: int - duplex: - description: - - Interface link status. - type: str - choices: - - full - - half - - auto - delay: - description: - - Time in seconds to wait before checking for the operational state on remote - device. This wait is applicable for operational state argument which are I(state) - with values C(up)/C(down) and I(neighbors). - default: 10 - type: int - neighbors: - description: - - Check the operational state of given interface C(name) for LLDP neighbor. - - The following suboptions are available. - type: list - elements: dict - suboptions: - host: - description: - - LLDP neighbor host for given interface C(name). - type: str - port: - description: - - LLDP neighbor port to which given interface C(name) is connected. - type: str - aggregate: - description: List of Interfaces definitions. - type: list - elements: dict - suboptions: - name: - description: - - Name of the Interface. - required: true - type: str - description: - description: - - Description of Interface. - type: str - enabled: - description: - - Interface link status. - type: bool - speed: - description: - - Interface link speed. - type: str - mtu: - description: - - Maximum size of transmit packet. - type: int - duplex: - description: - - Interface link status. - type: str - choices: - - full - - half - - auto - delay: - description: - - Time in seconds to wait before checking for the operational state on remote - device. This wait is applicable for operational state argument which are I(state) - with values C(up)/C(down) and I(neighbors). - type: int - neighbors: - description: - - Check the operational state of given interface C(name) for LLDP neighbor. - - The following suboptions are available. - type: list - elements: dict - suboptions: - host: - description: - - LLDP neighbor host for given interface C(name). - type: str - port: - description: - - LLDP neighbor port to which given interface C(name) is connected. - type: str - state: - description: - - State of the Interface configuration, C(up) means present and operationally - up and C(down) means present and operationally C(down) - type: str - choices: - - present - - absent - - up - - down - state: - description: - - State of the Interface configuration, C(up) means present and operationally - up and C(down) means present and operationally C(down) - default: present - type: str - choices: - - present - - absent - - up - - down -extends_documentation_fragment: -- vyos.vyos.vyos - - -""" - -EXAMPLES = """ -- name: configure interface - vyos.vyos.vyos_interface: - name: eth0 - description: test-interface - -- name: remove interface - vyos.vyos.vyos_interface: - name: eth0 - state: absent - -- name: make interface down - vyos.vyos.vyos_interface: - name: eth0 - enabled: false - -- name: make interface up - vyos.vyos.vyos_interface: - name: eth0 - enabled: true - -- name: Configure interface speed, mtu, duplex - vyos.vyos.vyos_interface: - name: eth5 - state: present - speed: 100 - mtu: 256 - duplex: full - -- name: Set interface using aggregate - vyos.vyos.vyos_interface: - aggregate: - - {name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512} - - {name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256} - -- name: Disable interface on aggregate - net_interface: - aggregate: - - name: eth1 - - name: eth2 - enabled: false - -- name: Delete interface using aggregate - net_interface: - aggregate: - - name: eth1 - - name: eth2 - state: absent - -- name: Check lldp neighbors intent arguments - vyos.vyos.vyos_interface: - name: eth0 - neighbors: - - port: eth0 - host: netdev - -- name: Config + intent - vyos.vyos.vyos_interface: - name: eth1 - enabled: false - state: down -""" - -RETURN = """ -commands: - description: The list of configuration mode commands to send to the device - returned: always, except for the platforms that use Netconf transport to manage the device. - type: list - sample: - - set interfaces ethernet eth0 description "test-interface" - - set interfaces ethernet eth0 speed 100 - - set interfaces ethernet eth0 mtu 256 - - set interfaces ethernet eth0 duplex full -""" -import re - -from copy import deepcopy -from time import sleep - -from ansible.module_utils._text import to_text -from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.connection import exec_command -from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import ( - conditional, - remove_default_spec, -) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - load_config, - get_config, -) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) - - -def search_obj_in_list(name, lst): - for o in lst: - if o["name"] == name: - return o - - return None - - -def map_obj_to_commands(updates): - commands = list() - want, have = updates - params = ("speed", "description", "duplex", "mtu") - for w in want: - name = w["name"] - disable = w["disable"] - state = w["state"] - - obj_in_have = search_obj_in_list(name, have) - set_interface = "set interfaces ethernet " + name - delete_interface = "delete interfaces ethernet " + name - - if state == "absent" and obj_in_have: - commands.append(delete_interface) - elif state in ("present", "up", "down"): - if obj_in_have: - for item in params: - value = w.get(item) - - if value and value != obj_in_have.get(item): - if item == "description": - value = "'" + str(value) + "'" - commands.append( - set_interface + " " + item + " " + str(value) - ) - - if disable and not obj_in_have.get("disable", False): - commands.append(set_interface + " disable") - elif not disable and obj_in_have.get("disable", False): - commands.append(delete_interface + " disable") - else: - commands.append(set_interface) - for item in params: - value = w.get(item) - if value: - if item == "description": - value = "'" + str(value) + "'" - commands.append( - set_interface + " " + item + " " + str(value) - ) - - if disable: - commands.append(set_interface + " disable") - return commands - - -def map_config_to_obj(module): - data = get_config(module, flags=["| grep interface"]) - obj = [] - for line in data.split("\n"): - if line.startswith("set interfaces ethernet"): - match = re.search(r"set interfaces ethernet (\S+)", line, re.M) - name = match.group(1) - if name: - interface = {} - for item in obj: - if item["name"] == name: - interface = item - break - - if not interface: - interface = {"name": name} - obj.append(interface) - - match = re.search(r"%s (\S+)" % name, line, re.M) - if match: - param = match.group(1) - if param == "description": - match = re.search(r"description (.+)", line, re.M) - description = match.group(1).strip("'") - interface["description"] = description - elif param == "speed": - match = re.search(r"speed (\S+)", line, re.M) - speed = match.group(1).strip("'") - interface["speed"] = speed - elif param == "mtu": - match = re.search(r"mtu (\S+)", line, re.M) - mtu = match.group(1).strip("'") - interface["mtu"] = int(mtu) - elif param == "duplex": - match = re.search(r"duplex (\S+)", line, re.M) - duplex = match.group(1).strip("'") - interface["duplex"] = duplex - elif param.strip("'") == "disable": - interface["disable"] = True - - return obj - - -def map_params_to_obj(module): - obj = [] - aggregate = module.params.get("aggregate") - if aggregate: - for item in aggregate: - for key in item: - if item.get(key) is None: - item[key] = module.params[key] - - d = item.copy() - if d["enabled"]: - d["disable"] = False - else: - d["disable"] = True - - obj.append(d) - else: - params = { - "name": module.params["name"], - "description": module.params["description"], - "speed": module.params["speed"], - "mtu": module.params["mtu"], - "duplex": module.params["duplex"], - "delay": module.params["delay"], - "state": module.params["state"], - "neighbors": module.params["neighbors"], - } - - if module.params["enabled"]: - params.update({"disable": False}) - else: - params.update({"disable": True}) - - obj.append(params) - return obj - - -def get_interfaces_data(module, name): - command = "show interfaces ethernet %s" % name - rc, out, err = exec_command(module, command) - return [rc, out, err] - - -def get_lldp_neighbor(module): - command = "show lldp neighbors detail" - rc, out, err = exec_command(module, command) - return [rc, out, err] - - -def check_declarative_intent_params(module, want, result): - failed_conditions = [] - have_neighbors = None - for w in want: - want_state = w.get("state") - want_neighbors = w.get("neighbors") - - if want_state not in ("up", "down") and not want_neighbors: - continue - - if result["changed"]: - sleep(w["delay"]) - - command = "show interfaces ethernet %s" % w["name"] - rc, out, err = get_interfaces_data(w["name"], module) - if rc != 0: - module.fail_json( - msg=to_text(err, errors="surrogate_then_replace"), - command=command, - rc=rc, - ) - - if want_state in ("up", "down"): - match = re.search(r"%s (\w+)" % "state", out, re.M) - have_state = None - if match: - have_state = match.group(1) - if have_state is None or not conditional( - want_state, have_state.strip().lower() - ): - failed_conditions.append("state " + "eq(%s)" % want_state) - - if want_neighbors: - have_host = [] - have_port = [] - if have_neighbors is None: - rc, have_neighbors, err = get_lldp_neighbor(module) - if rc != 0: - module.fail_json( - msg=to_text(err, errors="surrogate_then_replace"), - command=command, - rc=rc, - ) - - if have_neighbors: - lines = have_neighbors.strip().split("Interface: ") - for line in lines: - field = line.split("\n") - if field[0].split(",")[0].strip() == w["name"]: - for item in field: - if item.strip().startswith("SysName:"): - have_host.append(item.split(":")[1].strip()) - if item.strip().startswith("PortDescr:"): - have_port.append(item.split(":")[1].strip()) - for item in want_neighbors: - host = item.get("host") - port = item.get("port") - if host and host not in have_host: - failed_conditions.append("host " + host) - if port and port not in have_port: - failed_conditions.append("port " + port) - - return failed_conditions - - -def main(): - """main entry point for module execution""" - neighbors_spec = dict(host=dict(), port=dict()) - - element_spec = dict( - name=dict(), - description=dict(), - speed=dict(), - mtu=dict(type="int"), - duplex=dict(choices=["full", "half", "auto"]), - enabled=dict(default=True, type="bool"), - neighbors=dict(type="list", elements="dict", options=neighbors_spec), - delay=dict(default=10, type="int"), - state=dict( - default="present", choices=["present", "absent", "up", "down"] - ), - ) - - aggregate_spec = deepcopy(element_spec) - aggregate_spec["name"] = dict(required=True) - - # remove default in aggregate spec, to handle common arguments - remove_default_spec(aggregate_spec) - - argument_spec = dict( - aggregate=dict(type="list", elements="dict", options=aggregate_spec), - ) - - argument_spec.update(element_spec) - argument_spec.update(vyos_argument_spec) - - required_one_of = [["name", "aggregate"]] - mutually_exclusive = [["name", "aggregate"]] - - required_together = [["speed", "duplex"]] - module = AnsibleModule( - argument_spec=argument_spec, - required_one_of=required_one_of, - mutually_exclusive=mutually_exclusive, - required_together=required_together, - supports_check_mode=True, - ) - - warnings = list() - - result = {"changed": False} - - if warnings: - result["warnings"] = warnings - - want = map_params_to_obj(module) - have = map_config_to_obj(module) - - commands = map_obj_to_commands((want, have)) - result["commands"] = commands - - if commands: - commit = not module.check_mode - diff = load_config(module, commands, commit=commit) - if diff: - if module._diff: - result["diff"] = {"prepared": diff} - result["changed"] = True - - failed_conditions = check_declarative_intent_params(module, want, result) - - if failed_conditions: - msg = "One or more conditional statements have not been satisfied" - module.fail_json(msg=msg, failed_conditions=failed_conditions) - module.exit_json(**result) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/vyos_l3_interface.py b/plugins/modules/vyos_l3_interface.py deleted file mode 100644 index 214022a..0000000 --- a/plugins/modules/vyos_l3_interface.py +++ /dev/null @@ -1,357 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -# (c) 2017, Ansible by Red Hat, inc -# -# This file is part of Ansible by Red Hat -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. -# - -from __future__ import absolute_import, division, print_function - -__metaclass__ = type - -DOCUMENTATION = """ -module: vyos_l3_interface -author: Ricardo Carrillo Cruz (@rcarrillocruz) -short_description: (deprecated, removed after 2022-06-01) Manage L3 interfaces on - VyOS network devices -description: -- This module provides declarative management of L3 interfaces on VyOS network devices. -version_added: 1.0.0 -deprecated: - alternative: vyos_l3_interfaces - why: Updated modules released with more functionality. - removed_at_date: '2022-06-01' -notes: -- Tested against VYOS 1.1.7 -options: - name: - description: - - Name of the L3 interface. - type: str - ipv4: - description: - - IPv4 of the L3 interface. - type: str - ipv6: - description: - - IPv6 of the L3 interface. - type: str - aggregate: - description: List of L3 interfaces definitions - type: list - elements: dict - suboptions: - name: - description: - - Name of the L3 interface. - type: str - required: True - ipv4: - description: - - IPv4 of the L3 interface. - type: str - ipv6: - description: - - IPv6 of the L3 interface. - type: str - state: - description: - - State of the L3 interface configuration. - type: str - choices: - - present - - absent - state: - description: - - State of the L3 interface configuration. - default: present - type: str - choices: - - present - - absent -extends_documentation_fragment: -- vyos.vyos.vyos - - -""" - -EXAMPLES = """ -- name: Set eth0 IPv4 address - vyos.vyos.vyos_l3_interface: - name: eth0 - ipv4: 192.168.0.1/24 - -- name: Remove eth0 IPv4 address - vyos.vyos.vyos_l3_interface: - name: eth0 - state: absent - -- name: Set IP addresses on aggregate - vyos.vyos.vyos_l3_interface: - aggregate: - - {name: eth1, ipv4: 192.168.2.10/24} - - {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"} - -- name: Remove IP addresses on aggregate - vyos.vyos.vyos_l3_interface: - aggregate: - - {name: eth1, ipv4: 192.168.2.10/24} - - {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"} - state: absent -""" - -RETURN = """ -commands: - description: The list of configuration mode commands to send to the device - returned: always, except for the platforms that use Netconf transport to manage the device. - type: list - sample: - - set interfaces ethernet eth0 address '192.168.0.1/24' -""" - -import socket -import re - -from copy import deepcopy - -from ansible.module_utils.basic import AnsibleModule -from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import ( - is_masklen, - validate_ip_address, -) -from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import ( - remove_default_spec, -) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - load_config, - run_commands, -) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) - - -def is_ipv4(value): - if value: - address = value.split("/") - if is_masklen(address[1]) and validate_ip_address(address[0]): - return True - return False - - -def is_ipv6(value): - if value: - address = value.split("/") - if 0 <= int(address[1]) <= 128: - try: - socket.inet_pton(socket.AF_INET6, address[0]) - except socket.error: - return False - return True - return False - - -def search_obj_in_list(name, lst): - for o in lst: - if o["name"] == name: - return o - - return None - - -def map_obj_to_commands(updates, module): - commands = list() - want, have = updates - - for w in want: - name = w["name"] - ipv4 = w["ipv4"] - ipv6 = w["ipv6"] - state = w["state"] - - obj_in_have = search_obj_in_list(name, have) - - if state == "absent" and obj_in_have: - if ( - not ipv4 - and not ipv6 - and (obj_in_have["ipv4"] or obj_in_have["ipv6"]) - ): - if name == "lo": - commands.append("delete interfaces loopback lo address") - else: - commands.append( - "delete interfaces ethernet " + name + " address" - ) - else: - if ipv4 and ipv4 in obj_in_have["ipv4"]: - if name == "lo": - commands.append( - "delete interfaces loopback lo address " + ipv4 - ) - else: - commands.append( - "delete interfaces ethernet " - + name - + " address " - + ipv4 - ) - if ipv6 and ipv6 in obj_in_have["ipv6"]: - if name == "lo": - commands.append( - "delete interfaces loopback lo address " + ipv6 - ) - else: - commands.append( - "delete interfaces ethernet " - + name - + " address " - + ipv6 - ) - elif state == "present" and obj_in_have: - if ipv4 and ipv4 not in obj_in_have["ipv4"]: - if name == "lo": - commands.append( - "set interfaces loopback lo address " + ipv4 - ) - else: - commands.append( - "set interfaces ethernet " + name + " address " + ipv4 - ) - - if ipv6 and ipv6 not in obj_in_have["ipv6"]: - if name == "lo": - commands.append( - "set interfaces loopback lo address " + ipv6 - ) - else: - commands.append( - "set interfaces ethernet " + name + " address " + ipv6 - ) - - return commands - - -def map_config_to_obj(module): - obj = [] - output = run_commands(module, ["show interfaces"]) - lines = re.split(r"\n[e|l]", output[0])[1:] - - if len(lines) > 0: - for line in lines: - splitted_line = line.split() - - if len(splitted_line) > 0: - ipv4 = [] - ipv6 = [] - - if splitted_line[0].lower().startswith("th"): - name = "e" + splitted_line[0].lower() - elif splitted_line[0].lower().startswith("o"): - name = "l" + splitted_line[0].lower() - - for i in splitted_line[1:]: - if ("." in i or ":" in i) and "/" in i: - value = i.split(r"\n")[0] - if is_ipv4(value): - ipv4.append(value) - elif is_ipv6(value): - ipv6.append(value) - - obj.append({"name": name, "ipv4": ipv4, "ipv6": ipv6}) - - return obj - - -def map_params_to_obj(module): - obj = [] - - aggregate = module.params.get("aggregate") - if aggregate: - for item in aggregate: - for key in item: - if item.get(key) is None: - item[key] = module.params[key] - - obj.append(item.copy()) - else: - obj.append( - { - "name": module.params["name"], - "ipv4": module.params["ipv4"], - "ipv6": module.params["ipv6"], - "state": module.params["state"], - } - ) - - return obj - - -def main(): - """main entry point for module execution""" - element_spec = dict( - name=dict(), - ipv4=dict(), - ipv6=dict(), - state=dict(default="present", choices=["present", "absent"]), - ) - - aggregate_spec = deepcopy(element_spec) - aggregate_spec["name"] = dict(required=True) - - # remove default in aggregate spec, to handle common arguments - remove_default_spec(aggregate_spec) - - argument_spec = dict( - aggregate=dict(type="list", elements="dict", options=aggregate_spec), - ) - - argument_spec.update(element_spec) - argument_spec.update(vyos_argument_spec) - - required_one_of = [["name", "aggregate"]] - mutually_exclusive = [["name", "aggregate"]] - module = AnsibleModule( - argument_spec=argument_spec, - required_one_of=required_one_of, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - - warnings = list() - - result = {"changed": False} - - if warnings: - result["warnings"] = warnings - - want = map_params_to_obj(module) - have = map_config_to_obj(module) - - commands = map_obj_to_commands((want, have), module) - result["commands"] = commands - - if commands: - commit = not module.check_mode - load_config(module, commands, commit=commit) - result["changed"] = True - - module.exit_json(**result) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/vyos_linkagg.py b/plugins/modules/vyos_linkagg.py deleted file mode 100644 index 4320dd3..0000000 --- a/plugins/modules/vyos_linkagg.py +++ /dev/null @@ -1,363 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -# (c) 2017, Ansible by Red Hat, inc -# -# This file is part of Ansible by Red Hat -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. -# - -from __future__ import absolute_import, division, print_function - -__metaclass__ = type - -DOCUMENTATION = """ -module: vyos_linkagg -author: Ricardo Carrillo Cruz (@rcarrillocruz) -short_description: (deprecated, removed after 2022-06-01) Manage link aggregation - groups on VyOS network devices -description: -- This module provides declarative management of link aggregation groups on VyOS network - devices. -version_added: 1.0.0 -deprecated: - alternative: vyos_lag_interfaces - why: Updated modules released with more functionality. - removed_at_date: '2022-06-01' -notes: -- Tested against VYOS 1.1.7 -options: - name: - description: - - Name of the link aggregation group. - type: str - mode: - description: - - Mode of the link aggregation group. - default: "802.3ad" - choices: - - 802.3ad - - active-backup - - broadcast - - round-robin - - transmit-load-balance - - adaptive-load-balance - - xor-hash - - "on" - type: str - members: - description: - - List of members of the link aggregation group. - type: list - elements: str - aggregate: - description: List of link aggregation definitions. - type: list - elements: dict - suboptions: - name: - description: - - Name of the link aggregation group. - required: true - type: str - mode: - description: - - Mode of the link aggregation group. - choices: - - 802.3ad - - active-backup - - broadcast - - round-robin - - transmit-load-balance - - adaptive-load-balance - - xor-hash - - "on" - type: str - members: - description: - - List of members of the link aggregation group. - type: list - elements: str - state: - description: - - State of the link aggregation group. - choices: - - present - - absent - - up - - down - type: str - state: - description: - - State of the link aggregation group. - default: present - choices: - - present - - absent - - up - - down - type: str -extends_documentation_fragment: -- vyos.vyos.vyos - - -""" - -EXAMPLES = """ -- name: configure link aggregation group - vyos.vyos.vyos_linkagg: - name: bond0 - members: - - eth0 - - eth1 - -- name: remove configuration - vyos.vyos.vyos_linkagg: - name: bond0 - state: absent - -- name: Create aggregate of linkagg definitions - vyos.vyos.vyos_linkagg: - aggregate: - - {name: bond0, members: [eth1]} - - {name: bond1, members: [eth2]} - -- name: Remove aggregate of linkagg definitions - vyos.vyos.vyos_linkagg: - aggregate: - - name: bond0 - - name: bond1 - state: absent -""" - -RETURN = """ -commands: - description: The list of configuration mode commands to send to the device - returned: always, except for the platforms that use Netconf transport to manage the device. - type: list - sample: - - set interfaces bonding bond0 - - set interfaces ethernet eth0 bond-group 'bond0' - - set interfaces ethernet eth1 bond-group 'bond0' -""" -from copy import deepcopy - -from ansible.module_utils.basic import AnsibleModule -from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import ( - remove_default_spec, -) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - load_config, - run_commands, -) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) - - -def search_obj_in_list(name, lst): - for o in lst: - if o["name"] == name: - return o - - return None - - -def map_obj_to_commands(updates, module): - commands = list() - want, have = updates - - for w in want: - name = w["name"] - members = w.get("members") or [] - mode = w["mode"] - - if mode == "on": - mode = "802.3ad" - - state = w["state"] - - obj_in_have = search_obj_in_list(name, have) - - if state == "absent": - if obj_in_have: - for m in obj_in_have["members"]: - commands.append( - "delete interfaces ethernet " + m + " bond-group" - ) - - commands.append("delete interfaces bonding " + name) - else: - if not obj_in_have: - commands.append( - "set interfaces bonding " + name + " mode " + mode - ) - - for m in members: - commands.append( - "set interfaces ethernet " + m + " bond-group " + name - ) - - if state == "down": - commands.append( - "set interfaces bonding " + name + " disable" - ) - else: - if mode != obj_in_have["mode"]: - commands.append( - "set interfaces bonding " + name + " mode " + mode - ) - - missing_members = list( - set(members) - set(obj_in_have["members"]) - ) - for m in missing_members: - commands.append( - "set interfaces ethernet " + m + " bond-group " + name - ) - - if state == "down" and obj_in_have["state"] == "up": - commands.append( - "set interfaces bonding " + name + " disable" - ) - elif state == "up" and obj_in_have["state"] == "down": - commands.append( - "delete interfaces bonding " + name + " disable" - ) - - return commands - - -def map_config_to_obj(module): - obj = [] - output = run_commands(module, ["show interfaces bonding slaves"]) - lines = output[0].splitlines() - - if len(lines) > 1: - for line in lines[1:]: - splitted_line = line.split() - - name = splitted_line[0] - mode = splitted_line[1] - state = splitted_line[2] - - if len(splitted_line) > 4: - members = splitted_line[4:] - else: - members = [] - - obj.append( - { - "name": name, - "mode": mode, - "members": members, - "state": state, - } - ) - - return obj - - -def map_params_to_obj(module): - obj = [] - aggregate = module.params.get("aggregate") - if aggregate: - for item in aggregate: - for key in item: - if item.get(key) is None: - item[key] = module.params[key] - - obj.append(item.copy()) - else: - obj.append( - { - "name": module.params["name"], - "mode": module.params["mode"], - "members": module.params["members"], - "state": module.params["state"], - } - ) - - return obj - - -def main(): - """main entry point for module execution""" - element_spec = dict( - name=dict(), - mode=dict( - choices=[ - "802.3ad", - "active-backup", - "broadcast", - "round-robin", - "transmit-load-balance", - "adaptive-load-balance", - "xor-hash", - "on", - ], - default="802.3ad", - ), - members=dict(type="list", elements="str"), - state=dict( - default="present", choices=["present", "absent", "up", "down"] - ), - ) - - aggregate_spec = deepcopy(element_spec) - aggregate_spec["name"] = dict(required=True) - - # remove default in aggregate spec, to handle common arguments - remove_default_spec(aggregate_spec) - - argument_spec = dict( - aggregate=dict(type="list", elements="dict", options=aggregate_spec), - ) - - argument_spec.update(element_spec) - argument_spec.update(vyos_argument_spec) - - required_one_of = [["name", "aggregate"]] - mutually_exclusive = [["name", "aggregate"]] - module = AnsibleModule( - argument_spec=argument_spec, - required_one_of=required_one_of, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - - warnings = list() - - result = {"changed": False} - - if warnings: - result["warnings"] = warnings - - want = map_params_to_obj(module) - have = map_config_to_obj(module) - - commands = map_obj_to_commands((want, have), module) - result["commands"] = commands - - if commands: - commit = not module.check_mode - load_config(module, commands, commit=commit) - result["changed"] = True - - module.exit_json(**result) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/vyos_lldp.py b/plugins/modules/vyos_lldp.py deleted file mode 100644 index c1aaf5d..0000000 --- a/plugins/modules/vyos_lldp.py +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -# (c) 2017, Ansible by Red Hat, inc -# -# This file is part of Ansible by Red Hat -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. -# - -from __future__ import absolute_import, division, print_function - -__metaclass__ = type - - -DOCUMENTATION = """ -module: vyos_lldp -author: Ricardo Carrillo Cruz (@rcarrillocruz) -short_description: (deprecated, removed after 2022-06-01) Manage LLDP configuration - on VyOS network devices -description: -- This module provides declarative management of LLDP service on VyOS network devices. -version_added: 1.0.0 -deprecated: - alternative: vyos_lldp_global - why: Updated modules released with more functionality. - removed_at_date: '2022-06-01' -notes: -- Tested against VYOS 1.1.7 -options: - interfaces: - description: - - Name of the interfaces. - type: list - elements: str - state: - description: - - State of the link aggregation group. - default: present - choices: - - present - - absent - - enabled - - disabled - type: str -extends_documentation_fragment: -- vyos.vyos.vyos - - -""" - -EXAMPLES = """ -- name: Enable LLDP service - vyos.vyos.vyos_lldp: - state: present - -- name: Disable LLDP service - vyos.vyos.vyos_lldp: - state: absent -""" - -RETURN = """ -commands: - description: The list of configuration mode commands to send to the device - returned: always, except for the platforms that use Netconf transport to manage the device. - type: list - sample: - - set service lldp -""" -from ansible.module_utils.basic import AnsibleModule -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - get_config, - load_config, -) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) - - -def has_lldp(module): - config = get_config(module).splitlines() - - if "set service 'lldp'" in config or "set service lldp" in config: - return True - else: - return False - - -def main(): - """main entry point for module execution""" - argument_spec = dict( - interfaces=dict(type="list", elements="str"), - state=dict( - default="present", - choices=["present", "absent", "enabled", "disabled"], - ), - ) - - argument_spec.update(vyos_argument_spec) - - module = AnsibleModule( - argument_spec=argument_spec, supports_check_mode=True - ) - - warnings = list() - - result = {"changed": False} - - if warnings: - result["warnings"] = warnings - - HAS_LLDP = has_lldp(module) - - commands = [] - - if module.params["state"] == "absent" and HAS_LLDP: - commands.append("delete service lldp") - elif module.params["state"] == "present" and not HAS_LLDP: - commands.append("set service lldp") - - result["commands"] = commands - - if commands: - commit = not module.check_mode - load_config(module, commands, commit=commit) - result["changed"] = True - - module.exit_json(**result) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/vyos_lldp_interface.py b/plugins/modules/vyos_lldp_interface.py deleted file mode 100644 index b8bf91c..0000000 --- a/plugins/modules/vyos_lldp_interface.py +++ /dev/null @@ -1,280 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -# (c) 2017, Ansible by Red Hat, inc -# -# This file is part of Ansible by Red Hat -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. -# - -from __future__ import absolute_import, division, print_function - -__metaclass__ = type - -DOCUMENTATION = """ -module: vyos_lldp_interface -author: Ricardo Carrillo Cruz (@rcarrillocruz) -short_description: (deprecated, removed after 2022-06-01) Manage LLDP interfaces configuration - on VyOS network devices -description: -- This module provides declarative management of LLDP interfaces configuration on - VyOS network devices. -version_added: 1.0.0 -deprecated: - alternative: vyos_lldp_interfaces - why: Updated modules released with more functionality. - removed_at_date: '2022-06-01' -notes: -- Tested against VYOS 1.1.7 -options: - name: - description: - - Name of the interface LLDP should be configured on. - type: str - aggregate: - description: List of interfaces LLDP should be configured on. - type: list - elements: dict - suboptions: - name: - description: - - Name of the interface LLDP should be configured on. - required: True - type: str - state: - description: - - State of the LLDP configuration. - choices: - - present - - absent - - enabled - - disabled - type: str - state: - description: - - State of the LLDP configuration. - default: present - choices: - - present - - absent - - enabled - - disabled - type: str -extends_documentation_fragment: -- vyos.vyos.vyos - - -""" - -EXAMPLES = """ -- name: Enable LLDP on eth1 - net_lldp_interface: - state: present - -- name: Enable LLDP on specific interfaces - net_lldp_interface: - interfaces: - - eth1 - - eth2 - state: present - -- name: Disable LLDP globally - net_lldp_interface: - state: disabled - -- name: Create aggregate of LLDP interface configurations - vyos.vyos.vyos_lldp_interface: - aggregate: - - name: eth1 - - name: eth2 - state: present - -- name: Delete aggregate of LLDP interface configurations - vyos.vyos.vyos_lldp_interface: - aggregate: - - name: eth1 - - name: eth2 - state: absent -""" - -RETURN = """ -commands: - description: The list of configuration mode commands to send to the device - returned: always, except for the platforms that use Netconf transport to manage the device. - type: list - sample: - - set service lldp eth1 - - set service lldp eth2 disable -""" - - -from copy import deepcopy - -from ansible.module_utils.basic import AnsibleModule -from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import ( - remove_default_spec, -) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - get_config, - load_config, -) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) - - -def search_obj_in_list(name, lst): - for o in lst: - if o["name"] == name: - return o - - return None - - -def map_obj_to_commands(updates, module): - commands = list() - want, have = updates - - for w in want: - name = w["name"] - state = w["state"] - - obj_in_have = search_obj_in_list(name, have) - - if state == "absent" and obj_in_have: - commands.append("delete service lldp interface " + name) - elif state in ("present", "enabled"): - if not obj_in_have: - commands.append("set service lldp interface " + name) - elif ( - obj_in_have - and obj_in_have["state"] == "disabled" - and state == "enabled" - ): - commands.append( - "delete service lldp interface " + name + " disable" - ) - elif state == "disabled": - if not obj_in_have: - commands.append("set service lldp interface " + name) - commands.append( - "set service lldp interface " + name + " disable" - ) - elif obj_in_have and obj_in_have["state"] != "disabled": - commands.append( - "set service lldp interface " + name + " disable" - ) - - return commands - - -def map_config_to_obj(module): - obj = [] - config = get_config(module).splitlines() - - output = [c for c in config if c.startswith("set service lldp interface")] - - for i in output: - splitted_line = i.split() - - if len(splitted_line) > 5: - new_obj = {"name": splitted_line[4]} - - if splitted_line[5] == "'disable'": - new_obj["state"] = "disabled" - else: - new_obj = {"name": splitted_line[4][1:-1]} - new_obj["state"] = "present" - - obj.append(new_obj) - - return obj - - -def map_params_to_obj(module): - obj = [] - - aggregate = module.params.get("aggregate") - if aggregate: - for item in aggregate: - for key in item: - if item.get(key) is None: - item[key] = module.params[key] - - obj.append(item.copy()) - else: - obj.append( - {"name": module.params["name"], "state": module.params["state"]} - ) - - return obj - - -def main(): - """main entry point for module execution""" - element_spec = dict( - name=dict(), - state=dict( - default="present", - choices=["present", "absent", "enabled", "disabled"], - ), - ) - - aggregate_spec = deepcopy(element_spec) - aggregate_spec["name"] = dict(required=True) - - # remove default in aggregate spec, to handle common arguments - remove_default_spec(aggregate_spec) - - argument_spec = dict( - aggregate=dict(type="list", elements="dict", options=aggregate_spec), - ) - - argument_spec.update(element_spec) - argument_spec.update(vyos_argument_spec) - - required_one_of = [["name", "aggregate"]] - mutually_exclusive = [["name", "aggregate"]] - - module = AnsibleModule( - argument_spec=argument_spec, - required_one_of=required_one_of, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - - warnings = list() - - result = {"changed": False} - - if warnings: - result["warnings"] = warnings - - want = map_params_to_obj(module) - have = map_config_to_obj(module) - - commands = map_obj_to_commands((want, have), module) - result["commands"] = commands - - if commands: - commit = not module.check_mode - load_config(module, commands, commit=commit) - result["changed"] = True - - module.exit_json(**result) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/vyos_logging.py b/plugins/modules/vyos_logging.py index 2c160c3..4b3eaaf 100644 --- a/plugins/modules/vyos_logging.py +++ b/plugins/modules/vyos_logging.py @@ -166,9 +166,6 @@ from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import get_config, load_config, ) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) def spec_to_commands(updates, module): @@ -308,7 +305,6 @@ def main(): argument_spec.update(element_spec) - argument_spec.update(vyos_argument_spec) required_if = [ ("dest", "host", ["name", "facility", "level"]), ("dest", "file", ["name", "facility", "level"]), diff --git a/plugins/modules/vyos_ping.py b/plugins/modules/vyos_ping.py index eb89b4e..7934583 100644 --- a/plugins/modules/vyos_ping.py +++ b/plugins/modules/vyos_ping.py @@ -138,9 +138,6 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( run_commands, ) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) import re @@ -158,8 +155,6 @@ def main(): ), ) - argument_spec.update(vyos_argument_spec) - module = AnsibleModule(argument_spec=argument_spec) count = module.params["count"] diff --git a/plugins/modules/vyos_static_route.py b/plugins/modules/vyos_static_route.py deleted file mode 100644 index 7f3719d..0000000 --- a/plugins/modules/vyos_static_route.py +++ /dev/null @@ -1,335 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- - -# (c) 2017, Ansible by Red Hat, inc -# -# This file is part of Ansible by Red Hat -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. -# - -from __future__ import absolute_import, division, print_function - -__metaclass__ = type - -DOCUMENTATION = """ -module: vyos_static_route -author: Trishna Guha (@trishnaguha) -short_description: (deprecated, removed after 2022-06-01) Manage static IP routes - on Vyatta VyOS network devices -description: -- This module provides declarative management of static IP routes on Vyatta VyOS network - devices. -version_added: 1.0.0 -deprecated: - alternative: vyos_static_routes - why: Updated modules released with more functionality. - removed_at_date: '2022-06-01' -notes: -- Tested against VyOS 1.1.8 (helium). -- This module works with connection C(ansible.netcommon.network_cli). See L(the VyOS OS Platform Options,../network/user_guide/platform_vyos.html). -options: - prefix: - description: - - Network prefix of the static route. C(mask) param should be ignored if C(prefix) - is provided with C(mask) value C(prefix/mask). - type: str - mask: - description: - - Network prefix mask of the static route. - type: str - next_hop: - description: - - Next hop IP of the static route. - type: str - admin_distance: - description: - - Admin distance of the static route. - type: int - aggregate: - description: List of static route definitions - type: list - elements: dict - suboptions: - prefix: - description: - - Network prefix of the static route. C(mask) param should be ignored if C(prefix) - is provided with C(mask) value C(prefix/mask). - required: True - type: str - mask: - description: - - Network prefix mask of the static route. - type: str - next_hop: - description: - - Next hop IP of the static route. - type: str - admin_distance: - description: - - Admin distance of the static route. - type: int - state: - description: - - State of the static route configuration. - choices: - - present - - absent - type: str - state: - description: - - State of the static route configuration. - default: present - choices: - - present - - absent - type: str -extends_documentation_fragment: -- vyos.vyos.vyos - - -""" - -EXAMPLES = """ -- name: configure static route - vyos.vyos.vyos_static_route: - prefix: 192.168.2.0 - mask: 24 - next_hop: 10.0.0.1 - -- name: configure static route prefix/mask - vyos.vyos.vyos_static_route: - prefix: 192.168.2.0/16 - next_hop: 10.0.0.1 - -- name: remove configuration - vyos.vyos.vyos_static_route: - prefix: 192.168.2.0 - mask: 16 - next_hop: 10.0.0.1 - state: absent - -- name: configure aggregates of static routes - vyos.vyos.vyos_static_route: - aggregate: - - {prefix: 192.168.2.0, mask: 24, next_hop: 10.0.0.1} - - {prefix: 192.168.3.0, mask: 16, next_hop: 10.0.2.1} - - {prefix: 192.168.3.0/16, next_hop: 10.0.2.1} - -- name: Remove static route collections - vyos.vyos.vyos_static_route: - aggregate: - - {prefix: 172.24.1.0/24, next_hop: 192.168.42.64} - - {prefix: 172.24.3.0/24, next_hop: 192.168.42.64} - state: absent -""" - -RETURN = """ -commands: - description: The list of configuration mode commands to send to the device - returned: always - type: list - sample: - - set protocols static route 192.168.2.0/16 next-hop 10.0.0.1 -""" -import re - -from copy import deepcopy - -from ansible.module_utils._text import to_text -from ansible.module_utils.basic import AnsibleModule -from ansible.module_utils.common.validation import check_required_together -from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import ( - remove_default_spec, -) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - get_config, - load_config, -) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) - - -def spec_to_commands(updates, module): - commands = list() - want, have = updates - for w in want: - prefix = w["prefix"] - mask = w["mask"] - next_hop = w["next_hop"] - admin_distance = w["admin_distance"] - state = w["state"] - del w["state"] - - if state == "absent" and w in have: - commands.append( - "delete protocols static route %s/%s" % (prefix, mask) - ) - elif state == "present" and w not in have: - cmd = "set protocols static route %s/%s next-hop %s" % ( - prefix, - mask, - next_hop, - ) - if admin_distance != "None": - cmd += " distance %s" % (admin_distance) - commands.append(cmd) - - return commands - - -def config_to_dict(module): - data = get_config(module) - obj = [] - - for line in data.split("\n"): - if line.startswith("set protocols static route"): - match = re.search(r"static route (\S+)", line, re.M) - prefix = match.group(1).split("/")[0] - mask = match.group(1).split("/")[1] - if "next-hop" in line: - match_hop = re.search(r"next-hop (\S+)", line, re.M) - next_hop = match_hop.group(1).strip("'") - - match_distance = re.search(r"distance (\S+)", line, re.M) - if match_distance is not None: - admin_distance = match_distance.group(1)[1:-1] - else: - admin_distance = None - - if admin_distance is not None: - obj.append( - { - "prefix": prefix, - "mask": mask, - "next_hop": next_hop, - "admin_distance": admin_distance, - } - ) - else: - obj.append( - { - "prefix": prefix, - "mask": mask, - "next_hop": next_hop, - "admin_distance": "None", - } - ) - - return obj - - -def map_params_to_obj(module, required_together=None): - obj = [] - aggregate = module.params.get("aggregate") - if aggregate: - for item in aggregate: - for key in item: - if item.get(key) is None: - item[key] = module.params[key] - - try: - check_required_together(required_together, item) - except TypeError as exc: - module.fail_json(to_text(exc)) - d = item.copy() - if "/" in d["prefix"]: - d["mask"] = d["prefix"].split("/")[1] - d["prefix"] = d["prefix"].split("/")[0] - - if "admin_distance" in d: - d["admin_distance"] = str(d["admin_distance"]) - - obj.append(d) - else: - prefix = module.params["prefix"].strip() - if "/" in prefix: - mask = prefix.split("/")[1] - prefix = prefix.split("/")[0] - else: - mask = module.params["mask"].strip() - next_hop = module.params["next_hop"].strip() - admin_distance = str(module.params["admin_distance"]) - state = module.params["state"] - - obj.append( - { - "prefix": prefix, - "mask": mask, - "next_hop": next_hop, - "admin_distance": admin_distance, - "state": state, - } - ) - - return obj - - -def main(): - """main entry point for module execution""" - element_spec = dict( - prefix=dict(type="str"), - mask=dict(type="str"), - next_hop=dict(type="str"), - admin_distance=dict(type="int"), - state=dict(default="present", choices=["present", "absent"]), - ) - - aggregate_spec = deepcopy(element_spec) - aggregate_spec["prefix"] = dict(required=True) - - # remove default in aggregate spec, to handle common arguments - remove_default_spec(aggregate_spec) - - argument_spec = dict( - aggregate=dict(type="list", elements="dict", options=aggregate_spec) - ) - - argument_spec.update(element_spec) - argument_spec.update(vyos_argument_spec) - - required_one_of = [["aggregate", "prefix"]] - required_together = [["prefix", "next_hop"]] - mutually_exclusive = [["aggregate", "prefix"]] - - module = AnsibleModule( - argument_spec=argument_spec, - required_one_of=required_one_of, - required_together=required_together, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - - warnings = list() - - result = {"changed": False} - if warnings: - result["warnings"] = warnings - want = map_params_to_obj(module, required_together=required_together) - have = config_to_dict(module) - - commands = spec_to_commands((want, have), module) - result["commands"] = commands - - if commands: - commit = not module.check_mode - load_config(module, commands, commit=commit) - result["changed"] = True - - module.exit_json(**result) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/vyos_system.py b/plugins/modules/vyos_system.py index 4a9fdcd..fd98507 100644 --- a/plugins/modules/vyos_system.py +++ b/plugins/modules/vyos_system.py @@ -99,9 +99,6 @@ from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import get_config, load_config, ) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) def spec_key_to_device_key(key): @@ -197,8 +194,6 @@ def main(): ), ) - argument_spec.update(vyos_argument_spec) - module = AnsibleModule( argument_spec=argument_spec, supports_check_mode=True, diff --git a/plugins/modules/vyos_user.py b/plugins/modules/vyos_user.py index 6d07f9d..b2e1acc 100644 --- a/plugins/modules/vyos_user.py +++ b/plugins/modules/vyos_user.py @@ -33,6 +33,8 @@ description: collection of usernames in the current running config. It also supports purging usernames from the configuration that are not explicitly defined. version_added: 1.0.0 +extends_documentation_fragment: +- vyos.vyos.vyos notes: - Tested against VyOS 1.1.8 (helium). - This module works with connection C(ansible.netcommon.network_cli). See L(the VyOS OS Platform Options,../network/user_guide/platform_vyos.html). @@ -51,8 +53,7 @@ options: name: description: - The username to be configured on the VyOS device. This argument accepts a string - value and is mutually exclusive with the C(aggregate) argument. Please note - that this option is not same as C(provider username). + value and is mutually exclusive with the C(aggregate) argument. required: True type: str full_name: @@ -63,8 +64,7 @@ options: configured_password: description: - The password to be configured on the VyOS device. The password needs to be provided - in clear and it will be encrypted on the device. Please note that this option - is not same as C(provider password). + in clear and it will be encrypted on the device. type: str update_password: description: @@ -96,8 +96,7 @@ options: name: description: - The username to be configured on the VyOS device. This argument accepts a string - value and is mutually exclusive with the C(aggregate) argument. Please note - that this option is not same as C(provider username). + value and is mutually exclusive with the C(aggregate) argument. type: str full_name: description: @@ -107,8 +106,7 @@ options: configured_password: description: - The password to be configured on the VyOS device. The password needs to be provided - in clear and it will be encrypted on the device. Please note that this option - is not same as C(provider password). + in clear and it will be encrypted on the device. type: str update_password: description: @@ -146,8 +144,6 @@ options: choices: - present - absent -extends_documentation_fragment: -- vyos.vyos.vyos """ EXAMPLES = """ @@ -198,9 +194,6 @@ from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import load_config, ) from ansible.module_utils.six import iteritems -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) def validate_level(value, module): @@ -368,7 +361,6 @@ def main(): ) argument_spec.update(element_spec) - argument_spec.update(vyos_argument_spec) mutually_exclusive = [("name", "aggregate")] module = AnsibleModule( diff --git a/plugins/modules/vyos_vlan.py b/plugins/modules/vyos_vlan.py index 58d79d7..8325366 100644 --- a/plugins/modules/vyos_vlan.py +++ b/plugins/modules/vyos_vlan.py @@ -177,9 +177,6 @@ from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import load_config, run_commands, ) -from ansible_collections.vyos.vyos.plugins.module_utils.network.vyos.vyos import ( - vyos_argument_spec, -) def search_obj_in_list(vlan_id, lst): @@ -375,7 +372,6 @@ def main(): ) argument_spec.update(element_spec) - argument_spec.update(vyos_argument_spec) required_one_of = [ ["vlan_id", "aggregate"], diff --git a/tests/integration/targets/vyos_banner/tasks/cli.yaml b/tests/integration/targets/vyos_banner/tasks/cli.yaml index b23cb60..8f7b62f 100644 --- a/tests/integration/targets/vyos_banner/tasks/cli.yaml +++ b/tests/integration/targets/vyos_banner/tasks/cli.yaml @@ -16,11 +16,3 @@ loop_var: test_case_to_run tags: - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/integration/targets/vyos_command/tasks/cli.yaml b/tests/integration/targets/vyos_command/tasks/cli.yaml index b23cb60..8f7b62f 100644 --- a/tests/integration/targets/vyos_command/tasks/cli.yaml +++ b/tests/integration/targets/vyos_command/tasks/cli.yaml @@ -16,11 +16,3 @@ loop_var: test_case_to_run tags: - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/integration/targets/vyos_config/tasks/cli.yaml b/tests/integration/targets/vyos_config/tasks/cli.yaml index b23cb60..8f7b62f 100644 --- a/tests/integration/targets/vyos_config/tasks/cli.yaml +++ b/tests/integration/targets/vyos_config/tasks/cli.yaml @@ -16,11 +16,3 @@ loop_var: test_case_to_run tags: - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/integration/targets/vyos_facts/tasks/cli.yaml b/tests/integration/targets/vyos_facts/tasks/cli.yaml index b23cb60..8f7b62f 100644 --- a/tests/integration/targets/vyos_facts/tasks/cli.yaml +++ b/tests/integration/targets/vyos_facts/tasks/cli.yaml @@ -16,11 +16,3 @@ loop_var: test_case_to_run tags: - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/integration/targets/vyos_interface/defaults/main.yaml b/tests/integration/targets/vyos_interface/defaults/main.yaml deleted file mode 100644 index a845c24..0000000 --- a/tests/integration/targets/vyos_interface/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: '*' -test_items: [] diff --git a/tests/integration/targets/vyos_interface/tasks/cli.yaml b/tests/integration/targets/vyos_interface/tasks/cli.yaml deleted file mode 100644 index b23cb60..0000000 --- a/tests/integration/targets/vyos_interface/tasks/cli.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: '{{ role_path }}/tests/cli' - patterns: '{{ testcase }}.yaml' - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=ansible.netcommon.network_cli) - include: '{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli' - with_items: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/integration/targets/vyos_interface/tasks/main.yaml b/tests/integration/targets/vyos_interface/tasks/main.yaml deleted file mode 100644 index 07b0f2e..0000000 --- a/tests/integration/targets/vyos_interface/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include: cli.yaml diff --git a/tests/integration/targets/vyos_interface/tests/cli/basic.yaml b/tests/integration/targets/vyos_interface/tests/cli/basic.yaml deleted file mode 100644 index b50d7da..0000000 --- a/tests/integration/targets/vyos_interface/tests/cli/basic.yaml +++ /dev/null @@ -1,248 +0,0 @@ ---- -- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}" - -- name: Run vyos lsmod command - register: lsmod_out - vyos.vyos.vyos_command: - commands: - - lsmod - -- name: Set up - delete interface - vyos.vyos.vyos_interface: - name: eth1 - state: absent - -- name: Set up - Create interface - register: result - vyos.vyos.vyos_interface: - name: eth1 - state: present - description: test-interface - -- assert: - that: - - result.changed == true - - '"set interfaces ethernet eth1" in result.commands' - - "\"set interfaces ethernet eth1 description 'test-interface'\" in result.commands" - -- name: Configure interface params - when: "'virtio_net' not in lsmod_out.stdout[0]" - register: result - vyos.vyos.vyos_interface: - name: eth1 - state: present - description: test-interface-1 - speed: 100 - duplex: half - mtu: 256 - -- assert: - that: - - result.changed == true - - "\"set interfaces ethernet eth1 description 'test-interface-1'\" in result.commands" - - '"set interfaces ethernet eth1 speed 100" in result.commands' - - '"set interfaces ethernet eth1 duplex half" in result.commands' - - '"set interfaces ethernet eth1 mtu 256" in result.commands' - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- name: Configure interface params (idempotent) - register: result - when: "'virtio_net' not in lsmod_out.stdout[0]" - vyos.vyos.vyos_interface: - name: eth1 - state: present - description: test-interface-1 - speed: 100 - duplex: half - mtu: 256 - -- assert: - that: - - result.changed == false - when: "'virtio' not in lsmod_out.stdout[0]" - -- name: Change interface params - register: result - when: "'virtio_net' not in lsmod_out.stdout[0]" - vyos.vyos.vyos_interface: - name: eth1 - state: present - description: test-interface-2 - speed: 1000 - duplex: full - mtu: 512 - -- assert: - that: - - result.changed == true - - "\"set interfaces ethernet eth1 description 'test-interface-2'\" in result.commands" - - '"set interfaces ethernet eth1 speed 1000" in result.commands' - - '"set interfaces ethernet eth1 duplex full" in result.commands' - - '"set interfaces ethernet eth1 mtu 512" in result.commands' - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- name: Disable interface - register: result - vyos.vyos.vyos_interface: - name: eth1 - enabled: false - -- assert: - that: - - result.changed == true - - '"set interfaces ethernet eth1 disable" in result.commands' - -- name: Enable interface - register: result - vyos.vyos.vyos_interface: - name: eth1 - enabled: true - -- assert: - that: - - result.changed == true - - '"delete interfaces ethernet eth1 disable" in result.commands' - -- name: Delete interface - register: result - vyos.vyos.vyos_interface: - name: eth1 - state: absent - -- assert: - that: - - result.changed == true - - '"delete interfaces ethernet eth1" in result.commands' - -- name: Delete interface (idempotent) - register: result - vyos.vyos.vyos_interface: - name: eth1 - state: absent - -- assert: - that: - - result.changed == false - -- name: Aggregate setup- delete interface - register: result - vyos.vyos.vyos_interface: - name: eth2 - state: absent - -- name: Set interface on aggregate - register: result - when: "'virtio_net' not in lsmod_out.stdout[0]" - vyos.vyos.vyos_interface: - aggregate: - - - name: eth1 - description: test-interface-1 - speed: 100 - duplex: half - mtu: 512 - - - name: eth2 - description: test-interface-2 - speed: 1000 - duplex: full - mtu: 256 - -- assert: - that: - - result.changed == true - - "\"set interfaces ethernet eth1 description 'test-interface-1'\" in result.commands" - - '"set interfaces ethernet eth1 speed 100" in result.commands' - - '"set interfaces ethernet eth1 duplex half" in result.commands' - - '"set interfaces ethernet eth1 mtu 512" in result.commands' - - "\"set interfaces ethernet eth2 description 'test-interface-2'\" in result.commands" - - '"set interfaces ethernet eth2 speed 1000" in result.commands' - - '"set interfaces ethernet eth2 duplex full" in result.commands' - - '"set interfaces ethernet eth2 mtu 256" in result.commands' - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- name: Set interface on aggregate (idempotent) - register: result - when: "'virtio_net' not in lsmod_out.stdout[0]" - vyos.vyos.vyos_interface: - aggregate: - - - name: eth1 - description: test-interface-1 - speed: 100 - duplex: half - mtu: 512 - - - name: eth2 - description: test-interface-2 - speed: 1000 - duplex: full - mtu: 256 - -- assert: - that: - - result.changed == false - when: "'virtio_net' not in lsmod_out.stdout[0]" - -- name: Disable interface on aggregate - register: result - vyos.vyos.vyos_interface: - aggregate: - - - name: eth1 - - - name: eth2 - description: test-interface - enabled: false - -- assert: - that: - - result.changed == true - - '"set interfaces ethernet eth1 disable" in result.commands' - - '"set interfaces ethernet eth2 disable" in result.commands' - -- name: Enable interface on aggregate - register: result - vyos.vyos.vyos_interface: - aggregate: - - - name: eth1 - - - name: eth2 - enabled: true - -- assert: - that: - - result.changed == true - - '"delete interfaces ethernet eth1 disable" in result.commands' - - '"delete interfaces ethernet eth2 disable" in result.commands' - -- name: Delete interface aggregate - register: result - vyos.vyos.vyos_interface: - aggregate: - - - name: eth1 - - - name: eth2 - state: absent - -- assert: - that: - - result.changed == true - - '"delete interfaces ethernet eth1" in result.commands' - - '"delete interfaces ethernet eth2" in result.commands' - -- name: Delete interface aggregate (idempotent) - register: result - vyos.vyos.vyos_interface: - aggregate: - - - name: eth1 - - - name: eth2 - state: absent - -- assert: - that: - - result.changed == false diff --git a/tests/integration/targets/vyos_l3_interface/defaults/main.yaml b/tests/integration/targets/vyos_l3_interface/defaults/main.yaml deleted file mode 100644 index a845c24..0000000 --- a/tests/integration/targets/vyos_l3_interface/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: '*' -test_items: [] diff --git a/tests/integration/targets/vyos_l3_interface/tasks/cli.yaml b/tests/integration/targets/vyos_l3_interface/tasks/cli.yaml deleted file mode 100644 index b23cb60..0000000 --- a/tests/integration/targets/vyos_l3_interface/tasks/cli.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: '{{ role_path }}/tests/cli' - patterns: '{{ testcase }}.yaml' - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=ansible.netcommon.network_cli) - include: '{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli' - with_items: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/integration/targets/vyos_l3_interface/tasks/main.yaml b/tests/integration/targets/vyos_l3_interface/tasks/main.yaml deleted file mode 100644 index 07b0f2e..0000000 --- a/tests/integration/targets/vyos_l3_interface/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include: cli.yaml diff --git a/tests/integration/targets/vyos_l3_interface/tests/cli/basic.yaml b/tests/integration/targets/vyos_l3_interface/tests/cli/basic.yaml deleted file mode 100644 index 2ffb1ab..0000000 --- a/tests/integration/targets/vyos_l3_interface/tests/cli/basic.yaml +++ /dev/null @@ -1,231 +0,0 @@ ---- -- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}" - -- name: Remove IP address - vyos.vyos.vyos_l3_interface: - name: eth1 - state: absent - -- name: Remove IP address - vyos.vyos.vyos_l3_interface: - name: eth2 - state: absent - -- name: Set IPv4 address - register: result - vyos.vyos.vyos_l3_interface: - name: eth1 - ipv4: 192.168.2.10/24 - -- assert: - that: - - result.changed == true - - '"set interfaces ethernet eth1 address 192.168.2.10/24" in result.commands' - -- name: Set IPv4 address (idempotent) - register: result - vyos.vyos.vyos_l3_interface: - name: eth1 - ipv4: 192.168.2.10/24 - -- assert: - that: - - result.changed == false - -- name: Set IPv6 address - register: result - vyos.vyos.vyos_l3_interface: - name: eth1 - ipv6: fd5d:12c9:2201:1::1/64 - -- assert: - that: - - result.changed == true - - '"set interfaces ethernet eth1 address fd5d:12c9:2201:1::1/64" in result.commands' - -- name: Set IPv6 address (idempotent) - register: result - vyos.vyos.vyos_l3_interface: - name: eth1 - ipv6: fd5d:12c9:2201:1::1/64 - -- assert: - that: - - result.changed == false - -- name: Remove all IP addresses - register: result - vyos.vyos.vyos_l3_interface: - name: eth1 - state: absent - -- assert: - that: - - result.changed == true - - '"delete interfaces ethernet eth1 address" in result.commands' - -- name: Remove all IP addresses again (idempotent) - register: result - vyos.vyos.vyos_l3_interface: - name: eth1 - state: absent - -- assert: - that: - - result.changed == false - -- name: Set IPv4 and IPv6 address - register: result - vyos.vyos.vyos_l3_interface: - name: eth1 - ipv4: 192.168.2.10/24 - ipv6: fd5d:12c9:2201:1::1/64 - -- assert: - that: - - result.changed == true - - '"set interfaces ethernet eth1 address 192.168.2.10/24" in result.commands' - - '"set interfaces ethernet eth1 address fd5d:12c9:2201:1::1/64" in result.commands' - -- name: Set IPv4 and IPv6 address again (idempotent) - register: result - vyos.vyos.vyos_l3_interface: - name: eth1 - ipv4: 192.168.2.10/24 - ipv6: fd5d:12c9:2201:1::1/64 - -- assert: - that: - - result.changed == false - -- name: Remove IPv4 address - register: result - vyos.vyos.vyos_l3_interface: - name: eth1 - ipv4: 192.168.2.10/24 - state: absent - -- assert: - that: - - result.changed == true - - '"delete interfaces ethernet eth1 address 192.168.2.10/24" in result.commands' - -- name: Remove IPv4 address again (idempotent) - register: result - vyos.vyos.vyos_l3_interface: - name: eth1 - ipv4: 192.168.2.10/24 - state: absent - -- assert: - that: - - result.changed == false - -- name: Remove IPv6 address - register: result - vyos.vyos.vyos_l3_interface: - name: eth1 - ipv6: fd5d:12c9:2201:1::1/64 - state: absent - -- assert: - that: - - result.changed == true - - '"delete interfaces ethernet eth1 address fd5d:12c9:2201:1::1/64" in result.commands' - -- name: Remove IPv6 address again (idempotent) - register: result - vyos.vyos.vyos_l3_interface: - name: eth1 - ipv6: fd5d:12c9:2201:1::1/64 - state: absent - -- assert: - that: - - result.changed == false - -- name: Set IP addresses on aggregate - register: result - vyos.vyos.vyos_l3_interface: - aggregate: - - - name: eth1 - ipv4: 192.168.2.10/24 - - - name: eth2 - ipv4: 192.168.3.10/24 - ipv6: fd5d:12c9:2201:1::1/64 - - - name: eth2 - ipv4: 192.168.4.10/24 - -- assert: - that: - - result.changed == true - - '"set interfaces ethernet eth1 address 192.168.2.10/24" in result.commands' - - '"set interfaces ethernet eth2 address 192.168.3.10/24" in result.commands' - - '"set interfaces ethernet eth2 address fd5d:12c9:2201:1::1/64" in result.commands' - - '"set interfaces ethernet eth2 address 192.168.4.10/24" in result.commands' - -- name: Set IP addresses on aggregate (idempotent) - register: result - vyos.vyos.vyos_l3_interface: - aggregate: - - - name: eth1 - ipv4: 192.168.2.10/24 - - - name: eth2 - ipv4: 192.168.3.10/24 - ipv6: fd5d:12c9:2201:1::1/64 - - - name: eth2 - ipv4: 192.168.4.10/24 - -- assert: - that: - - result.changed == false - -- name: Remove IP addresses on aggregate - register: result - vyos.vyos.vyos_l3_interface: - aggregate: - - - name: eth1 - ipv4: 192.168.2.10/24 - - - name: eth2 - ipv4: 192.168.3.10/24 - ipv6: fd5d:12c9:2201:1::1/64 - - - name: eth2 - ipv4: 192.168.4.10/24 - state: absent - -- assert: - that: - - result.changed == true - - '"delete interfaces ethernet eth1 address 192.168.2.10/24" in result.commands' - - '"delete interfaces ethernet eth2 address 192.168.3.10/24" in result.commands' - - '"delete interfaces ethernet eth2 address fd5d:12c9:2201:1::1/64" in result.commands' - - '"delete interfaces ethernet eth2 address 192.168.4.10/24" in result.commands' - -- name: Remove IP addresses on aggregate (idempotent) - register: result - vyos.vyos.vyos_l3_interface: - aggregate: - - - name: eth1 - ipv4: 192.168.2.10/24 - - - name: eth2 - ipv4: 192.168.3.10/24 - ipv6: fd5d:12c9:2201:1::1/64 - - - name: eth2 - ipv4: 192.168.4.10/24 - state: absent - -- assert: - that: - - result.changed == false diff --git a/tests/integration/targets/vyos_linkagg/defaults/main.yaml b/tests/integration/targets/vyos_linkagg/defaults/main.yaml deleted file mode 100644 index a845c24..0000000 --- a/tests/integration/targets/vyos_linkagg/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: '*' -test_items: [] diff --git a/tests/integration/targets/vyos_linkagg/tasks/cli.yaml b/tests/integration/targets/vyos_linkagg/tasks/cli.yaml deleted file mode 100644 index b23cb60..0000000 --- a/tests/integration/targets/vyos_linkagg/tasks/cli.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: '{{ role_path }}/tests/cli' - patterns: '{{ testcase }}.yaml' - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=ansible.netcommon.network_cli) - include: '{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli' - with_items: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/integration/targets/vyos_linkagg/tasks/main.yaml b/tests/integration/targets/vyos_linkagg/tasks/main.yaml deleted file mode 100644 index 07b0f2e..0000000 --- a/tests/integration/targets/vyos_linkagg/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include: cli.yaml diff --git a/tests/integration/targets/vyos_linkagg/tests/cli/basic.yaml b/tests/integration/targets/vyos_linkagg/tests/cli/basic.yaml deleted file mode 100644 index ffe0c42..0000000 --- a/tests/integration/targets/vyos_linkagg/tests/cli/basic.yaml +++ /dev/null @@ -1,200 +0,0 @@ ---- -- debug: msg="cli/basic.yaml on connection={{ ansible_connection }}" - -- name: Remove linkagg - vyos.vyos.vyos_linkagg: - name: bond0 - state: absent - -- name: Remove linkagg - vyos.vyos.vyos_linkagg: - name: bond1 - state: absent - -- name: Create linkagg - register: result - vyos.vyos.vyos_linkagg: - name: bond0 - members: - - eth1 - state: present - -- assert: - that: - - result.changed == true - - '"set interfaces bonding bond0 mode 802.3ad" in result.commands' - - '"set interfaces ethernet eth1 bond-group bond0" in result.commands' - -- name: Create linkagg again (idempotent) - register: result - vyos.vyos.vyos_linkagg: - name: bond0 - members: - - eth1 - state: present - -- assert: - that: - - result.changed == false - -- name: Add linkagg member - register: result - vyos.vyos.vyos_linkagg: - name: bond0 - members: - - eth2 - state: present - -- assert: - that: - - result.changed == true - - '"set interfaces ethernet eth2 bond-group bond0" in result.commands' - -- name: Add linkagg member again (idempotent) - register: result - vyos.vyos.vyos_linkagg: - name: bond0 - members: - - eth2 - state: present - -- assert: - that: - - result.changed == false - -- name: Disable linkagg - register: result - vyos.vyos.vyos_linkagg: - name: bond0 - state: down - -- assert: - that: - - result.changed == true - - '"set interfaces bonding bond0 disable" in result.commands' - -- name: Disable linkagg again (idempotent) - register: result - vyos.vyos.vyos_linkagg: - name: bond0 - state: down - -- assert: - that: - - result.changed == false - -- name: Enable linkagg - register: result - vyos.vyos.vyos_linkagg: - name: bond0 - state: up - -- assert: - that: - - result.changed == true - - '"delete interfaces bonding bond0 disable" in result.commands[0]' - -- name: Enable linkagg again (idempotent) - register: result - vyos.vyos.vyos_linkagg: - name: bond0 - state: up - -- assert: - that: - - result.changed == false - -- name: Remove linkagg - register: result - vyos.vyos.vyos_linkagg: - name: bond0 - state: absent - -- assert: - that: - - result.changed == true - - '"delete interfaces ethernet eth1 bond-group" in result.commands' - - '"delete interfaces ethernet eth2 bond-group" in result.commands' - - '"delete interfaces bonding bond0" in result.commands' - -- name: Remove linkagg again (idempotent) - register: result - vyos.vyos.vyos_linkagg: - name: bond0 - state: absent - -- assert: - that: - - result.changed == false - -- name: Create collection of linkagg definitions - register: result - vyos.vyos.vyos_linkagg: - aggregate: - - - name: bond0 - members: - - eth1 - - - name: bond1 - members: - - eth2 - state: present - -- assert: - that: - - result.changed == true - - '"set interfaces bonding bond0 mode 802.3ad" in result.commands' - - '"set interfaces ethernet eth1 bond-group bond0" in result.commands' - - '"set interfaces bonding bond1 mode 802.3ad" in result.commands' - - '"set interfaces ethernet eth2 bond-group bond1" in result.commands' - -- name: Create collection of linkagg definitions again (idempotent) - register: result - vyos.vyos.vyos_linkagg: - aggregate: - - - name: bond0 - members: - - eth1 - - - name: bond1 - members: - - eth2 - state: present - -- assert: - that: - - result.changed == false - -- name: Remove collection of linkagg definitions - register: result - vyos.vyos.vyos_linkagg: - aggregate: - - - name: bond0 - - - name: bond1 - state: absent - -- assert: - that: - - result.changed == true - - '"delete interfaces ethernet eth1 bond-group" in result.commands' - - '"delete interfaces bonding bond0" in result.commands' - - '"delete interfaces ethernet eth2 bond-group" in result.commands' - - '"delete interfaces bonding bond1" in result.commands' - -- name: Remove collection of linkagg definitions again (idempotent) - register: result - vyos.vyos.vyos_linkagg: - aggregate: - - - name: bond0 - - - name: bond1 - state: absent - -- assert: - that: - - result.changed == false diff --git a/tests/integration/targets/vyos_lldp/aliases b/tests/integration/targets/vyos_lldp/aliases deleted file mode 100644 index 8071e1f..0000000 --- a/tests/integration/targets/vyos_lldp/aliases +++ /dev/null @@ -1 +0,0 @@ -shippable/vyos/group1 diff --git a/tests/integration/targets/vyos_lldp/defaults/main.yaml b/tests/integration/targets/vyos_lldp/defaults/main.yaml deleted file mode 100644 index a845c24..0000000 --- a/tests/integration/targets/vyos_lldp/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: '*' -test_items: [] diff --git a/tests/integration/targets/vyos_lldp/tasks/cli.yaml b/tests/integration/targets/vyos_lldp/tasks/cli.yaml deleted file mode 100644 index b23cb60..0000000 --- a/tests/integration/targets/vyos_lldp/tasks/cli.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: '{{ role_path }}/tests/cli' - patterns: '{{ testcase }}.yaml' - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=ansible.netcommon.network_cli) - include: '{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli' - with_items: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/integration/targets/vyos_lldp/tasks/main.yaml b/tests/integration/targets/vyos_lldp/tasks/main.yaml deleted file mode 100644 index 07b0f2e..0000000 --- a/tests/integration/targets/vyos_lldp/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include: cli.yaml diff --git a/tests/integration/targets/vyos_lldp/tests/cli/basic.yaml b/tests/integration/targets/vyos_lldp/tests/cli/basic.yaml deleted file mode 100644 index b108bbf..0000000 --- a/tests/integration/targets/vyos_lldp/tests/cli/basic.yaml +++ /dev/null @@ -1,44 +0,0 @@ ---- -- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}" - -- name: Make sure LLDP is not running before tests - vyos.vyos.vyos_config: - lines: delete service lldp - -- name: Enable LLDP service - register: result - vyos.vyos.vyos_lldp: - state: present - -- assert: - that: - - result.changed == true - - '"set service lldp" in result.commands' - -- name: Enable LLDP service again (idempotent) - register: result - vyos.vyos.vyos_lldp: - state: present - -- assert: - that: - - result.changed == false - -- name: Disable LLDP service - register: result - vyos.vyos.vyos_lldp: - state: absent - -- assert: - that: - - result.changed == true - - '"delete service lldp" in result.commands' - -- name: - register: result - vyos.vyos.vyos_lldp: - state: absent - -- assert: - that: - - result.changed == false diff --git a/tests/integration/targets/vyos_lldp_interface/aliases b/tests/integration/targets/vyos_lldp_interface/aliases deleted file mode 100644 index 8071e1f..0000000 --- a/tests/integration/targets/vyos_lldp_interface/aliases +++ /dev/null @@ -1 +0,0 @@ -shippable/vyos/group1 diff --git a/tests/integration/targets/vyos_lldp_interface/defaults/main.yaml b/tests/integration/targets/vyos_lldp_interface/defaults/main.yaml deleted file mode 100644 index a845c24..0000000 --- a/tests/integration/targets/vyos_lldp_interface/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: '*' -test_items: [] diff --git a/tests/integration/targets/vyos_lldp_interface/tasks/cli.yaml b/tests/integration/targets/vyos_lldp_interface/tasks/cli.yaml deleted file mode 100644 index b23cb60..0000000 --- a/tests/integration/targets/vyos_lldp_interface/tasks/cli.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: '{{ role_path }}/tests/cli' - patterns: '{{ testcase }}.yaml' - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=ansible.netcommon.network_cli) - include: '{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli' - with_items: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/integration/targets/vyos_lldp_interface/tasks/main.yaml b/tests/integration/targets/vyos_lldp_interface/tasks/main.yaml deleted file mode 100644 index 07b0f2e..0000000 --- a/tests/integration/targets/vyos_lldp_interface/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include: cli.yaml diff --git a/tests/integration/targets/vyos_lldp_interface/tests/cli/basic.yaml b/tests/integration/targets/vyos_lldp_interface/tests/cli/basic.yaml deleted file mode 100644 index 2697f48..0000000 --- a/tests/integration/targets/vyos_lldp_interface/tests/cli/basic.yaml +++ /dev/null @@ -1,181 +0,0 @@ ---- -- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}" - -- name: Make sure LLDP is not running before tests - vyos.vyos.vyos_config: - lines: delete service lldp - -- name: Create LLDP configuration - register: result - vyos.vyos.vyos_lldp_interface: - name: eth1 - state: present - -- assert: - that: - - result.changed == true - - '"set service lldp interface eth1" in result.commands' - -- name: Create LLDP configuration again (idempotent) - register: result - vyos.vyos.vyos_lldp_interface: - name: eth1 - state: present - -- assert: - that: - - result.changed == false - -- name: Disable LLDP configuration - register: result - vyos.vyos.vyos_lldp_interface: - name: eth1 - state: disabled - -- assert: - that: - - result.changed == true - - '"set service lldp interface eth1 disable" in result.commands' - -- name: Disable LLDP configuration again (idempotent) - register: result - vyos.vyos.vyos_lldp_interface: - name: eth1 - state: disabled - -- assert: - that: - - result.changed == false - -- name: Enable LLDP configuration - register: result - vyos.vyos.vyos_lldp_interface: - name: eth1 - state: enabled - -- assert: - that: - - result.changed == true - - '"delete service lldp interface eth1 disable" in result.commands' - -- name: Enable LLDP configuration again (idempotent) - register: result - vyos.vyos.vyos_lldp_interface: - name: eth1 - state: enabled - -- assert: - that: - - result.changed == false - -- name: Delete LLDP configuration - register: result - vyos.vyos.vyos_lldp_interface: - name: eth1 - state: absent - -- assert: - that: - - result.changed == true - - '"delete service lldp interface eth1" in result.commands' - -- name: Delete LLDP configuration again (idempotent) - register: result - vyos.vyos.vyos_lldp_interface: - name: eth1 - state: absent - -- assert: - that: - - result.changed == false - -- name: Create aggregate of LLDP interface configurations - register: result - vyos.vyos.vyos_lldp_interface: - aggregate: - - - name: eth1 - - - name: eth2 - state: present - -- assert: - that: - - result.changed == true - - '"set service lldp interface eth1" in result.commands' - - '"set service lldp interface eth2" in result.commands' - -- name: Create aggregate of LLDP interface configurations again (idempotent) - register: result - vyos.vyos.vyos_lldp_interface: - aggregate: - - - name: eth1 - - - name: eth2 - state: present - -- assert: - that: - - result.changed == false - -- name: Override LLDP interface configuration on aggregate - register: result - vyos.vyos.vyos_lldp_interface: - aggregate: - - - name: eth1 - - - name: eth2 - state: disabled - state: present - -- assert: - that: - - result.changed == true - - '"set service lldp interface eth2 disable" in result.commands' - -- name: Override LLDP interface configuration on aggregate again (idempotent) - register: result - vyos.vyos.vyos_lldp_interface: - aggregate: - - - name: eth1 - - - name: eth2 - state: disabled - state: present - -- assert: - that: - - result.changed == false - -- name: Delete aggregate of LLDP interface configurations - register: result - vyos.vyos.vyos_lldp_interface: - aggregate: - - - name: eth1 - - - name: eth2 - state: absent - -- assert: - that: - - result.changed == true - - '"delete service lldp interface eth1" in result.commands' - - '"delete service lldp interface eth2" in result.commands' - -- name: Delete aggregate of LLDP interface configurations (idempotent) - register: result - vyos.vyos.vyos_lldp_interface: - aggregate: - - - name: eth1 - - - name: eth2 - state: absent - -- assert: - that: - - result.changed == false diff --git a/tests/integration/targets/vyos_logging/tasks/cli.yaml b/tests/integration/targets/vyos_logging/tasks/cli.yaml index b23cb60..8f7b62f 100644 --- a/tests/integration/targets/vyos_logging/tasks/cli.yaml +++ b/tests/integration/targets/vyos_logging/tasks/cli.yaml @@ -16,11 +16,3 @@ loop_var: test_case_to_run tags: - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/integration/targets/vyos_static_route/aliases b/tests/integration/targets/vyos_static_route/aliases deleted file mode 100644 index 8071e1f..0000000 --- a/tests/integration/targets/vyos_static_route/aliases +++ /dev/null @@ -1 +0,0 @@ -shippable/vyos/group1 diff --git a/tests/integration/targets/vyos_static_route/defaults/main.yaml b/tests/integration/targets/vyos_static_route/defaults/main.yaml deleted file mode 100644 index a845c24..0000000 --- a/tests/integration/targets/vyos_static_route/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -testcase: '*' -test_items: [] diff --git a/tests/integration/targets/vyos_static_route/tasks/cli.yaml b/tests/integration/targets/vyos_static_route/tasks/cli.yaml deleted file mode 100644 index b23cb60..0000000 --- a/tests/integration/targets/vyos_static_route/tasks/cli.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- name: collect all cli test cases - find: - paths: '{{ role_path }}/tests/cli' - patterns: '{{ testcase }}.yaml' - register: test_cases - delegate_to: localhost - -- name: set test_items - set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - -- name: run test case (connection=ansible.netcommon.network_cli) - include: '{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli' - with_items: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/integration/targets/vyos_static_route/tasks/main.yaml b/tests/integration/targets/vyos_static_route/tasks/main.yaml deleted file mode 100644 index 07b0f2e..0000000 --- a/tests/integration/targets/vyos_static_route/tasks/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include: cli.yaml diff --git a/tests/integration/targets/vyos_static_route/tests/cli/basic.yaml b/tests/integration/targets/vyos_static_route/tests/cli/basic.yaml deleted file mode 100644 index be93e89..0000000 --- a/tests/integration/targets/vyos_static_route/tests/cli/basic.yaml +++ /dev/null @@ -1,137 +0,0 @@ ---- -- debug: msg="START cli/basic.yaml on connection={{ ansible_connection }}" - -- name: create static route - register: result - vyos.vyos.vyos_static_route: - prefix: 172.24.0.0/24 - next_hop: 192.168.42.64 - state: present - -- assert: - that: - - result.changed == true - - '"set protocols static route 172.24.0.0/24 next-hop 192.168.42.64" in result.commands' - -- name: create static route again (idempotent) - register: result - vyos.vyos.vyos_static_route: - prefix: 172.24.0.0 - mask: 24 - next_hop: 192.168.42.64 - state: present - -- assert: - that: - - result.changed == false - -- name: modify admin distance of static route - register: result - vyos.vyos.vyos_static_route: - prefix: 172.24.0.0/24 - next_hop: 192.168.42.64 - admin_distance: 1 - state: present - -- assert: - that: - - result.changed == true - - '"set protocols static route 172.24.0.0/24 next-hop 192.168.42.64 distance - 1" in result.commands' - -- name: modify admin distance of static route again (idempotent) - register: result - vyos.vyos.vyos_static_route: - prefix: 172.24.0.0 - mask: 24 - next_hop: 192.168.42.64 - admin_distance: 1 - state: present - -- assert: - that: - - result.changed == false - -- name: delete static route - register: result - vyos.vyos.vyos_static_route: - prefix: 172.24.0.0/24 - next_hop: 192.168.42.64 - admin_distance: 1 - state: absent - -- assert: - that: - - result.changed == true - - '"delete protocols static route 172.24.0.0/24" in result.commands' - -- name: delete static route again (idempotent) - register: result - vyos.vyos.vyos_static_route: - prefix: 172.24.0.0/24 - next_hop: 192.168.42.64 - admin_distance: 1 - state: absent - -- assert: - that: - - result.changed == false - -- name: Add static route collections - register: result - vyos.vyos.vyos_static_route: - aggregate: - - - prefix: 172.24.1.0/24 - next_hop: 192.168.42.64 - - - prefix: 172.24.2.0 - mask: 24 - next_hop: 192.168.42.64 - state: present - -- assert: - that: - - result.changed == true - - '"set protocols static route 172.24.1.0/24 next-hop 192.168.42.64" in result.commands' - - '"set protocols static route 172.24.2.0/24 next-hop 192.168.42.64" in result.commands' - -- name: Add and remove static route collections with overrides - register: result - vyos.vyos.vyos_static_route: - aggregate: - - - prefix: 172.24.1.0/24 - next_hop: 192.168.42.64 - - - prefix: 172.24.2.0/24 - next_hop: 192.168.42.64 - state: absent - - - prefix: 172.24.3.0/24 - next_hop: 192.168.42.64 - state: present - -- assert: - that: - - result.changed == true - - '"delete protocols static route 172.24.2.0/24" in result.commands' - - '"set protocols static route 172.24.3.0/24 next-hop 192.168.42.64" in result.commands' - -- name: Remove static route collections - register: result - vyos.vyos.vyos_static_route: - aggregate: - - - prefix: 172.24.1.0/24 - next_hop: 192.168.42.64 - - - prefix: 172.24.3.0/24 - next_hop: 192.168.42.64 - state: absent - -- assert: - that: - - result.changed == true - - '"delete protocols static route 172.24.1.0/24" in result.commands' - - '"delete protocols static route 172.24.3.0/24" in result.commands' diff --git a/tests/integration/targets/vyos_system/tasks/cli.yaml b/tests/integration/targets/vyos_system/tasks/cli.yaml index b23cb60..8f7b62f 100644 --- a/tests/integration/targets/vyos_system/tasks/cli.yaml +++ b/tests/integration/targets/vyos_system/tasks/cli.yaml @@ -16,11 +16,3 @@ loop_var: test_case_to_run tags: - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/integration/targets/vyos_user/tasks/cli.yaml b/tests/integration/targets/vyos_user/tasks/cli.yaml index b23cb60..8f7b62f 100644 --- a/tests/integration/targets/vyos_user/tasks/cli.yaml +++ b/tests/integration/targets/vyos_user/tasks/cli.yaml @@ -16,11 +16,3 @@ loop_var: test_case_to_run tags: - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/integration/targets/vyos_vlan/tasks/cli.yaml b/tests/integration/targets/vyos_vlan/tasks/cli.yaml index b23cb60..8f7b62f 100644 --- a/tests/integration/targets/vyos_vlan/tasks/cli.yaml +++ b/tests/integration/targets/vyos_vlan/tasks/cli.yaml @@ -16,11 +16,3 @@ loop_var: test_case_to_run tags: - network_cli - -- name: run test case (connection=local) - include: '{{ test_case_to_run }} ansible_connection=local' - with_first_found: '{{ test_items }}' - loop_control: - loop_var: test_case_to_run - tags: - - local diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 59d08b5..5a69ef6 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -1,15 +1,3 @@ -plugins/modules/vyos_interface.py validate-modules:deprecation-mismatch # 2.9 expects METADATA -plugins/modules/vyos_interface.py validate-modules:invalid-documentation # removed_at_date not supported in `deprecated` dict -plugins/modules/vyos_l3_interface.py validate-modules:deprecation-mismatch # 2.9 expects METADATA -plugins/modules/vyos_l3_interface.py validate-modules:invalid-documentation # removed_at_date not supported in `deprecated` dict -plugins/modules/vyos_linkagg.py validate-modules:deprecation-mismatch # 2.9 expects METADATA -plugins/modules/vyos_linkagg.py validate-modules:invalid-documentation # removed_at_date not supported in `deprecated` dict -plugins/modules/vyos_static_route.py validate-modules:deprecation-mismatch # 2.9 expects METADATA -plugins/modules/vyos_static_route.py validate-modules:invalid-documentation # removed_at_date not supported in `deprecated` dict -plugins/modules/vyos_lldp.py validate-modules:deprecation-mismatch # 2.9 expects METADATA -plugins/modules/vyos_lldp.py validate-modules:invalid-documentation # removed_at_date not supported in `deprecated` dict -plugins/modules/vyos_lldp_interface.py validate-modules:deprecation-mismatch # 2.9 expects METADATA -plugins/modules/vyos_lldp_interface.py validate-modules:invalid-documentation # removed_at_date not supported in `deprecated` dict plugins/modules/vyos_logging.py validate-modules:deprecation-mismatch # 2.9 expects METADATA plugins/modules/vyos_logging.py validate-modules:invalid-documentation # removed_at_date not supported in `deprecated` dict plugins/action/vyos.py action-plugin-docs # base class for deprecated network platform modules using `connection: local` diff --git a/tests/unit/modules/network/vyos/test_vyos_interface.py b/tests/unit/modules/network/vyos/test_vyos_interface.py deleted file mode 100644 index 0e959c3..0000000 --- a/tests/unit/modules/network/vyos/test_vyos_interface.py +++ /dev/null @@ -1,288 +0,0 @@ -# (c) 2016 Red Hat Inc. -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. - -# Make coding more python3-ish -from __future__ import absolute_import, division, print_function - -__metaclass__ = type - -from ansible_collections.vyos.vyos.tests.unit.compat.mock import patch -from ansible_collections.vyos.vyos.plugins.modules import vyos_interface -from ansible_collections.vyos.vyos.tests.unit.modules.utils import ( - set_module_args, -) -from .vyos_module import TestVyosModule, load_fixture - - -class TestVyosInterfaceModule(TestVyosModule): - - module = vyos_interface - - def setUp(self): - super(TestVyosInterfaceModule, self).setUp() - self.mock_get_config = patch( - "ansible_collections.vyos.vyos.plugins.modules.vyos_interface.get_config" - ) - self.get_config = self.mock_get_config.start() - - self.mock_load_config = patch( - "ansible_collections.vyos.vyos.plugins.modules.vyos_interface.load_config" - ) - self.load_config = self.mock_load_config.start() - - self.mock_execute_interfaces_command = patch( - "ansible_collections.vyos.vyos.plugins.modules.vyos_interface.get_interfaces_data" - ) - self.execute_interfaces_command = ( - self.mock_execute_interfaces_command.start() - ) - self.mock_execute_lldp_command = patch( - "ansible_collections.vyos.vyos.plugins.modules.vyos_interface.get_lldp_neighbor" - ) - self.execute_lldp_command = self.mock_execute_lldp_command.start() - - # self.mock_get_config = patch( - # "ansible_collections.ansible.netcommon.plugins.module_utils.network.common.network.Config.get_config" - # ) - # self.get_config = self.mock_get_config.start() - - # self.mock_load_config = patch( - # "ansible_collections.ansible.netcommon.plugins.module_utils.network.common.network.Config.load_config" - # ) - # self.load_config = self.mock_load_config.start() - - # self.mock_get_resource_connection_config = patch( - # "ansible_collections.ansible.netcommon.plugins.module_utils.network.common.cfg.base.get_resource_connection" - # ) - # self.get_resource_connection_config = ( - # self.mock_get_resource_connection_config.start() - # ) - - # self.mock_get_resource_connection_facts = patch( - # "ansible_collections.ansible.netcommon.plugins.module_utils.network.common.facts.facts.get_resource_connection" - # ) - # self.get_resource_connection_facts = ( - # self.mock_get_resource_connection_facts.start() - # ) - - def tearDown(self): - super(TestVyosInterfaceModule, self).tearDown() - self.mock_get_config.stop() - self.mock_load_config.stop() - self.mock_execute_lldp_command.stop() - self.mock_execute_interfaces_command.stop() - - def load_fixtures(self, commands=None, filename=None): - self.get_config.return_value = load_fixture( - "vyos_interface_config.cfg" - ) - self.execute_interfaces_command.return_value = [ - 0, - load_fixture("vyos_interface_config.cfg"), - None, - ] - self.execute_lldp_command.return_value = [ - 0, - load_fixture("vyos_lldp_neighbor_config.cfg"), - None, - ] - self.load_config.return_value = dict(diff=None, session="session") - - def test_vyos_setup_int(self): - set_module_args( - dict( - name="eth1", - enabled=True, - state="present", - speed="100", - duplex="half", - ) - ) - commands = [ - "set interfaces ethernet eth1 speed 100", - "set interfaces ethernet eth1 duplex half", - ] - self.execute_module(changed=True, commands=commands) - - def test_vyos_setup_required_params(self): - set_module_args( - dict( - name="eth1", - enabled=True, - state="present", - speed="100", - ) - ) - result = self.execute_module(failed=True) - self.assertIn( - "parameters are required together: speed, duplex", result["msg"] - ) - - def test_vyos_setup_int_idempotent(self): - set_module_args( - dict( - name="eth1", - enabled=True, - state="present", - ) - ) - self.execute_module(changed=False, commands=[]) - - def test_vyos_disable_int(self): - set_module_args( - dict( - name="eth1", - state="absent", - ) - ) - commands = ["delete interfaces ethernet eth1"] - self.execute_module(changed=True, commands=commands) - - def test_vyos_setup_int_aggregate(self): - set_module_args( - dict( - aggregate=[ - dict( - name="eth1", - enabled=True, - state="present", - mtu="512", - duplex="half", - speed="100", - ), - dict( - name="eth2", - enabled=True, - state="present", - speed="1000", - duplex="full", - mtu="256", - ), - ] - ) - ) - commands = [ - "set interfaces ethernet eth1 speed 100", - "set interfaces ethernet eth1 duplex half", - "set interfaces ethernet eth1 mtu 512", - "set interfaces ethernet eth2 speed 1000", - "set interfaces ethernet eth2 duplex full", - "set interfaces ethernet eth2 mtu 256", - ] - self.execute_module(changed=True, commands=commands) - - def test_vyos_delete_int_aggregate(self): - set_module_args( - dict( - aggregate=[ - dict( - name="eth1", - state="absent", - ), - dict( - name="eth2", - state="absent", - ), - ] - ) - ) - commands = [ - "delete interfaces ethernet eth1", - "delete interfaces ethernet eth2", - ] - self.execute_module(changed=True, commands=commands) - - def test_vyos_disable_int_aggregate(self): - set_module_args( - dict( - aggregate=[ - dict( - name="eth1", - enabled=False, - ), - dict( - name="eth2", - enabled=False, - ), - ] - ) - ) - commands = [ - "set interfaces ethernet eth1 disable", - "set interfaces ethernet eth2 disable", - ] - self.execute_module(changed=True, commands=commands) - - def test_vyos_intent_wrongport(self): - set_module_args( - dict( - name="eth0", - neighbors=[dict(port="dummy_port", host="dummy_host")], - ) - ) - result = self.execute_module(failed=True) - self.assertIn( - "One or more conditional statements have not been satisfied", - result["msg"], - ) - - def test_vyos_intent_neighbor_fail(self): - set_module_args( - dict( - name="eth0", - neighbors=[ - dict( - port="eth0", - ) - ], - ) - ) - result = self.execute_module(failed=True) - self.assertIn( - "One or more conditional statements have not been satisfied", - result["msg"], - ) - - def test_vyos_intent_neighbor(self): - set_module_args( - dict( - name="eth1", - neighbors=[ - dict( - port="eth0", - ) - ], - ) - ) - self.execute_module(failed=False) - - def test_vyos_intent_neighbor_aggregate(self): - set_module_args( - dict( - aggregate=[ - dict( - name="eth1", - neighbors=[ - dict( - port="eth0", - ) - ], - ) - ] - ) - ) - self.execute_module(failed=False) diff --git a/tests/unit/modules/network/vyos/test_vyos_static_route.py b/tests/unit/modules/network/vyos/test_vyos_static_route.py deleted file mode 100644 index 62bff19..0000000 --- a/tests/unit/modules/network/vyos/test_vyos_static_route.py +++ /dev/null @@ -1,73 +0,0 @@ -# (c) 2016 Red Hat Inc. -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see <http://www.gnu.org/licenses/>. - -# Make coding more python3-ish -from __future__ import absolute_import, division, print_function - -__metaclass__ = type - -from ansible_collections.vyos.vyos.tests.unit.compat.mock import patch -from ansible_collections.vyos.vyos.plugins.modules import vyos_static_route -from ansible_collections.vyos.vyos.tests.unit.modules.utils import ( - set_module_args, -) -from .vyos_module import TestVyosModule - - -class TestVyosStaticRouteModule(TestVyosModule): - - module = vyos_static_route - - def setUp(self): - super(TestVyosStaticRouteModule, self).setUp() - - self.mock_get_config = patch( - "ansible_collections.vyos.vyos.plugins.modules.vyos_static_route.get_config" - ) - self.get_config = self.mock_get_config.start() - - self.mock_load_config = patch( - "ansible_collections.vyos.vyos.plugins.modules.vyos_static_route.load_config" - ) - - self.load_config = self.mock_load_config.start() - - def tearDown(self): - super(TestVyosStaticRouteModule, self).tearDown() - - self.mock_get_config.stop() - self.mock_load_config.stop() - - def load_fixtures(self, commands=None, filename=None): - self.get_config.return_value = "" - self.load_config.return_value = dict(diff=None, session="session") - - def test_vyos_static_route_present(self): - set_module_args( - dict( - prefix="172.26.0.0/16", - next_hop="172.26.4.1", - admin_distance="1", - ) - ) - result = self.execute_module(changed=True) - self.assertEqual( - result["commands"], - [ - "set protocols static route 172.26.0.0/16 next-hop 172.26.4.1 distance 1" - ], - ) |