zhmc_adapter_list – List adapters
Synopsis
List adapters on a specific CPC (Z system) or on all managed CPCs.
CPCs in classic mode are ignored (i.e. do not lead to a failure).
Adapters for which the user has no object access permission are ignored (i.e. do not lead to a failure).
Requirements
The HMC userid must have object-access permissions to these objects: Target adapters, CPCs of target adapters (only for z13 and older).
Parameters
- hmc_host
The hostname or IP address of the HMC.
required: Truetype: str- hmc_auth
The authentication credentials for the HMC.
required: Truetype: dict- userid
The userid (username) for authenticating with the HMC. This is mutually exclusive with providing
session_id
.required: Falsetype: str- password
The password for authenticating with the HMC. This is mutually exclusive with providing
session_id
.required: Falsetype: str- session_id
HMC session ID to be used. This is mutually exclusive with providing
userid
andpassword
and can be created as described in zhmc_session – Manage HMC sessions across tasks.required: Falsetype: str- ca_certs
Path name of certificate file or certificate directory to be used for verifying the HMC certificate. If null (default), the path name in the ‘REQUESTS_CA_BUNDLE’ environment variable or the path name in the ‘CURL_CA_BUNDLE’ environment variable is used, or if neither of these variables is set, the certificates in the Mozilla CA Certificate List provided by the ‘certifi’ Python package are used for verifying the HMC certificate.
required: Falsetype: str- verify
If True (default), verify the HMC certificate as specified in the
ca_certs
parameter. If False, ignore what is specified in theca_certs
parameter and do not verify the HMC certificate.required: Falsetype: booldefault: True
- cpc_name
Name of the CPC for which the adapters are to be listed.
Default: All managed CPCs.
required: Falsetype: str- name
Regular expression pattern for the adapter name to filter the result list to matching adapters.
required: Falsetype: str- adapter_id
Regular expression pattern for the adapter ID (PCHID) (‘adapter-id’ property) to filter the result list to matching adapters.
required: Falsetype: str- adapter_family
Adapter family (‘adapter-family’ property) to filter the result list to adapters with that family.
required: Falsetype: str- type
Adapter type (‘type’ property) to filter the result list to adapters with that type.
required: Falsetype: str- status
Adapter status (‘status’ property) to filter the result list to adapters with that status.
required: Falsetype: str- log_file
File path of a log file to which the logic flow of this module as well as interactions with the HMC are logged. If null, logging will be propagated to the Python root logger.
required: Falsetype: str
Examples
---
# Note: The following examples assume that some variables named 'my_*' are set.
- name: List all permitted adapters on all managed CPCs
zhmc_adapter_list:
hmc_host: "{{ my_hmc_host }}"
hmc_auth: "{{ my_hmc_auth }}"
register: adapter_list
- name: List all permitted adapters on a CPC
zhmc_adapter_list:
hmc_host: "{{ my_hmc_host }}"
hmc_auth: "{{ my_hmc_auth }}"
cpc_name: CPCA
register: adapter_list
- name: List the permitted FICON adapters on a CPC
zhmc_adapter_list:
hmc_host: "{{ my_hmc_host }}"
hmc_auth: "{{ my_hmc_auth }}"
cpc_name: CPCA
adapter_family: "ficon"
register: adapter_list
See Also
Return Values
- changed
Indicates if any change has been made by the module. This will always be false.
returned: alwaystype: bool- msg
An error message that describes the failure.
returned: failuretype: str- adapters
The list of adapters, with a subset of their properties. For details on the properties, see the data model of the ‘Adapter’ resource (see HMC API)
returned: successtype: listelements: dictsample:[ { "adapter_family": "osa", "adapter_id": "10c", "cpc_name": "CPC1", "name": "adapter1", "status": "active", "type": "osd" } ]
- name
Adapter name
type: str- cpc_name
Name of the parent CPC of the adapter
type: str- adapter_id
Adapter ID (PCHID) of the adapter (‘adapter-id’ property)
type: str- adapter_family
Family of the adapter (‘adapter-family’ property)
type: str- type
Type of the adapter (‘type’ property)
type: str- status
The current status of the adapter (‘status’ property)
type: str