1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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
This commit is contained in:
Anil Kumar Muraleedharan 2018-10-11 19:19:49 +05:30 committed by Nathaniel Case
parent b3063e37be
commit d0e89bc1bb
33 changed files with 266 additions and 484 deletions

View file

@ -73,6 +73,11 @@ def getRuleString(deviceType, variableId):
retVal = retVal + NE2572[variableId] retVal = retVal + NE2572[variableId]
else: else:
retVal = "The variable " + variableId + " is not supported" retVal = "The variable " + variableId + " is not supported"
elif(deviceType == 'NE0152T'):
if variableId in NE0152T:
retVal = retVal + NE0152T[variableId]
else:
retVal = "The variable " + variableId + " is not supported"
else: else:
if variableId in default_cnos: if variableId in default_cnos:
retVal = retVal + default_cnos[variableId] retVal = retVal + default_cnos[variableId]
@ -268,6 +273,192 @@ default_cnos = {
egress-only', egress-only',
'vrrp_id': 'INTEGER_VALUE:1-255', 'vrrp_id': 'INTEGER_VALUE:1-255',
} }
NE0152T = {
'vlan_id': 'INTEGER_VALUE:1-3999',
'vlan_id_range': 'INTEGER_VALUE_RANGE:1-3999',
'vlan_name': 'TEXT:',
'vlan_flood': 'TEXT_OPTIONS:ipv4,ipv6',
'vlan_state': 'TEXT_OPTIONS:active,suspend',
'vlan_last_member_query_interval': 'INTEGER_VALUE:1-25',
'vlan_querier': 'IPV4Address:',
'vlan_querier_timeout': 'INTEGER_VALUE:1-65535',
'vlan_query_interval': 'INTEGER_VALUE:1-18000',
'vlan_query_max_response_time': 'INTEGER_VALUE:1-25',
'vlan_report_suppression': 'INTEGER_VALUE:1-25',
'vlan_robustness_variable': 'INTEGER_VALUE:1-7',
'vlan_startup_query_count': 'INTEGER_VALUE:1-10',
'vlan_startup_query_interval': 'INTEGER_VALUE:1-18000',
'vlan_snooping_version': 'INTEGER_VALUE:2-3',
'vlan_access_map_name': 'TEXT: ',
'vlan_ethernet_interface': 'TEXT:',
'vlan_portagg_number': 'INTEGER_VALUE:1-4096',
'vlan_accessmap_action': 'TEXT_OPTIONS:drop,forward,redirect',
'vlan_dot1q_tag': 'MATCH_TEXT_OR_EMPTY:egress-only',
'vlan_filter_name': 'TEXT:',
'vlag_auto_recovery': 'INTEGER_VALUE:240-3600',
'vlag_config_consistency': 'TEXT_OPTIONS:disable,strict',
'vlag_instance': 'INTEGER_VALUE:1-64',
'vlag_port_aggregation': 'INTEGER_VALUE:1-4096',
'vlag_priority': 'INTEGER_VALUE:0-65535',
'vlag_startup_delay': 'INTEGER_VALUE:0-3600',
'vlag_tier_id': 'INTEGER_VALUE:1-512',
'vlag_hlthchk_options': 'TEXT_OPTIONS:keepalive-attempts,\
keepalive-interval,peer-ip,retry-interval',
'vlag_keepalive_attempts': 'INTEGER_VALUE:1-24',
'vlag_keepalive_interval': 'INTEGER_VALUE:2-300',
'vlag_retry_interval': 'INTEGER_VALUE:1-300',
'vlag_peerip': 'IPV4Address:',
'vlag_peerip_vrf': 'TEXT_OPTIONS:default,management',
'bgp_as_number': 'NO_VALIDATION:1-4294967295',
'bgp_address_family': 'TEXT_OPTIONS:ipv4,ipv6',
'bgp_bgp_local_count': 'INTEGER_VALUE:2-64',
'cluster_id_as_ip': 'IPV4Address:',
'cluster_id_as_number': 'NO_VALIDATION:1-4294967295',
'confederation_identifier': 'INTEGER_VALUE:1-65535',
'condeferation_peers_as': 'INTEGER_VALUE:1-65535',
'stalepath_delay_value': 'INTEGER_VALUE:1-3600',
'maxas_limit_as': 'INTEGER_VALUE:1-2000',
'neighbor_ipaddress': 'IPV4Address:',
'neighbor_as': 'NO_VALIDATION:1-4294967295',
'router_id': 'IPV4Address:',
'bgp_keepalive_interval': 'INTEGER_VALUE:0-3600',
'bgp_holdtime': 'INTEGER_VALUE:0-3600',
'bgp_aggregate_prefix': 'IPV4AddressWithMask:',
'addrfamily_routemap_name': 'TEXT:',
'reachability_half_life': 'INTEGER_VALUE:1-45',
'start_reuse_route_value': 'INTEGER_VALUE:1-20000',
'start_suppress_route_value': 'INTEGER_VALUE:1-20000',
'max_duration_to_suppress_route': 'INTEGER_VALUE:1-255',
'unreachability_halftime_for_penalty': 'INTEGER_VALUE:1-45',
'distance_external_AS': 'INTEGER_VALUE:1-255',
'distance_internal_AS': 'INTEGER_VALUE:1-255',
'distance_local_routes': 'INTEGER_VALUE:1-255',
'maxpath_option': 'TEXT_OPTIONS:ebgp,ibgp',
'maxpath_numbers': 'INTEGER_VALUE:2-32',
'network_ip_prefix_with_mask': 'IPV4AddressWithMask:',
'network_ip_prefix_value': 'IPV4Address:',
'network_ip_prefix_mask': 'IPV4Address:',
'nexthop_crtitical_delay': 'NO_VALIDATION:1-4294967295',
'nexthop_noncrtitical_delay': 'NO_VALIDATION:1-4294967295',
'addrfamily_redistribute_option': 'TEXT_OPTIONS:direct,ospf,\
static',
'bgp_neighbor_af_occurances': 'INTEGER_VALUE:1-10',
'bgp_neighbor_af_filtername': 'TEXT:',
'bgp_neighbor_af_maxprefix': 'INTEGER_VALUE:1-15870',
'bgp_neighbor_af_prefixname': 'TEXT:',
'bgp_neighbor_af_routemap': 'TEXT:',
'bgp_neighbor_address_family': 'TEXT_OPTIONS:ipv4,ipv6',
'bgp_neighbor_connection_retrytime': 'INTEGER_VALUE:1-65535',
'bgp_neighbor_description': 'TEXT:',
'bgp_neighbor_maxhopcount': 'INTEGER_VALUE:1-255',
'bgp_neighbor_local_as': 'NO_VALIDATION:1-4294967295',
'bgp_neighbor_maxpeers': 'INTEGER_VALUE:1-96',
'bgp_neighbor_password': 'TEXT:',
'bgp_neighbor_timers_Keepalive': 'INTEGER_VALUE:0-3600',
'bgp_neighbor_timers_holdtime': 'INTEGER_VALUE:0-3600',
'bgp_neighbor_ttl_hops': 'INTEGER_VALUE:1-254',
'bgp_neighbor_update_options': 'TEXT_OPTIONS:ethernet,loopback,\
vlan',
'bgp_neighbor_update_ethernet': 'TEXT:',
'bgp_neighbor_update_loopback': 'INTEGER_VALUE:0-7',
'bgp_neighbor_update_vlan': 'INTEGER_VALUE:1-4094',
'bgp_neighbor_weight': 'INTEGER_VALUE:0-65535',
'ethernet_interface_value': 'INTEGER_VALUE:1-52',
'ethernet_interface_range': 'INTEGER_VALUE_RANGE:1-52',
'ethernet_interface_string': 'TEXT:',
'loopback_interface_value': 'INTEGER_VALUE:0-7',
'mgmt_interface_value': 'INTEGER_VALUE:0-0',
'vlan_interface_value': 'INTEGER_VALUE:1-4094',
'portchannel_interface_value': 'INTEGER_VALUE:1-4096',
'portchannel_interface_range': 'INTEGER_VALUE_RANGE:1-4096',
'portchannel_interface_string': 'TEXT:',
'aggregation_group_no': 'INTEGER_VALUE:1-4096',
'aggregation_group_mode': 'TEXT_OPTIONS:active,on,passive',
'bfd_options': 'TEXT_OPTIONS:authentication,echo,interval,ipv4,\
ipv6,neighbor',
'bfd_interval': 'INTEGER_VALUE:50-999',
'bfd_minrx': 'INTEGER_VALUE:50-999',
'bfd_ multiplier': 'INTEGER_VALUE:3-50',
'bfd_ipv4_options': 'TEXT_OPTIONS:authentication,echo,\
interval',
'bfd_auth_options': 'TEXT_OPTIONS:keyed-md5,keyed-sha1,\
meticulous-keyed-md5,meticulous-keyed-sha1,simple',
'bfd_key_options': 'TEXT_OPTIONS:key-chain,key-id',
'bfd_key_chain': 'TEXT:',
'bfd_key_id': 'INTEGER_VALUE:0-255',
'bfd_key_name': 'TEXT:',
'bfd_neighbor_ip': 'TEXT:',
'bfd_neighbor_options': 'TEXT_OPTIONS:admin-down,multihop,\
non-persistent',
'bfd_access_vlan': 'INTEGER_VALUE:1-3999',
'bfd_bridgeport_mode': 'TEXT_OPTIONS:access,dot1q-tunnel,\
trunk',
'trunk_options': 'TEXT_OPTIONS:allowed,native',
'trunk_vlanid': 'INTEGER_VALUE:1-3999',
'portCh_description': 'TEXT:',
'duplex_option': 'TEXT_OPTIONS:auto,full,half',
'flowcontrol_options': 'TEXT_OPTIONS:receive,send',
'portchannel_ip_options': 'TEXT_OPTIONS:access-group,address,\
arp,dhcp,ospf,port,port-unreachable,redirects,router,\
unreachables',
'accessgroup_name': 'TEXT:',
'portchannel_ipv4': 'IPV4Address:',
'portchannel_ipv4_mask': 'TEXT:',
'arp_ipaddress': 'IPV4Address:',
'arp_macaddress': 'TEXT:',
'arp_timeout_value': 'INTEGER_VALUE:60-28800',
'relay_ipaddress': 'IPV4Address:',
'ip_ospf_options': 'TEXT_OPTIONS:authentication,\
authentication-key,bfd,cost,database-filter,dead-interval,\
hello-interval,message-digest-key,mtu,mtu-ignore,network,\
passive-interface,priority,retransmit-interval,shutdown,\
transmit-delay',
'ospf_id_decimal_value': 'NO_VALIDATION:1-4294967295',
'ospf_id_ipaddres_value': 'IPV4Address:',
'lacp_options': 'TEXT_OPTIONS:port-priority,suspend-individual,\
timeout',
'port_priority': 'INTEGER_VALUE:1-65535',
'lldp_options': 'TEXT_OPTIONS:receive,tlv-select,transmit,\
trap-notification',
'lldp_tlv_options': 'TEXT_OPTIONS:link-aggregation,\
mac-phy-status,management-address,max-frame-size,\
port-description,port-protocol-vlan,port-vlan,power-mdi,\
protocol-identity,system-capabilities,system-description,\
system-name,vid-management,vlan-name',
'load_interval_delay': 'INTEGER_VALUE:30-300',
'load_interval_counter': 'INTEGER_VALUE:1-3',
'mac_accessgroup_name': 'TEXT:',
'mac_address': 'TEXT:',
'microburst_threshold': 'NO_VALIDATION:1-4294967295',
'mtu_value': 'INTEGER_VALUE:64-9216',
'service_instance': 'NO_VALIDATION:1-4294967295',
'service_policy_options': 'TEXT_OPTIONS:copp-system-policy,\
input,output,type',
'service_policy_name': 'TEXT:',
'spanning_tree_options': 'TEXT_OPTIONS:bpdufilter,bpduguard,\
cost,disable,enable,guard,link-type,mst,port,port-priority,\
vlan',
'spanning_tree_cost': 'NO_VALIDATION:1-200000000',
'spanning_tree_interfacerange': 'INTEGER_VALUE_RANGE:1-3999',
'spanning_tree_portpriority': 'TEXT_OPTIONS:0,32,64,96,128,160,\
192,224',
'portchannel_ipv6_neighbor_mac': 'TEXT:',
'portchannel_ipv6_neighbor_address': 'IPV6Address:',
'portchannel_ipv6_linklocal': 'IPV6Address:',
'portchannel_ipv6_dhcp_vlan': 'INTEGER_VALUE:1-4094',
'portchannel_ipv6_dhcp_ethernet': 'TEXT:',
'portchannel_ipv6_dhcp': 'IPV6Address:',
'portchannel_ipv6_address': 'IPV6Address:',
'portchannel_ipv6_options': 'TEXT_OPTIONS:address,dhcp,\
link-local,nd,neighbor',
'interface_speed': 'TEXT_OPTIONS:10,100,1000,10000,auto',
'stormcontrol_options': 'TEXT_OPTIONS:broadcast,multicast,\
unicast',
'stormcontrol_level': 'FLOAT:',
'portchannel_dot1q_tag': 'TEXT_OPTIONS:disable,enable,\
egress-only',
'vrrp_id': 'INTEGER_VALUE:1-255',
}
NE2572 = { NE2572 = {
'vlan_id': 'INTEGER_VALUE:1-3999', 'vlan_id': 'INTEGER_VALUE:1-3999',
'vlan_id_range': 'INTEGER_VALUE_RANGE:1-3999', 'vlan_id_range': 'INTEGER_VALUE_RANGE:1-3999',

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,11 +72,11 @@ 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. The choice NE0152T is added since 2.8
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,NE0152T]
version_added: 2.3 version_added: 2.3
notes: notes:
- For more information on using Ansible to manage Lenovo Network devices see U(https://www.ansible.com/ansible-lenovo). - For more information on using Ansible to manage Lenovo Network devices see U(https://www.ansible.com/ansible-lenovo).

View file

@ -34,7 +34,7 @@ Variable | Description
`ansible_ssh_pass` | Specifies the password used to log into the switch `ansible_ssh_pass` | Specifies the password used to log into the switch
`enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter) `enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter)
`hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied `hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied
`deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572) `deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572, **NE0152T** - NE0152T)
The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed. The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed.

View file

@ -36,7 +36,7 @@ Variable | Description
`ansible_ssh_pass` | Specifies the password used to log into the switch `ansible_ssh_pass` | Specifies the password used to log into the switch
`enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter) `enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter)
`hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied `hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied
`deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572) `deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572, **NE0152T** - NE0152T)
The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed. The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed.

View file

@ -41,7 +41,7 @@ Variable | Description
`ansible_ssh_pass` | Specifies the password used to log into the switch `ansible_ssh_pass` | Specifies the password used to log into the switch
`enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter) `enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter)
`hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied `hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied
`deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572) `deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572, **NE0152T** - NE0152T)
`condition` | If `condition=false` is specified in the inventory file against any device, the command execution is skipped for that device (**true**, **false**) `condition` | If `condition=false` is specified in the inventory file against any device, the command execution is skipped for that device (**true**, **false**)
The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed. The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed.

View file

@ -42,7 +42,7 @@ Variable | Description
`ansible_ssh_pass` | Specifies the password used to log into the switch `ansible_ssh_pass` | Specifies the password used to log into the switch
`enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter) `enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter)
`hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied `hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied
`deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572) `deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572, **NE0152T** - NE0152T)
`condition` | If `condition=<flag string>` is specified in the inventory file against any device, the template execution is done for that device in case it matches the flag setting for that task `condition` | If `condition=<flag string>` is specified in the inventory file against any device, the template execution is done for that device in case it matches the flag setting for that task
The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed. The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed.

View file

@ -36,7 +36,7 @@ Variable | Description
`ansible_ssh_pass` | Specifies the password used to log into the switch `ansible_ssh_pass` | Specifies the password used to log into the switch
`enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter) `enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter)
`hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied `hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied
`deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572) `deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572, **NE0152T** - NE0152T)
The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed. The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed.

View file

@ -38,7 +38,7 @@ Variable | Description
`ansible_ssh_pass` | Specifies the password used to log into the switch `ansible_ssh_pass` | Specifies the password used to log into the switch
`enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter) `enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter)
`hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied `hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied
`deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572) `deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572, **NE0152T** - NE0152T)
The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed. The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed.

View file

@ -36,7 +36,7 @@ Variable | Description
`ansible_ssh_pass` | Specifies the password used to log into the switch `ansible_ssh_pass` | Specifies the password used to log into the switch
`enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter) `enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter)
`hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied `hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied
`deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572) `deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572, **NE0152T** - NE0152T)
The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed. The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed.

View file

@ -38,7 +38,7 @@ Variable | Description
`ansible_ssh_pass` | Specifies the password used to log into the switch `ansible_ssh_pass` | Specifies the password used to log into the switch
`enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter) `enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter)
`hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied `hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied
`deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572) `deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572, **NE0152T** - NE0152T)
The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed. The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed.

View file

@ -34,7 +34,7 @@ Variable | Description
`ansible_ssh_pass` | Specifies the password used to log into the switch `ansible_ssh_pass` | Specifies the password used to log into the switch
`enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter) `enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter)
`hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied `hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied
`deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572) `deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572, **NE0152T** - NE0152T)
## Dependencies ## Dependencies

View file

@ -34,7 +34,7 @@ Variable | Description
`ansible_ssh_pass` | Specifies the password used to log into the switch `ansible_ssh_pass` | Specifies the password used to log into the switch
`enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter) `enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter)
`hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied `hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied
`deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572) `deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572, **NE0152T** - NE0152T)
## Dependencies ## Dependencies

View file

@ -36,7 +36,7 @@ Variable | Description
`ansible_ssh_pass` | Specifies the password used to log into the switch `ansible_ssh_pass` | Specifies the password used to log into the switch
`enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter) `enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter)
`hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied `hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied
`deviceType` | Specifies the type of device from where the configuration will be backed up(**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572) `deviceType` | Specifies the type of device from where the configuration will be backed up(**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572, **NE0152T** - NE0152T)
The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed. The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed.

View file

@ -36,7 +36,7 @@ Variable | Description
`ansible_ssh_pass` | Specifies the password used to log into the switch `ansible_ssh_pass` | Specifies the password used to log into the switch
`enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter) `enablePassword` | Configures the password used to enter Global Configuration command mode on the switch (this is an optional parameter)
`hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied `hostname` | Searches the hosts file at */etc/ansible/hosts* and identifies the IP address of the switch on which the role is going to be applied
`deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572) `deviceType` | Specifies the type of device from where the configuration will be backed up (**g8272_cnos** - G8272, **g8296_cnos** - G8296, **g8332_cnos** - G8332, **NE10032** - NE10032, **NE1072T** - NE1072T, **NE1032** - NE1032, **NE1032T** - NE1032T, **NE2572** - NE2572, **NE0152T** - NE0152T)
The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed. The values of the variables used need to be modified to fit the specific scenario in which you are deploying the solution. To change the values of the variables, you need to visits the *vars* directory of each role and edit the *main.yml* file located there. The values stored in this file will be used by Ansible when the template is executed.