Backport/2.7/46623 (#48154)

* To backport PR 46623 to 2.7.2

* Lenovo finetune modules (#46623)

* Making username password etc non mandatory as we use persistence connection.
Some documentation fine tuning also done.

* To update version which was tested against.

* Adding Bacon switch (NE0152T) to device rules

* Qalthos Review catch

* Updating version

* Changing documentation to add Bacon switch. This is effective since 2.8

(cherry picked from commit d0e89bc1bb)

* Delete cnos-46623-support-bacon-in-modules.yaml

* Update cnos_devicerules.py

* Update cnos.py

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md
This commit is contained in:
Anil Kumar Muraleedharan 2018-12-04 06:07:25 +05:30 committed by Toshio Kuratomi
parent 5340549506
commit bbb47eedc0
27 changed files with 68 additions and 477 deletions

View file

@ -47,9 +47,7 @@ description:
well. This module uses SSH to manage network device configuration. well. This module uses SSH to manage network device configuration.
The results of the operation will be placed in a directory named 'results' The results of the operation will be placed in a directory named 'results'
that must be created by the user in their local directory to where the that must be created by the user in their local directory to where the
playbook is run. For more information about this module from Lenovo and playbook is run.
customizing it usage for your use cases, please visit
U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_backup.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: options:
@ -105,11 +103,7 @@ Tasks : The following are examples of using the module cnos_backup.
--- ---
- name: Test Running Config Backup - name: Test Running Config Backup
cnos_backup: cnos_backup:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_backup_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_backup_{{ inventory_hostname }}_output.txt"
configType: running-config configType: running-config
protocol: "sftp" protocol: "sftp"
@ -120,11 +114,7 @@ Tasks : The following are examples of using the module cnos_backup.
- name: Test Startup Config Backup - name: Test Startup Config Backup
cnos_backup: cnos_backup:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_backup_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_backup_{{ inventory_hostname }}_output.txt"
configType: startup-config configType: startup-config
protocol: "sftp" protocol: "sftp"
@ -135,11 +125,7 @@ Tasks : The following are examples of using the module cnos_backup.
- name: Test Running Config Backup -TFTP - name: Test Running Config Backup -TFTP
cnos_backup: cnos_backup:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_backup_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_backup_{{ inventory_hostname }}_output.txt"
configType: running-config configType: running-config
protocol: "tftp" protocol: "tftp"
@ -150,11 +136,7 @@ Tasks : The following are examples of using the module cnos_backup.
- name: Test Startup Config Backup - TFTP - name: Test Startup Config Backup - TFTP
cnos_backup: cnos_backup:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_backup_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_backup_{{ inventory_hostname }}_output.txt"
configType: startup-config configType: startup-config
protocol: "tftp" protocol: "tftp"
@ -248,9 +230,9 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
outputfile=dict(required=True), outputfile=dict(required=True),
host=dict(required=True), host=dict(required=False),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True), enablePassword=dict(required=False, no_log=True),
deviceType=dict(required=True), deviceType=dict(required=True),
configType=dict(required=True), configType=dict(required=True),

View file

@ -47,9 +47,7 @@ description:
This module uses SSH to manage network device configuration. This module uses SSH to manage network device configuration.
The results of the operation will be placed in a directory named 'results' The results of the operation will be placed in a directory named 'results'
that must be created by the user in their local directory to where the that must be created by the user in their local directory to where the
playbook is run. For more information about this module from Lenovo and playbook is run.
customizing it usage for your use cases, please visit
U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_bgp.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: options:
@ -140,11 +138,7 @@ Tasks: The following are examples of using the module cnos_bgp. These are
--- ---
- name: Test BGP - neighbor - name: Test BGP - neighbor
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "neighbor" bgpArg1: "neighbor"
@ -156,11 +150,7 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - BFD - name: Test BGP - BFD
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "neighbor" bgpArg1: "neighbor"
@ -170,11 +160,7 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - address-family - dampening - name: Test BGP - address-family - dampening
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "address-family" bgpArg1: "address-family"
@ -188,11 +174,7 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - address-family - network - name: Test BGP - address-family - network
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "address-family" bgpArg1: "address-family"
@ -203,11 +185,7 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - bestpath - always-compare-med - name: Test BGP - bestpath - always-compare-med
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "bestpath" bgpArg1: "bestpath"
@ -215,11 +193,7 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - bestpath-compare-confed-aspat - name: Test BGP - bestpath-compare-confed-aspat
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "bestpath" bgpArg1: "bestpath"
@ -227,11 +201,7 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - bgp - name: Test BGP - bgp
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "bgp" bgpArg1: "bgp"
@ -239,11 +209,7 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - cluster-id - name: Test BGP - cluster-id
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "cluster-id" bgpArg1: "cluster-id"
@ -251,11 +217,7 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - confederation-identifier - name: Test BGP - confederation-identifier
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "confederation" bgpArg1: "confederation"
@ -264,33 +226,21 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - enforce-first-as - name: Test BGP - enforce-first-as
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "enforce-first-as" bgpArg1: "enforce-first-as"
- name: Test BGP - fast-external-failover - name: Test BGP - fast-external-failover
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "fast-external-failover" bgpArg1: "fast-external-failover"
- name: Test BGP - graceful-restart - name: Test BGP - graceful-restart
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "graceful-restart" bgpArg1: "graceful-restart"
@ -298,22 +248,14 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - graceful-restart-helper - name: Test BGP - graceful-restart-helper
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "graceful-restart-helper" bgpArg1: "graceful-restart-helper"
- name: Test BGP - maxas-limit - name: Test BGP - maxas-limit
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "maxas-limit" bgpArg1: "maxas-limit"
@ -321,11 +263,7 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - neighbor - name: Test BGP - neighbor
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "neighbor" bgpArg1: "neighbor"
@ -337,11 +275,7 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - router-id - name: Test BGP - router-id
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "router-id" bgpArg1: "router-id"
@ -349,22 +283,14 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - synchronization - name: Test BGP - synchronization
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "synchronization" bgpArg1: "synchronization"
- name: Test BGP - timers - name: Test BGP - timers
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "timers" bgpArg1: "timers"
@ -373,11 +299,7 @@ Tasks: The following are examples of using the module cnos_bgp. These are
- name: Test BGP - vrf - name: Test BGP - vrf
cnos_bgp: cnos_bgp:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33 asNum: 33
bgpArg1: "vrf" bgpArg1: "vrf"
@ -1217,9 +1139,9 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
outputfile=dict(required=True), outputfile=dict(required=True),
host=dict(required=True), host=dict(required=False),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True), enablePassword=dict(required=False, no_log=True),
deviceType=dict(required=True), deviceType=dict(required=True),
bgpArg1=dict(required=True), bgpArg1=dict(required=True),

View file

@ -49,9 +49,7 @@ description:
Usually, commands are executed across a group of network devices. When Usually, commands are executed across a group of network devices. When
there is a requirement to skip the execution of the command on one or there is a requirement to skip the execution of the command on one or
more devices, it is recommended to use this module. This module uses SSH to more devices, it is recommended to use this module. This module uses SSH to
manage network device configuration. For more information about this module manage network device configuration.
from Lenovo and customizing it usage for your use cases, please visit
U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_conditional_command.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: options:
@ -84,11 +82,7 @@ Tasks : The following are examples of using the module
--- ---
- name: Applying CLI template on VLAG Tier1 Leaf Switch1 - name: Applying CLI template on VLAG Tier1 Leaf Switch1
cnos_conditional_command: cnos_conditional_command:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_conditional_command_ outputfile: "./results/test_conditional_command_
{{ inventory_hostname }}_output.txt" {{ inventory_hostname }}_output.txt"
condition: "{{ hostvars[inventory_hostname]['condition']}}" condition: "{{ hostvars[inventory_hostname]['condition']}}"
@ -128,10 +122,10 @@ def main():
outputfile=dict(required=True), outputfile=dict(required=True),
condition=dict(required=True), condition=dict(required=True),
flag=dict(required=True), flag=dict(required=True),
host=dict(required=True), host=dict(required=False),
deviceType=dict(required=True), deviceType=dict(required=True),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, enablePassword=dict(required=False,
no_log=True), ), supports_check_mode=False) no_log=True), ), supports_check_mode=False)

View file

@ -50,10 +50,7 @@ description:
Usually, templates are used when commands are the same across a group of Usually, templates are used when commands are the same across a group of
network devices. When there is a requirement to skip the execution of the network devices. When there is a requirement to skip the execution of the
template on one or more devices, it is recommended to use this module. template on one or more devices, it is recommended to use this module.
This module uses SSH to manage network device configuration. For more This module uses SSH to manage network device configuration.
information about this module and customizing it usage for your use cases,
please visit U(http://systemx.lenovofiles.com/help/index.jsp?topic=
%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_conditional_template.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: options:
@ -93,9 +90,6 @@ Tasks : The following are examples of using the module
--- ---
- name: Applying CLI template on VLAG Tier1 Leaf Switch1 - name: Applying CLI template on VLAG Tier1 Leaf Switch1
cnos_conditional_template: cnos_conditional_template:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/vlag_1tier_leaf_switch1_ outputfile: "./results/vlag_1tier_leaf_switch1_
{{ inventory_hostname }}_output.txt" {{ inventory_hostname }}_output.txt"
@ -103,7 +97,6 @@ Tasks : The following are examples of using the module
flag: "leaf_switch1" flag: "leaf_switch1"
commandfile: "./commands/vlag_1tier_leaf_switch1_ commandfile: "./commands/vlag_1tier_leaf_switch1_
{{ inventory_hostname }}_commands.txt" {{ inventory_hostname }}_commands.txt"
enablePassword: "anil"
stp_mode1: "disable" stp_mode1: "disable"
port_range1: "17,18,29,30" port_range1: "17,18,29,30"
portchannel_interface_number1: 1001 portchannel_interface_number1: 1001
@ -143,10 +136,10 @@ def main():
outputfile=dict(required=True), outputfile=dict(required=True),
condition=dict(required=True), condition=dict(required=True),
flag=dict(required=True), flag=dict(required=True),
host=dict(required=True), host=dict(required=False),
deviceType=dict(required=True), deviceType=dict(required=True),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True),), enablePassword=dict(required=False, no_log=True),),
supports_check_mode=False) supports_check_mode=False)

View file

@ -37,7 +37,7 @@ description:
an implementation for working with CNOS configuration sections in an implementation for working with CNOS configuration sections in
a deterministic way. a deterministic way.
notes: notes:
- Tested against CNOS 10.8.0.42 - Tested against CNOS 10.8.1
options: options:
provider: provider:
version_added: "2.6" version_added: "2.6"

View file

@ -42,9 +42,6 @@ description:
topology as a new network device. This module uses SSH to manage network topology as a new network device. This module uses SSH to manage network
device configuration. The result of the operation can be viewed in results device configuration. The result of the operation can be viewed in results
directory. directory.
For more information about this module and customizing it usage
for your use cases, please visit
U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_factory.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: {} options: {}
@ -56,9 +53,6 @@ Tasks : The following are examples of using the module cnos_reload. These are
--- ---
- name: Test Reset to factory - name: Test Reset to factory
cnos_factory: cnos_factory:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_factory_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_factory_{{ inventory_hostname }}_output.txt"
@ -91,9 +85,9 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
outputfile=dict(required=True), outputfile=dict(required=True),
host=dict(required=True), host=dict(required=False),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True), enablePassword=dict(required=False, no_log=True),
deviceType=dict(required=True),), deviceType=dict(required=True),),
supports_check_mode=False) supports_check_mode=False)

View file

@ -36,7 +36,7 @@ description:
module will always collect a base set of facts from the device module will always collect a base set of facts from the device
and can enable or disable collection of additional facts. and can enable or disable collection of additional facts.
notes: notes:
- Tested against CNOS 10.8.0.42 - Tested against CNOS 10.8.1
options: options:
authorize: authorize:
version_added: "2.6" version_added: "2.6"

View file

@ -48,9 +48,6 @@ description:
The results of the operation will be placed in a directory named 'results' The results of the operation will be placed in a directory named 'results'
that must be created by the user in their local directory to where the that must be created by the user in their local directory to where the
playbook is run. playbook is run.
For more information about this module from Lenovo and customizing it
usage for your use cases, please visit
U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_image.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: options:
@ -94,11 +91,7 @@ Tasks : The following are examples of using the module cnos_image. These are
--- ---
- name: Test Image transfer - name: Test Image transfer
cnos_image: cnos_image:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_image_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_image_{{ inventory_hostname }}_output.txt"
protocol: "sftp" protocol: "sftp"
serverip: "10.241.106.118" serverip: "10.241.106.118"
@ -109,11 +102,7 @@ Tasks : The following are examples of using the module cnos_image. These are
- name: Test Image tftp - name: Test Image tftp
cnos_image: cnos_image:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_image_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_image_{{ inventory_hostname }}_output.txt"
protocol: "tftp" protocol: "tftp"
serverip: "10.241.106.118" serverip: "10.241.106.118"
@ -205,9 +194,9 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
outputfile=dict(required=True), outputfile=dict(required=True),
host=dict(required=True), host=dict(required=False),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True), enablePassword=dict(required=False, no_log=True),
deviceType=dict(required=True), deviceType=dict(required=True),
protocol=dict(required=True), protocol=dict(required=True),

View file

@ -50,8 +50,6 @@ description:
This module uses SSH to manage network device configuration. This module uses SSH to manage network device configuration.
The results of the operation will be placed in a directory named 'results' The results of the operation will be placed in a directory named 'results'
that must be created by the user in their local directory to where the playbook is run. that must be created by the user in their local directory to where the playbook is run.
For more information about this module from Lenovo and customizing it usage for your
use cases, please visit U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_interface.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: options:
@ -134,11 +132,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
--- ---
- name: Test Interface Ethernet - channel-group - name: Test Interface Ethernet - channel-group
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 1 interfaceRange: 1
@ -148,11 +142,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - switchport - name: Test Interface Ethernet - switchport
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -162,11 +152,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - switchport mode - name: Test Interface Ethernet - switchport mode
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -176,11 +162,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - Description - name: Test Interface Ethernet - Description
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -189,11 +171,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - Duplex - name: Test Interface Ethernet - Duplex
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 1 interfaceRange: 1
@ -202,11 +180,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - flowcontrol - name: Test Interface Ethernet - flowcontrol
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -216,11 +190,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - lacp - name: Test Interface Ethernet - lacp
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -230,11 +200,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - lldp - name: Test Interface Ethernet - lldp
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -244,11 +210,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - load-interval - name: Test Interface Ethernet - load-interval
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -259,11 +221,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - mac - name: Test Interface Ethernet - mac
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -272,11 +230,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - microburst-detection - name: Test Interface Ethernet - microburst-detection
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -285,11 +239,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - mtu - name: Test Interface Ethernet - mtu
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -298,11 +248,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - service-policy - name: Test Interface Ethernet - service-policy
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -312,11 +258,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - speed - name: Test Interface Ethernet - speed
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 1 interfaceRange: 1
@ -325,11 +267,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - storm - name: Test Interface Ethernet - storm
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -339,11 +277,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - vlan - name: Test Interface Ethernet - vlan
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -352,11 +286,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - vrrp - name: Test Interface Ethernet - vrrp
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -365,11 +295,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - spanning tree1 - name: Test Interface Ethernet - spanning tree1
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -379,11 +305,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - spanning tree 2 - name: Test Interface Ethernet - spanning tree 2
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -395,11 +317,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - ip1 - name: Test Interface Ethernet - ip1
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -410,11 +328,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - ip2 - name: Test Interface Ethernet - ip2
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -424,11 +338,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - bfd - name: Test Interface Ethernet - bfd
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -440,11 +350,7 @@ Tasks : The following are examples of using the module cnos_interface. These are
- name: Test Interface Ethernet - bfd - name: Test Interface Ethernet - bfd
cnos_interface: cnos_interface:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_interface_{{ inventory_hostname }}_output.txt"
interfaceOption: 'ethernet' interfaceOption: 'ethernet'
interfaceRange: 33 interfaceRange: 33
@ -489,9 +395,9 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
outputfile=dict(required=True), outputfile=dict(required=True),
host=dict(required=True), host=dict(required=False),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True), enablePassword=dict(required=False, no_log=True),
deviceType=dict(required=True), deviceType=dict(required=True),
interfaceRange=dict(required=False), interfaceRange=dict(required=False),

View file

@ -45,9 +45,7 @@ description:
This module uses SSH to manage network device configuration. This module uses SSH to manage network device configuration.
The results of the operation will be placed in a directory named 'results' The results of the operation will be placed in a directory named 'results'
that must be created by the user in their local directory to where the that must be created by the user in their local directory to where the
playbook is run. For more information about this module from Lenovo and playbook is run.
customizing it usage for your use cases, please
U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_portchannel.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: options:
@ -159,9 +157,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
--- ---
- name: Test Port Channel - channel-group - name: Test Port Channel - channel-group
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{inventory_hostname}}_output.txt" outputfile: "./results/test_portchannel_{{inventory_hostname}}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -171,9 +166,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - channel-group - Interface Range - name: Test Port Channel - channel-group - Interface Range
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: "1/1-2" interfaceRange: "1/1-2"
@ -183,9 +175,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - bridge-port - name: Test Port Channel - bridge-port
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -195,9 +184,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - bridgeport mode - name: Test Port Channel - bridgeport mode
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -207,9 +193,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - Description - name: Test Port Channel - Description
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -218,9 +201,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - Duplex - name: Test Port Channel - Duplex
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -229,9 +209,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - flowcontrol - name: Test Port Channel - flowcontrol
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -241,9 +218,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - lacp - name: Test Port Channel - lacp
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -253,9 +227,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - lldp - name: Test Port Channel - lldp
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -265,9 +236,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - load-interval - name: Test Port Channel - load-interval
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -278,9 +246,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - microburst-detection - name: Test Port Channel - microburst-detection
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -289,9 +254,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - mtu - name: Test Port Channel - mtu
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -300,9 +262,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - service-policy - name: Test Port Channel - service-policy
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -312,9 +271,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - speed - name: Test Port Channel - speed
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -323,9 +279,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - storm - name: Test Port Channel - storm
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -335,9 +288,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - vlan - name: Test Port Channel - vlan
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -346,9 +296,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - vrrp - name: Test Port Channel - vrrp
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -357,9 +304,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - spanning tree1 - name: Test Port Channel - spanning tree1
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -369,9 +313,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - spanning tree 2 - name: Test Port Channel - spanning tree 2
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -383,9 +324,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - ip1 - name: Test Port Channel - ip1
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -396,9 +334,6 @@ Tasks : The following are examples of using the module cnos_portchannel. These
- name: Test Port Channel - ip2 - name: Test Port Channel - ip2
cnos_portchannel: cnos_portchannel:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_portchannel_{{ inventory_hostname }}_output.txt"
interfaceRange: 33 interfaceRange: 33
@ -473,9 +408,9 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
outputfile=dict(required=True), outputfile=dict(required=True),
host=dict(required=True), host=dict(required=False),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True), enablePassword=dict(required=False, no_log=True),
deviceType=dict(required=True), deviceType=dict(required=True),
interfaceRange=dict(required=False), interfaceRange=dict(required=False),

View file

@ -40,9 +40,6 @@ description:
configuration has been saved over the startup configuration. configuration has been saved over the startup configuration.
This module uses SSH to manage network device configuration. This module uses SSH to manage network device configuration.
The results of the operation can be viewed in results directory. The results of the operation can be viewed in results directory.
For more information about this module and customizing it usage
for your use cases, please visit
U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_reload.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: {} options: {}
@ -54,11 +51,7 @@ Tasks : The following are examples of using the module cnos_reload. These are
--- ---
- name: Test Reload - name: Test Reload
cnos_reload: cnos_reload:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_reload_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_reload_{{ inventory_hostname }}_output.txt"
''' '''
RETURN = ''' RETURN = '''
@ -89,9 +82,9 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
outputfile=dict(required=True), outputfile=dict(required=True),
host=dict(required=True), host=dict(required=False),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True), enablePassword=dict(required=False, no_log=True),
deviceType=dict(required=True),), deviceType=dict(required=True),),
supports_check_mode=False) supports_check_mode=False)

View file

@ -49,9 +49,7 @@ description:
the newly downloaded file. This module uses SSH to manage network device the newly downloaded file. This module uses SSH to manage network device
configuration. The results of the operation will be placed in a directory configuration. The results of the operation will be placed in a directory
named 'results' that must be created by the user in their local directory named 'results' that must be created by the user in their local directory
to where the playbook is run. For more information about this module from to where the playbook is run.
Lenovo and customizing it usage for your use cases, please visit
U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_rollback.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: options:
@ -106,11 +104,7 @@ Tasks : The following are examples of using the module cnos_rollback.
- name: Test Rollback of config - Running config - name: Test Rollback of config - Running config
cnos_rolback: cnos_rolback:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_rollback_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_rollback_{{ inventory_hostname }}_output.txt"
configType: running-config configType: running-config
protocol: "sftp" protocol: "sftp"
@ -121,11 +115,7 @@ Tasks : The following are examples of using the module cnos_rollback.
- name: Test Rollback of config - Startup config - name: Test Rollback of config - Startup config
cnos_rolback: cnos_rolback:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_rollback_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_rollback_{{ inventory_hostname }}_output.txt"
configType: startup-config configType: startup-config
protocol: "sftp" protocol: "sftp"
@ -136,11 +126,7 @@ Tasks : The following are examples of using the module cnos_rollback.
- name: Test Rollback of config - Running config - TFTP - name: Test Rollback of config - Running config - TFTP
cnos_rolback: cnos_rolback:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_rollback_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_rollback_{{ inventory_hostname }}_output.txt"
configType: running-config configType: running-config
protocol: "tftp" protocol: "tftp"
@ -151,11 +137,7 @@ Tasks : The following are examples of using the module cnos_rollback.
- name: Test Rollback of config - Startup config - TFTP - name: Test Rollback of config - Startup config - TFTP
cnos_rolback: cnos_rolback:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_rollback_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_rollback_{{ inventory_hostname }}_output.txt"
configType: startup-config configType: startup-config
protocol: "tftp" protocol: "tftp"
@ -258,9 +240,9 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
outputfile=dict(required=True), outputfile=dict(required=True),
host=dict(required=True), host=dict(required=False),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True), enablePassword=dict(required=False, no_log=True),
deviceType=dict(required=True), deviceType=dict(required=True),
configType=dict(required=True), configType=dict(required=True),

View file

@ -42,9 +42,7 @@ description:
restart. This module uses SSH to manage network device configuration. restart. This module uses SSH to manage network device configuration.
The results of the operation will be placed in a directory named 'results' The results of the operation will be placed in a directory named 'results'
that must be created by the user in their local directory to where the that must be created by the user in their local directory to where the
playbook is run. For more information about this module from Lenovo and playbook is run.
customizing it usage for your use cases, please visit
U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_save.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: {} options: {}
@ -56,11 +54,7 @@ Tasks : The following are examples of using the module cnos_save. These are
--- ---
- name: Test Save - name: Test Save
cnos_save: cnos_save:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_save_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_save_{{ inventory_hostname }}_output.txt"
''' '''
RETURN = ''' RETURN = '''
@ -91,9 +85,9 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
outputfile=dict(required=True), outputfile=dict(required=True),
host=dict(required=True), host=dict(required=False),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True), enablePassword=dict(required=False, no_log=True),
deviceType=dict(required=True),), deviceType=dict(required=True),),
supports_check_mode=False) supports_check_mode=False)

View file

@ -41,9 +41,7 @@ description:
device. This module uses SSH to manage network device configuration. device. This module uses SSH to manage network device configuration.
The results of the operation will be placed in a directory named 'results' The results of the operation will be placed in a directory named 'results'
that must be created by the user in their local directory to where the that must be created by the user in their local directory to where the
playbook is run. For more information about this module from Lenovo and playbook is run.
customizing it usage for your use cases, please visit
U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_showrun.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: {} options: {}
@ -55,11 +53,7 @@ Tasks : The following are examples of using the module cnos_showrun. These are
--- ---
- name: Run show running-config - name: Run show running-config
cnos_showrun: cnos_showrun:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_showrun_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_showrun_{{ inventory_hostname }}_output.txt"
''' '''
@ -91,9 +85,9 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
outputfile=dict(required=True), outputfile=dict(required=True),
host=dict(required=True), host=dict(required=False),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True),), enablePassword=dict(required=False, no_log=True),),
supports_check_mode=False) supports_check_mode=False)

View file

@ -42,8 +42,6 @@ description:
This module uses SSH to manage network device configuration. This module uses SSH to manage network device configuration.
The results of the operation will be placed in a directory named 'results' The results of the operation will be placed in a directory named 'results'
that must be created by the user in their local directory to where the playbook is run. that must be created by the user in their local directory to where the playbook is run.
For more information about this module from Lenovo and customizing it usage for your
use cases, please visit U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_template.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: options:
@ -73,11 +71,7 @@ Tasks : The following are examples of using the module cnos_template. These are
- name: Applying CLI commands on Switches - name: Applying CLI commands on Switches
cnos_template: cnos_template:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
commandfile: "./commands/demo_template_{{ inventory_hostname }}_commands.txt" commandfile: "./commands/demo_template_{{ inventory_hostname }}_commands.txt"
outputfile: "./results/demo_template_command_{{ inventory_hostname }}_output.txt" outputfile: "./results/demo_template_command_{{ inventory_hostname }}_output.txt"
@ -112,10 +106,10 @@ def main():
argument_spec=dict( argument_spec=dict(
commandfile=dict(required=True), commandfile=dict(required=True),
outputfile=dict(required=True), outputfile=dict(required=True),
host=dict(required=True), host=dict(required=False),
deviceType=dict(required=True), deviceType=dict(required=True),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True),), enablePassword=dict(required=False, no_log=True),),
supports_check_mode=False) supports_check_mode=False)
commandfile = module.params['commandfile'] commandfile = module.params['commandfile']

View file

@ -46,9 +46,7 @@ description:
This module uses SSH to manage network device configuration. This module uses SSH to manage network device configuration.
The results of the operation will be placed in a directory named 'results' The results of the operation will be placed in a directory named 'results'
that must be created by the user in their local directory to where the that must be created by the user in their local directory to where the
playbook is run. For more information about this module from Lenovo and playbook is run.
customizing it usage for your use cases, please visit
U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_vlag.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: options:
@ -95,18 +93,12 @@ Tasks : The following are examples of using the module cnos_vlag. These are
--- ---
- name: Test Vlag - enable - name: Test Vlag - enable
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "enable" vlagArg1: "enable"
- name: Test Vlag - autorecovery - name: Test Vlag - autorecovery
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "auto-recovery" vlagArg1: "auto-recovery"
@ -114,9 +106,6 @@ Tasks : The following are examples of using the module cnos_vlag. These are
- name: Test Vlag - config-consistency - name: Test Vlag - config-consistency
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "config-consistency" vlagArg1: "config-consistency"
@ -124,9 +113,6 @@ Tasks : The following are examples of using the module cnos_vlag. These are
- name: Test Vlag - isl - name: Test Vlag - isl
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "isl" vlagArg1: "isl"
@ -134,27 +120,18 @@ Tasks : The following are examples of using the module cnos_vlag. These are
- name: Test Vlag - mac-address-table - name: Test Vlag - mac-address-table
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "mac-address-table" vlagArg1: "mac-address-table"
- name: Test Vlag - peer-gateway - name: Test Vlag - peer-gateway
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "peer-gateway" vlagArg1: "peer-gateway"
- name: Test Vlag - priority - name: Test Vlag - priority
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "priority" vlagArg1: "priority"
@ -162,9 +139,6 @@ Tasks : The following are examples of using the module cnos_vlag. These are
- name: Test Vlag - startup-delay - name: Test Vlag - startup-delay
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "startup-delay" vlagArg1: "startup-delay"
@ -172,9 +146,6 @@ Tasks : The following are examples of using the module cnos_vlag. These are
- name: Test Vlag - tier-id - name: Test Vlag - tier-id
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "tier-id" vlagArg1: "tier-id"
@ -182,18 +153,12 @@ Tasks : The following are examples of using the module cnos_vlag. These are
- name: Test Vlag - vrrp - name: Test Vlag - vrrp
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "vrrp" vlagArg1: "vrrp"
- name: Test Vlag - instance - name: Test Vlag - instance
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "instance" vlagArg1: "instance"
@ -202,9 +167,6 @@ Tasks : The following are examples of using the module cnos_vlag. These are
- name: Test Vlag - instance2 - name: Test Vlag - instance2
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "instance" vlagArg1: "instance"
@ -212,9 +174,6 @@ Tasks : The following are examples of using the module cnos_vlag. These are
- name: Test Vlag - keepalive-attempts - name: Test Vlag - keepalive-attempts
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "hlthchk" vlagArg1: "hlthchk"
@ -223,9 +182,6 @@ Tasks : The following are examples of using the module cnos_vlag. These are
- name: Test Vlag - keepalive-interval - name: Test Vlag - keepalive-interval
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "hlthchk" vlagArg1: "hlthchk"
@ -234,9 +190,6 @@ Tasks : The following are examples of using the module cnos_vlag. These are
- name: Test Vlag - retry-interval - name: Test Vlag - retry-interval
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "hlthchk" vlagArg1: "hlthchk"
@ -245,9 +198,6 @@ Tasks : The following are examples of using the module cnos_vlag. These are
- name: Test Vlag - peer ip - name: Test Vlag - peer ip
cnos_vlag: cnos_vlag:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user']}}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass']}}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}" deviceType: "{{ hostvars[inventory_hostname]['deviceType']}}"
outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt" outputfile: "./results/cnos_vlag_{{ inventory_hostname }}_output.txt"
vlagArg1: "hlthchk" vlagArg1: "hlthchk"
@ -461,9 +411,9 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
outputfile=dict(required=True), outputfile=dict(required=True),
host=dict(required=True), host=dict(required=False),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True), enablePassword=dict(required=False, no_log=True),
deviceType=dict(required=True), deviceType=dict(required=True),
vlagArg1=dict(required=True), vlagArg1=dict(required=True),

View file

@ -47,10 +47,7 @@ description:
following arguments will be evaluated. This module uses SSH to manage following arguments will be evaluated. This module uses SSH to manage
network device configuration. The results of the operation will be placed network device configuration. The results of the operation will be placed
in a directory named 'results' that must be created by the user in their in a directory named 'results' that must be created by the user in their
local directory to where the playbook is run. For more information about local directory to where the playbook is run.
this module from Lenovo and customizing it usage for your use cases,
please visit
U(http://systemx.lenovofiles.com/help/index.jsp?topic=%2Fcom.lenovo.switchmgt.ansible.doc%2Fcnos_vlan.html)
version_added: "2.3" version_added: "2.3"
extends_documentation_fragment: cnos extends_documentation_fragment: cnos
options: options:
@ -98,11 +95,7 @@ Tasks: The following are examples of using the module cnos_vlan. These are
--- ---
- name: Test Vlan - Create a vlan, name it - name: Test Vlan - Create a vlan, name it
cnos_vlan: cnos_vlan:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt"
vlanArg1: 13 vlanArg1: 13
vlanArg2: "name" vlanArg2: "name"
@ -110,11 +103,7 @@ Tasks: The following are examples of using the module cnos_vlan. These are
- name: Test Vlan - Create a vlan, Flood configuration - name: Test Vlan - Create a vlan, Flood configuration
cnos_vlan: cnos_vlan:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt"
vlanArg1: 13 vlanArg1: 13
vlanArg2: "flood" vlanArg2: "flood"
@ -122,11 +111,7 @@ Tasks: The following are examples of using the module cnos_vlan. These are
- name: Test Vlan - Create a vlan, State configuration - name: Test Vlan - Create a vlan, State configuration
cnos_vlan: cnos_vlan:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt"
vlanArg1: 13 vlanArg1: 13
vlanArg2: "state" vlanArg2: "state"
@ -134,11 +119,7 @@ Tasks: The following are examples of using the module cnos_vlan. These are
- name: Test Vlan - VLAN Access map1 - name: Test Vlan - VLAN Access map1
cnos_vlan: cnos_vlan:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt"
vlanArg1: "access-map" vlanArg1: "access-map"
vlanArg2: "Anil" vlanArg2: "Anil"
@ -146,11 +127,7 @@ Tasks: The following are examples of using the module cnos_vlan. These are
- name: Test Vlan - VLAN Accep Map2 - name: Test Vlan - VLAN Accep Map2
cnos_vlan: cnos_vlan:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt"
vlanArg1: "access-map" vlanArg1: "access-map"
vlanArg2: "Anil" vlanArg2: "Anil"
@ -159,11 +136,7 @@ Tasks: The following are examples of using the module cnos_vlan. These are
- name: Test Vlan - ip igmp snooping query interval - name: Test Vlan - ip igmp snooping query interval
cnos_vlan: cnos_vlan:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt"
vlanArg1: 13 vlanArg1: 13
vlanArg2: "ip" vlanArg2: "ip"
@ -172,11 +145,7 @@ Tasks: The following are examples of using the module cnos_vlan. These are
- name: Test Vlan - ip igmp snooping mrouter interface port-aggregation 23 - name: Test Vlan - ip igmp snooping mrouter interface port-aggregation 23
cnos_vlan: cnos_vlan:
host: "{{ inventory_hostname }}"
username: "{{ hostvars[inventory_hostname]['ansible_ssh_user'] }}"
password: "{{ hostvars[inventory_hostname]['ansible_ssh_pass'] }}"
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}" deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
enablePassword: "{{ hostvars[inventory_hostname]['enablePassword'] }}"
outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt" outputfile: "./results/test_vlan_{{ inventory_hostname }}_output.txt"
vlanArg1: 13 vlanArg1: 13
vlanArg2: "ip" vlanArg2: "ip"
@ -549,9 +518,9 @@ def main():
module = AnsibleModule( module = AnsibleModule(
argument_spec=dict( argument_spec=dict(
outputfile=dict(required=True), outputfile=dict(required=True),
host=dict(required=True), host=dict(required=False),
username=dict(required=True), username=dict(required=False),
password=dict(required=True, no_log=True), password=dict(required=False, no_log=True),
enablePassword=dict(required=False, no_log=True), enablePassword=dict(required=False, no_log=True),
deviceType=dict(required=True), deviceType=dict(required=True),
vlanArg1=dict(required=True), vlanArg1=dict(required=True),

View file

@ -38,7 +38,7 @@ description:
a deterministic way. a deterministic way.
extends_documentation_fragment: enos extends_documentation_fragment: enos
notes: notes:
- Tested against ENOS 8.4.1.2 - Tested against ENOS 8.4.1
options: options:
lines: lines:
description: description:

View file

@ -38,7 +38,7 @@ description:
and can enable or disable collection of additional facts. and can enable or disable collection of additional facts.
extends_documentation_fragment: enos extends_documentation_fragment: enos
notes: notes:
- Tested against ENOS 8.4.1.68 - Tested against ENOS 8.4.1
options: options:
gather_subset: gather_subset:
description: description:

View file

@ -72,8 +72,8 @@ options:
deviceType: deviceType:
description: description:
- This specifies the type of device where the method is executed. - This specifies the type of device where the method is executed.
The choices NE1072T,NE1032,NE1032T,NE10032, The choices NE1072T,NE1032,NE1032T,NE10032,NE2572 are added
NE2572 are added since version 2.4 since version 2.4.
required: Yes required: Yes
choices: [g8272_cnos,g8296_cnos,g8332_cnos,NE1072T,NE1032, choices: [g8272_cnos,g8296_cnos,g8332_cnos,NE1072T,NE1032,
NE1032T,NE10032,NE2572] NE1032T,NE10032,NE2572]