zhmc_crypto_attachment - Manages the attachment of crypto adapters and domains to partitions.¶
Synopsis¶
- Gathers facts about the attachment of crypto adapters and domains to a partition.
- Attaches a range of crypto domains and a number of crypto adapters to a partition.
- Detaches all crypto domains and all crypto adapters from a partition.
Requirements (on host that executes module)¶
- Network access to HMC
- zhmcclient >=0.20.0
- ansible >=2.2.0.0
Options¶
parameter | required | default | choices | comments | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
access_mode |
no | usage |
|
Only for
state=attach : The access mode in which the crypto domains specified in domain_range need to be attached. |
|||||||||||||||
adapter_count |
no | -1 |
Only for
state=attach : The number of crypto adapters the partition needs to have attached. The special value -1 means all adapters of the desired crypto type in the CPC. |
||||||||||||||||
cpc_name |
yes |
The name of the CPC that has the partition and the crypto adapters.
|
|||||||||||||||||
crypto_type |
no | ep11 |
|
Only for
state=attach : The crypto type of the crypto adapters that will be considered for attaching. |
|||||||||||||||
domain_range |
no | (0, -1) |
Only for
state=attach : The domain range the partition needs to have attached, as a tuple of integers (min, max) that specify the inclusive range of domain index numbers. Other domains attached to the partition remain unchanged. The special value -1 for the max item means the maximum supported domain index number. |
||||||||||||||||
faked_session |
no | Real HMC will be used. |
A
zhmcclient_mock.FakedSession object that has a mocked HMC set up. If provided, it will be used instead of connecting to a real HMC. This is used for testing purposes only. |
||||||||||||||||
hmc_auth |
yes |
The authentication credentials for the HMC.
| |||||||||||||||||
|
|||||||||||||||||||
hmc_host |
yes |
The hostname or IP address of the HMC.
|
|||||||||||||||||
log_file |
no |
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.
|
|||||||||||||||||
partition_name |
yes |
The name of the partition to which the crypto domains and crypto adapters are attached.
|
|||||||||||||||||
state |
yes |
|
The desired state for the attachment:
*
attached : Ensures that the specified number of crypto adapters of the specified crypto type, and the specified range of domain index numbers in the specified access mode are attached to the partition.*
detached : Ensures that no crypto adapter and no crypto domains are attached to the partition.*
facts : Does not change anything on the attachment and returns the crypto configuration of the partition. |
Examples¶
--- # Note: The following examples assume that some variables named 'my_*' are set. - name: Gather facts about the crypto configuration of a partition zhmc_crypto_attachment: hmc_host: "{{ my_hmc_host }}" hmc_auth: "{{ my_hmc_auth }}" cpc_name: "{{ my_cpc_name }}" partition_name: "{{ my_partition_name }}" state: facts register: crypto1 - name: Ensure domain 0 on all ep11 adapters is attached in usage mode zhmc_crypto_attachment: hmc_host: "{{ my_hmc_host }}" hmc_auth: "{{ my_hmc_auth }}" cpc_name: "{{ my_cpc_name }}" partition_name: "{{ my_first_partition_name }}" state: attached crypto_type: ep11 adapter_count: -1 domain_range: 0,0 access_mode: usage - name: Ensure domains 1-max on all ep11 adapters are attached in control mode zhmc_crypto_attachment: hmc_host: "{{ my_hmc_host }}" hmc_auth: "{{ my_hmc_auth }}" cpc_name: "{{ my_cpc_name }}" partition_name: "{{ my_first_partition_name }}" state: attached crypto_type: ep11 adapter_count: -1 domain_range: 1,-1 access_mode: control - name: Ensure domains 0-max on 1 ep11 adapter are attached to in usage mode zhmc_crypto_attachment: hmc_host: "{{ my_hmc_host }}" hmc_auth: "{{ my_hmc_auth }}" cpc_name: "{{ my_cpc_name }}" partition_name: "{{ my_second_partition_name }}" state: attached crypto_type: ep11 adapter_count: 1 domain_range: 0,-1 access_mode: usage
Return Values¶
Common return values are documented here Return Values, the following are the fields unique to this module:
name | description | returned | type | sample |
---|---|---|---|---|
crypto_configuration |
For
state=detached|attached|facts , a dictionary with the crypto configuration of the partition after the changes applied by the module. Key is the partition name, and value is a dictionary with keys: - 'adapters': attached adapters, as a dict of key: adapter name, value: dict of adapter properties; - 'domain_config': attached domains, as a dict of key: domain index, value: access mode ('control' or 'usage'); - 'usage_domains': domains attached in usage mode, as a list of domain index numbers; - 'control_domains': domains attached in control mode, as a list of domain index numbers. |
success | dict | {
"part-1": {
"adapters": {
"adapter 1": {
"type": "crypto",
...
}
},
"domain_config": {
"0": "usage",
"1": "control",
"2": "control"
}
"usage_domains": [0],
"control_domains": [1, 2]
}
}
|
changes |
For
state=detached|attached|facts , a dictionary with the changes performed. |
success | dict | {
"added-adapters": ["adapter 1", "adapter 2"],
"added-domains": ["0", "1"]
}
|
Notes¶
Note
- The CPC of the target partition must be in the Dynamic Partition Manager (DPM) operational mode.
Status¶
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Support¶
This module is community maintained without core committer oversight.
For more information on what this means please read Module Support.
For help in developing on modules, should you be so inclined, please read the contribution guidelines in the module’s source repository, Testing Ansible and Developing Modules.
Shipment¶
This module is a third-party module and is not shipped with Ansible. See the module’s source repository for details.