- Comware 7 and NETCONF support
- Testing performed on HP 5930s
- pyhpecw7
- comware_ping - ping remote destinations from the comware 7 switch
- comware_vrrp - manages vrrp configurations on a comware v7 device
- comware_file_copy - copy local file to remote comware v7 device
- comware_install_os - copy (if necessary) and install a new operating system on comware v7 device
- comware_irf_ports - manages irf port creation and removal for comware v7 devices
- comware_vxlan - manages vxlan to vsi mappings and tunnel mappings to vxlan
- comware_vlan - manage vlan attributes for comware 7 devices
- comware_reboot - perform a reboot of a comware 7 device
- comware_irf_members - manages irf membership configuration
- comware_l2vpn_global - manage global config state for l2vpn
- comware_neighbors - retrieves active lldp neighbors (read-only)
- comware_ipinterface - manages ipv4/ipv6 addresses on interfaces
- comware_switchport - manages layer 2 parameters on switchport interfaces
- comware_install_config - activate a new current-running config in realtime
- comware_vxlan_tunnel - manages vxlan tunnels on comware 7 devices
- comware_command - execute cli commands on comware 7 devices
- comware_interface - manages physical interface attributes
- comware_facts - gathers facts of comware 7 devices
- comware_save - save the running configuration
- comware_portchannel - manages port-channel (lag) on comware 7 devices
- comware_vrrp_global - manages vrrp global configuration mode
- comware_vxlan_vsi - manages mapping of an ethernet service to a vsi (vxlan id)
- comware_clean_erase - factory default hp comware 7 device
Ping remote destinations from the Comware 7 switch
- Synopsis
- Options
- Examples
Ping remote destinations from the Comware 7 device. Really helpful for reachability testing.
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | no | Username used to login to the switch | ||
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
host | yes | IP or name (resolvable by the switch) that you want to ping | ||
vrf | no | VRF instance pings should be sourced from | ||
password | no | Password used to login to the switch | ||
port | yes | 830 | NETCONF port number |
# test reachability to 8.8.8.8
- comware_ping: host=8.8.8.8 username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
Manages VRRP configurations on a Comware v7 device
- Synopsis
- Options
- Examples
Manages VRRP configurations on a Comware v7 device
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
key_type | no |
|
Type of key, i.e. cipher or clear text | |
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
state | no | present |
|
Desired state for the interface configuration |
vrid | yes | VRRP group ID number | ||
preempt | no |
|
Determine preempt mode for the device | |
auth_mode | no |
|
authentication mode for vrrp | |
priority | no | VRRP priority for the device | ||
vip | no | Virtual IP to assign within the group | ||
key | no | cipher or clear text string | ||
interface | yes | Full name of the Layer 3 interface | ||
password | yes | Password used to login to the switch | ||
port | yes | 830 | NETCONF port number |
# ensure vrid and vrip are configured
- comware_vrrp: vrid=100 vip=100.100.100.1 interface=vlan100 username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# ensure vrid 100 is shutdown
- comware_vrrp: vrid=100 interface=vlan100 state=shutdown username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# simple auth w/ plain text key
- comware_vrrp: vrid=100 interface=vlan100 auth_mode=simple key_type=plain key=testkey username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# md5 auth w/ cipher
- comware_vrrp: vrid=100 interface=vlan100 auth_mode=md5 key_type=cipher key='$c$3$d+Pc2DO3clxSA2tC6pe3UBzDEDl1dkE+voI=' username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# ensure vrid 100 on vlan 100 is removed
- comware_vrrp: vrid=100 interface=vlan100 state=absent username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
-
When state is set to absent, the vrrp group for a specific interface will be removed (if it exists)
-
When state is set to shutdown, the vrrp group for a specific interface will be shutdown. undoshutdown reverses this operation
-
When sending a text password, the module is not idempotent because a hash is calculated on the switch. sending a cipher that matches the one configured is idempotent.
Copy local file to remote Comware v7 device
- Synopsis
- Options
- Examples
Copy local file to remote Comware v7 device
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
remote_path | no | flash:/ | Full file path on remote Comware v7 device, e.g. flash:/myfile. If no directory is included, flash will be prepended. | |
file | yes | File (including absolute path of local file) that will be sent to the device | ||
password | yes | Password used to login to the switch | ||
port | yes | 830 | NETCONF port number |
# copy file
- comware_file_copy: file=/usr/smallfile remote_path=flash:/otherfile username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
- If the remote directory doesn't exist, it will be automatically created.
Copy (if necessary) and install a new operating system on Comware v7 device
- Synopsis
- Options
- Examples
Offers ability to copy and install a new operating system on Comware v7 devices. Supports using .ipe or .bin system and boot packages.
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
delete_ipe | no |
|
If ipe_package is used, this specifies whether the .ipe file is deleted from the device after it is unpacked. | |
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
boot | no | File (including abs path) of the boot package (.bin) | ||
system | no | File (including abs path) of the system package (.bin) | ||
reboot | yes |
|
Determine if the reboot should take place after device startup software image is configured | |
delay | no | If reboot is set to yes, this is the delay in minutes to wait before rebooting. | ||
remote_dir | no | flash:/ | The remote directory into which the file(s) would be copied. See default. | |
ipe_package | no | File (including abs path path) of the ipe package. | ||
password | yes | Password used to login to the switch | ||
port | yes | 830 | NETCONF port number |
-
The parameters ipe_package and boot/system are mutually exclusive.
-
If the files are not currently on the device, the will be transfered to the device.
Manages IRF port creation and removal for Comware v7 devices
- Synopsis
- Options
- Examples
Manages IRF port creation and removal for Comware v7 devices
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
password | yes | Password used to login to the switch | ||
activate | no | True |
|
activate the IRF after the configuration is initially performed |
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
irf_p2 | yes | Physical Interface or List of Physical Interfaces that will be bound to IRF port 2. Any physical interfaces not in the list will be removed from the IRF port. An empty list removes all interfaces. | ||
irf_p1 | yes | Physical Interface or List of Physical Interfaces that will be bound to IRF port 1. Any physical interfaces not in the list will be removed from the IRF port. An empty list removes all interfaces. | ||
member_id | yes | IRF member id for switch (must be unique). IRF member ids can be configured with the comware_irf_members module. | ||
filename | no | startup.cfg | Where to save the current configuration. Default is startup.cfg. | |
port | yes | 830 | NETCONF port number | |
removal_override | no | False |
|
When set to true, allows the removal of physical ports from IRF port(s). Removing physical ports may have adverse effects and be disallowed by the switch. Disconnecting all IRF ports could lead to a split-brain scenario. |
# irf ports
- comware_irf_ports:
member_id: 1
irf_p1:
- FortyGigE1/0/1
- FortyGigE1/0/3
irf_p2: FortyGigE1/0/2
username: "{{ username }}"
password: "{{ password }}"
hostname: "{{ inventory_hostname }}"
removal_override: yes
-
This module is meant to be run after the comware_irf_members module.
-
Any physical interfaces not in an interface list (irf_p1 or irf_p2) will be removed from the IRF port. An empty list removes all interfaces.
-
If an IRF is succesfully created, the non-master members will no longer be accessible through their management interfaces.
-
The process is as follows 1) Use comware_irf_members to change the IRF member identity of the device. 2) Use the reboot=true flag or reboot the device through some other means. 3) Use the comware_irf_ports module to create IRF port to physical port bindings. 4) In that module set activate=true to activate the IRF. If IRF neighbors are already configured, the IRF will be formed, some devices may reboot.
Manages VXLAN to VSI mappings and Tunnel mappings to VXLAN
- Synopsis
- Options
- Examples
Manages VXLAN to VSI mappings and Tunnel mappings to VXLAN
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
descr | yes | description of the VSI | ||
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
state | no | present |
|
Desired state for the interface configuration |
tunnels | no | Desired Tunnel interface ID or a list of IDs. Any tunnel not in the list will be removed if it exists | ||
vsi | yes | Name of the VSI | ||
password | yes | Password used to login to the switch | ||
port | yes | 830 | NETCONF port number | |
vxlan | yes | VXLAN that will be mapped to the VSI |
# ensure VXLAN and VSI do not exist
- comware_vxlan: vxlan=100 vsi=VSI_VXLAN_100 tunnels=20 state=absent username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# ensure VXLAN 100 exists and is mapped to VSI VSI_VXLAN_100 with only tunnel interface 20
- comware_vxlan: vxlan=100 vsi=VSI_VXLAN_100 tunnels=20 username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# ensure 3 tunnels mapped to the vxlan
- comware_vxlan:
vxlan: 100
vsi: VSI_VXLAN_100
tunnels: ['20', '21', '22']
username: "{{ username }}"
password: "{{ password }}"
hostname: "{{ inventory_hostname }}"
-
VXLAN tunnels should be created before using this module.
-
state=absent removes the vsi and associated vxlan mapping if they both exist.
-
Remember that is a 1 to 1 mapping between vxlan IDs and VSIs
Manage VLAN attributes for Comware 7 devices
- Synopsis
- Options
- Examples
Manage VLAN attributes for Comware 7 devices
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
name | no | Name to configure for the specified VLAN ID | ||
descr | no | Description for the VLAN | ||
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
vlanid | yes | VLAN ID to configure | ||
password | yes | Password used to login to the switch | ||
port | yes | 830 | NETCONF port number |
# ensure VLAN 10 exists
- comware_vlan: vlanid=10 name=VLAN10_WEB descr=LOCALSEGMENT state=present username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# update name and descr
- comware_vlan: vlanid=10 name=WEB10 descr=WEBDESCR state=present username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# ensure VLAN 10 does not exist
- comware_vlan: vlanid=10 state=absent username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
Perform a reboot of a Comware 7 device
- Synopsis
- Options
- Examples
Offers ability to reboot Comware 7 devices instantly at a scheduled time, or after a given period of time
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | no | Username used to login to the switch | ||
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
reboot | yes |
|
Needs to be set to true to reboot the device | |
delay | no | Delay (in minutes) to wait to reboot the device | ||
time | no | Specify the time at which the reboot will take place. Format should be HH:MM enclosed in quotes. | ||
date | no | Specify the date at which the reboot will take place. The time parameter is required to use this parameter. Format should be MM/DD/YYYY in quotes. | ||
password | no | Password used to login to the switch | ||
port | yes | 830 | NETCONF port number |
# name: reboot immedidately
- comware_reboot: reboot=true username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# name: reboot at 5:00
- comware_reboot: reboot=true time="05:00" username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# name: reboot in 5 minutes
- comware_reboot: reboot=true delay="05:00" username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# name: reboot at 22:00 on July 30 2015
- comware_reboot: reboot=true time="22:00" date="07/10/2015" username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
-
Time/date and delay are mutually exclusive parameters
-
Time is required when specifying date
-
Reboot must be set to true to reboot the device
-
This module is not idempotent
Manages IRF membership configuration
- Synopsis
- Options
- Examples
Manages IRF member configuration. This module should be used before the comware_irf_ports module. The process is as follows 1) Use comware_irf_members to change the IRF member identity of the device. 2) Use the reboot=true flag or reboot the device through some other means. 3) Use the comware_irf_ports module to create IRF port to physical port bindings. 4) In that module set activate=true to activate the IRF. If IRF neighbors are already configured, the IRF will be formed, some devices may reboot.
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
priority | no | The desired IRF priority for the switch. | ||
descr | no | False | The text description of the IRF member switch. | |
state | no | present |
|
Desired state of the interfaces listed in mad_exclude |
auto_update | no |
|
Whether software autoupdate should be enabled for the fabric. | |
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
reboot | yes | False | Whether to reboot the switch after member changes are made. | |
new_member_id | no | The desired IRF member ID for the switch. The new member ID takes effect after a reboot. | ||
mad_exclude | no | Interface or list of interfaces that should be excluded from shutting down in a recovery event. | ||
member_id | yes | Current IRF member ID of the switch. If the switch has not been configured for IRF yet, this should be 1. | ||
password | yes | Password used to login to the switch | ||
port | yes | 830 | NETCONF port number |
# irf members
- comware_irf_members:
member_id: 9
state: present
auto_update: disable
mad_exclude:
- FortyGigE9/0/30
- FortyGigE9/0/23
- FortyGigE9/0/24
priority: 4
descr: My description
reboot: no
username: "{{ username }}"
password: "{{ password }}"
hostname: "{{ inventory_hostname }}"
- When state=absent, the interfaces in mad_exclude will be removed if present. Other parameters will be ignored.
Manage global config state for L2VPN
- Synopsis
- Options
- Examples
Enable or Disable L2VPN on a HP Comware 7 device
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
state | yes |
|
Desired state for l2vpn global configuration | |
password | yes | Password used to login to the switch | ||
hostname | yes | IP Address or hostname of the Comware 7 device that has NETCONF enabled | ||
port | yes | 830 | NETCONF port number |
# enable l2vpn globally
- comware_l2vpn_global: state=enabled username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
Retrieves active LLDP neighbors (read-only)
- Synopsis
- Options
- Examples
Retrieves active LLDP neighbors (read-only)
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
password | yes | Password used to login to the switch | ||
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
neigh_type | no | lldp |
|
type of neighbors |
port | yes | 830 | NETCONF port number |
# get lldp neighbors
- comware_neighbors: username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
Manages IPv4/IPv6 addresses on interfaces
- Synopsis
- Options
- Examples
Manages IPv4/IPv6 addresses on interfaces
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
name | yes | Full name of the interface | ||
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
mask | yes | The network mask, in dotted decimal or prefix length notation. If using IPv6, only prefix length is supported. | ||
state | no | present |
|
Desired state of the switchport |
version | yes | v4 |
|
v4 for IPv4, v6 for IPv6 |
password | yes | Password used to login to the switch | ||
port | yes | 830 | NETCONF port number | |
addr | yes | The IPv4 or IPv6 address of the interface |
# Basic IPv4 config
- comware_ipinterface: name=FortyGigE1/0/3 addr=192.168.3.5 mask=255.255.255.0 username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# Basic IPv6 config
- comware_ipinterface: version=v6 name=FortyGigE1/0/3 addr=2001:DB8::1 mask=10 username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
-
If the interface is not configured to be a layer 3 port, the module will fail and the user should use the interface module to convert the interface with type=routed
-
If state=absent, the specified IP address will be removed from the interface. If the existing IP address doesn't match the specified, the existing will not be removed.
Manages Layer 2 parameters on switchport interfaces
- Synopsis
- Options
- Examples
Manages Layer 2 parameters on switchport interfaces
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
name | yes | Full name of the interface | ||
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
pvid | no | If link_type is set to trunk this will be used as the native native VLAN ID for that trunk. If link_type is set to access then this is the VLAN ID of the interface. | ||
state | no | present |
|
Desired state of the switchport |
permitted_vlans | no | If mode is set to trunk this will be the complete list/range of VLANs allowed on that trunk interface. Any VLAN not in the list will be removed from the interface. | ||
password | yes | Password used to login to the switch | ||
port | yes | 830 | NETCONF port number | |
link_type | yes |
|
Layer 2 mode of the interface |
# Basic access config
- comware_switchport: name=FortyGigE1/0/2 link_type=access username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# Basic trunk config
- comware_switchport: name=FortyGigE1/0/2 link_type=trunk username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
-
If the interface is configured to be a Layer 3 port, the module will fail and ask the user to use the comware_interface module to convert it to be a Layer 2 port first.
-
If the interface is a member in a LAG, the module will fail telling the user changes hould be made to the LAG interface
-
If VLANs are trying to be assigned that are not yet created on the switch, the module will fail asking the user to create them first.
-
If state=default, the switchport settings will be defaulted. That means it will be set as an access port in VLAN 1.
Activate a new current-running config in realtime
- Synopsis
- Options
- Examples
Activate a new current-running config in realtime
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
config_file | yes | File that will be sent to the device. Relative path is location of Ansible playbook. Recommended to use absolute path. | ||
hostname | yes | IP Address or hostname of the Comware 7 device that has NETCONF enabled | ||
diff_file | no | File that will be used to store the diffs. Relative path is location of ansible playbook. If not set, no diffs are saved. | ||
password | yes | Password used to login to the switch | ||
port | yes | 830 | NETCONF port number | |
commit_changes | yes |
|
Used to determine the action to take after transferring the config to the switch. Either activate using the rollback feature or load on next-reboot. |
# install config file that will be the new running config
- comware_install_config:
config_file='/home/ansible/projects/pyhpecw7comware/newconfig.cfg'
diff_file='/home/ansible/projects/pyhpecw7comware/diffs.diff'
commit_changes=true
username={{ username }}
password={{ password }}
hostname={{ inventory_hostname }}
-
Check mode copies config file to device and still generates diffs
-
diff_file must be specified to write diffs to a file, otherwise, only summarized diffs are returned from the module
-
commit_changes must be true to apply changes
-
this module does an automatic backup of the existing config to the filename flash:/safety_file.cfg
-
this module does an auto save to flash:/startup.cfg upon completion
-
config_file MUST be a valid FULL config file for a given device.
Manages VXLAN tunnels on Comware 7 devices
- Synopsis
- Options
- Examples
Manages VXLAN tunnels on Comware 7 devices
Parameter | required | default | choices | comments |
---|---|---|---|---|
global_src | no | Global source address for VXLAN tunnels | ||
src | no | Source address or interface for the tunnel | ||
tunnel | yes | Tunnel interface identifier | ||
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
username | yes | Username used to login to the switch | ||
dest | no | Destination address for the tunnel | ||
state | no | present |
|
Desired state for the interface configuration |
password | yes | Password used to login to the switch | ||
port | yes | 830 | NETCONF port number |
# ensure tunnel interface 20 exists for vxlan and configures a global source address (although it's not used here)
- comware_vxlan_tunnel: tunnel=20 global_src=10.10.10.10 src=10.1.1.1 dest=10.1.1.2 username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# ensure tunnel interface 21
- comware_vxlan_tunnel: tunnel=21 src=10.1.1.1 dest=10.1.1.2 username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# ensure tunnel interface 21 does not exist (does not have to be a vxlan tunnel)
- comware_vxlan_tunnel: tunnel=21 state=absent username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
-
state=absent removes the tunnel interface if it exists
-
state=absent can also remove non-vxlan tunnel interfaces
Execute CLI commands on Comware 7 devices
- Synopsis
- Options
- Examples
Execute CLI commands on Comware 7 devices
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | no | Username used to login to the switch | ||
hostname | yes | IP Address or hostname of the Comware 7 device that has NETCONF enabled | ||
command | yes | String (single command) or list of commands to be executed on the device. Sending a list requires YAML format to be used in the playbook. | ||
password | no | Password used to login to the switch | ||
type | yes |
|
State whether the commands are display (user view) or configure (system view) commands. Display and show are the same thing. | |
port | yes | 830 | NETCONF port number |
# display vlan 10 passing in a string
- comware_command: command='display vlan 5' type=display username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# display vlans passing in a list
- comware_command:
command:
- display vlan 10
- display vlan 5
type: display
username: "{{ username }}"
password: "{{ password }}"
hostname: "{{ inventory_hostname }}"
# passing in config commands as a list
- comware_command:
command:
- vlan 5
- name web_vlan
type: config
username: "{{ username }}"
password: "{{ password }}"
hostname: "{{ inventory_hostname }}"
- This module is not idempotent
Manages physical interface attributes
- Synopsis
- Options
- Examples
Manages administrative state and physical attributes of the interface
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
name | yes | Full name of the interface | ||
admin | no | up |
|
Admin state of the interface |
speed | no | Speed of the interface in Mbps | ||
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
duplex | no |
|
Duplex of the interface | |
state | no | present |
|
Desired state for the interface configuration |
password | yes | Password used to login to the switch | ||
type | no |
|
Type of interface, i.e. L2 or L3 | |
port | no | 830 | The Comware port used to connect to the switch | |
description | no | Single line description for the interface |
-
Only logical interfaces can be removed with state=absent.
-
If you want to configure type, run this module first with no other interface parameters. Then, remove the type parameter and include the other desired parameters. The type parameter defaults the other parameters.
-
When state is set to default, the interface will be "defaulted" regardless of what other parameters are entered.
-
When state is set to default, the interface must already exist.
-
When state is set to absent, logical interfaces will be removed from the switch, while physical interfaces will be "defaulted"
-
Tunnel interface creation and removal is not currently supported.
Gathers facts of Comware 7 devices
- Synopsis
- Options
- Examples
Gathers fact data (characteristics) of Comware 7 devices
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | no | Username used to login to the switch | ||
password | no | Password used to login to the switch | ||
hostname | yes | IP Address or hostname of the Comware 7 device that has NETCONF enabled | ||
port | yes | 830 | NETCONF port number |
# get facts
- comware_facts: username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
Save the running configuration
- Synopsis
- Options
- Examples
Save the running configuration
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
password | yes | Password used to login to the switch | ||
hostname | yes | IP Address or hostname of the Comware 7 device that has NETCONF enabled | ||
filename | no | startup.cfg | Name of file that will be used when saving the current running conifg to flash. |
# save as myfile.cfg (in flash)
- comware_save: filename=myfile.cfg username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# save as startup.cfg (in flash)
- comware_save: username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
- This modules saves the running config as startup.cfg in flash. or YOUR_FILENAME, which will also be saved to flash. It is not changing the config file to load on next-boot.
Manages port-channel (LAG) on Comware 7 devices
- Synopsis
- Options
- Examples
Manages routed and bridged aggregation configurations on Comware 7 devices. This includes physical interface configs for LACP.
Parameter | required | default | choices | comments |
---|---|---|---|---|
min_ports | no | Minimum number of selected ports for the agg group | ||
username | yes | Username used to login to the switch | ||
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
group | yes | Group number to identify the Aggregate interface | ||
max_ports | no | Maximum number of selected ports for the agg group | ||
lacp_mode | no | active |
|
If mode is set to LACP, the type operating mode can be selected. This mode will then be set for all members in the group. |
state | no | present |
|
Desired state for the interface configuration |
mode | no | dynamic |
|
Mode of the Aggregate interface |
members | no | COMPLETE Interface List that should be in the agg group. Full names should be used AND Interface names ARE case sensitive. For example, FortyGigE1/0/1 should NOT be written as fortygige1/0/1. This is for safety. | ||
lacp_edge | no |
|
Determine if an LACP agg group should be an edge aggregate interface | |
password | yes | Password used to login to the switch | ||
type | yes |
|
Type of the Aggregate interface (L2 or L3) | |
port | yes | 830 | NETCONF port number |
# Portchannel config
- comware_portchannel:
group: 100
members:
- FortyGigE1/0/27
- FortyGigE1/0/28
- FortyGigE1/0/29
- FortyGigE1/0/30
type: routed
mode: static
min_ports: 2
max_ports: 4
username: "{{ username }}"
password: "{{ password }}"
hostname: "{{ inventory_hostname }}"
state: present
-
When configuring a LAGG, the members param must be included
-
Members is ALL members - it is ensuring that the members sent is the full list of all members. This means to remove a member it just needs to be removed from the members list.
-
When removing a LAGG, members is not required
-
If mode is set to static, lacp_edge and lacp_mode are disregarded if those params are set
Manages VRRP global configuration mode
- Synopsis
- Options
- Examples
Manages VRRP global configuration mode
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
password | yes | Password used to login to the switch | ||
port | yes | 830 | NETCONF port number | |
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
mode | yes |
|
vrrp config mode for the switch |
# configure load-balance mode
- comware_vrrp_global: mode=load-balance username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
Manages mapping of an Ethernet Service to a VSI (VXLAN ID)
- Synopsis
- Options
- Examples
Manages the mapping of an Ethernet Service to a VSI (VXLAN ID)
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
password | yes | Password used to login to the switch | ||
hostname | yes | IP Address or hostname of the Comware v7 device that has NETCONF enabled | ||
vlanid | no | If encap is set to only-tagged or s-vid, vlanid must be set. | ||
instance | yes | Service instance id | ||
state | no | present |
|
Desired state for the interface configuration |
encap | no | default |
|
only-tagged also ensures s-vid |
interface | yes | Layer 2 interface or bridged-interface | ||
vsi | no | Name of the VSI | ||
access_mode | no | vlan |
|
Mapping Ethernet service instance to a VSI using Ethernet or VLAN mode (options for xconnect command) |
port | yes | 830 | NETCONF port number |
# ensure the vsi is not mapped to the instance
- comware_vxlan_vsi: interface=Fo1/0/32 vsi=VSI_VXLAN_100 instance=100 state=absent username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# ensure instance and vsi and configured with encap and access mode as specified
- comware_vxlan_vsi: interface=Fo1/0/32 vsi=VSI_VXLAN_100 instance=100 encap=default access_mode=vlan username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# ensure instance and vsi and configured with encap and access mode as specified
- comware_vxlan_vsi: interface=Fo1/0/32 vsi=VSI_VXLAN_100 instance=100 encap=tagged access_mode=ethernet username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
# ensure instance and vsi and configured with encap and access mode as specified
- comware_vxlan_vsi: interface=Fo1/0/32 vsi=VSI_VXLAN_100 instance=100 encap=only-tagged vlanid=10 state=present username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
-
VSI needs to be created before using this module (comware_vxlan)
-
encap and xconnect access_mode cannot be altered once set to change, use state=absent and re-configure
-
state=absent removes the service instance for specified interface if if it exists
-
This should be the last VXLAN module used after comware_vxlan_tunnel, and comware_vxlan.
Factory default HP Comware 7 device
- Synopsis
- Options
- Examples
Reset system to factory default settings. You will lose connectivity to the switch. This module deletes all configuration files (.cfg files) in the root directories of the storage media. It Deletes all log files (.log files in the folder /logfile). Clears all log information (in the log buffer), trap information, and debugging information. Restores the parameters for the Boot ROM options to the factory-default settings. Deletes all files on an installed hot-swappable storage medium, such as a USB disk
Parameter | required | default | choices | comments |
---|---|---|---|---|
username | yes | Username used to login to the switch | ||
password | yes | Password used to login to the switch | ||
factory_default | yes |
|
Set to true if all logs and user-created files should be deleted and removed from the system and the device should be set to factory default settings | |
hostname | yes | IP Address or hostname of the Comware 7 device that has NETCONF enabled | ||
port | yes | 830 | NETCONF port number |
# factory default and reboot immediately
- comware_clean_erase: factory_default=true username={{ username }} password={{ password }} hostname={{ inventory_hostname }}
Created by Network to Code, LLC For: 2015