connection_profile – Manage a connection profile for a Hyperledger Fabric network
Synopsis
Create, update, or delete a connection profile for a Hyperledger Fabric network.
This module works with the IBM Support for Hyperledger Fabric software or the Hyperledger Fabric Open Source Stack running in a Red Hat OpenShift or Kubernetes cluster.
Parameters
- api_endpoint (required)
The URL for the Fabric operations console.
Type: str- api_authtype (required)
basic- Authenticate to the Fabric operations console using basic authentication. You must provide both a valid API key using api_key and API secret using api_secret.Type: str- api_key (required)
The API key for the Fabric operations console.
Type: str- api_secret
The API secret for the Fabric operations console.
Only required when api_authtype is
basic.Type: str- api_timeout
The timeout, in seconds, to use when interacting with the Fabric operations console.
Type: intDefault value:60- state
absent- If a connection profile exists at the specified path, it will be removed.
present- Asserts that a connection profile exists at the specified path. If no connection profile exists, a connection profile will be created. If a connection profile exists, but does not match the specfied configuration, then the connection profile will be updated, if it can be. If it cannot be updated, it will be removed and re-created with the specified configuration.Type: strDefault value:present- name
The name of this connection profile.
Only required when state is
present.Type: str- path (required)
The path to the JSON file where the connection profile will be stored.
- organization
The organization for this connection profile.
Only required when state is
present.- certificate_authority
The certificate authority to reference in this connection profile.
You can pass a string, which is the display name of a certificate authority registered with the Fabric operations console.
You can also pass a dictionary, which must match the result format of one of the ERROR while parsing: While parsing “M(certificate_authority_info)” at index 82: Module name “certificate_authority_info” is not a FQCN or ERROR while parsing: While parsing “M(certificate_authority)” at index 115: Module name “certificate_authority” is not a FQCN modules.
Type: raw- peers
The peers to reference in this connection profile.
You can pass strings, which are the display names of peers registered with the Fabric operations console.
You can also pass dictionaries, which must match the result format of one of the ERROR while parsing: While parsing “M(peer_info)” at index 82: Module name “peer_info” is not a FQCN or ERROR while parsing: While parsing “M(peer)” at index 98: Module name “peer” is not a FQCN modules.
Only required when state is
present.Type: listElements: raw
Examples
- name: Create a connection profile
hyperledger.fabric_ansible_collection.connection_profile:
state: present
api_endpoint: https://console.example.org:32000
api_authtype: basic
api_key: xxxxxxxx
api_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
name: Org1 Gateway
path: Org1 Gateway.json
organization: Org1
certificate_authority: Org1 CA
peers:
- Org1 Peer
- name: Delete a connection profile
hyperledger.fabric_ansible_collection.connection_profile:
state: absent
api_endpoint: https://console.example.org:32000
api_authtype: basic
api_key: xxxxxxxx
api_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
path: Org1 Gateway.json