huawei.enterprise.hw_enterprise_port module – Port operations for Huawei Enterprise Storage
Note
This module is part of the huawei.enterprise collection (version 2.0.0).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install huawei.enterprise.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: huawei.enterprise.hw_enterprise_port.
Synopsis
Only supports query for fc port and eth port.
Requirements
The below requirements are needed on the host that executes this module.
Huawei Dorado v5/v6/v7 and OceanStor v5/v6/v7 Storage
Parameters
Parameter |
Comments |
|---|---|
Parameters used to extend those not currently supported by the module. Configuration needs to be based on the REST API documentation for storage. If necessary, you can contact the plugin technical support for assistance. |
|
Parameter required for all query operations. The response will include the storage parameters that match the indicate filter criteria. Choices:
|
|
IP or FQDN of the huawei enterprise management system. MultiIP config as ip1,ip2 |
|
Initiator unique id, Mutually exclusive with “name”, Priority is higher than name. Required for create operation. |
|
Eth port logic type. Can be set when multi Query eth port. Choices:
|
|
The password of the PowerStore host. |
|
Huawei Enterprise Storage rest api Timeout time. Default: |
|
Define whether the Initiator should exist or not. Choices:
|
|
Port number for the Huawei Enterprise array. If not passed, it will take 8088 as default. Default: |
|
Which type port you want to operate. Choices:
|
|
Whether to write plugin log to local filesystem. Choices:
|
|
The username of the PowerStore host. |
|
The path of the SSL certificate variable to specify whether to validate SSL certificate or not. If don’t set means no need to verify ssl cert. |
Notes
Note
The check_mode is not supported.
The modules present in this collection named as ‘huawei.enterprise’ are built to support the Huawei Enterprise Storage System.
Examples
---
tasks:
- name: Query eth port by id
register: eth_port_info
huawei.enterprise.hw_enterprise_port:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "< eth_port_id >"
type: "eth_port"
filter:
- id
- name
- location
- health_status
- running_status
- mac_address
- ipv4_addr
- ipv6_addr
- speed
- max_speed
- logic_type
- num_of_initiator
state: "present"
- name: Query multi eth port by condition param
register: all_eth_port
huawei.enterprise.hw_enterprise_port:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
type: "eth_port"
logic_type: " < logic_type > "
filter:
- id
- name
- location
- health_status
- running_status
- mac_address
- ipv4_addr
- ipv6_addr
- speed
- max_speed
- logic_type
- num_of_initiator
state: "present"
- name: Query fc port by id
register: fc_port_info
huawei.enterprise.hw_enterprise_port:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
id: "{{ fc_port_id }}"
type: "fc_port"
filter:
- id
- name
- location
- health_status
- running_status
- wwn
- run_speed
- max_speed
- fc_run_mode
- num_of_ini
- protocol
state: "present"
- name: query multi fc port
register: all_fc_port
huawei.enterprise.hw_enterprise_port:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
valid_certs: "{{ valid_certs }}"
socket_timeout: "{{ socket_timeout }}"
storage_port: "{{ storage_port }}"
use_log: "{{ use_log }}"
type: "fc_port"
filter:
- id
- name
- location
- health_status
- running_status
- wwn
- run_speed
- max_speed
- fc_run_mode
- num_of_ini
- protocol
state: "present"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
playbook action lists Returned: always Sample: |
|
Whether or not the resource has changed. Returned: always Sample: |
|
Details of the port. Returned: When port exists Sample: |
|
Operating mode of fc port. Returned: success |
|
Health status of the port. Returned: success |
|
The system generated ID given to the port. Returned: success |
|
IPv4 address of the port. Returned: success |
|
IPv6 address of the port. Returned: success |
|
Location of the port. Returned: success |
|
Type of multipath. Returned: success |
|
MAC address of eth port. Returned: success |
|
Max working rate. Returned: success |
|
Name of the port. Returned: success |
|
Initiators number of port. Returned: success |
|
Protocol type of the fc port. Returned: success |
|
Operating speed. Returned: success |
|
Running status of the port. Returned: success |
|
Port working rate. Returned: success |
|
task execute remark Returned: always Sample: |