hyperledger_labs.fabric_ansible_collection.connection_profile (2.0.0) — module

Manage a connection profile for a Hyperledger Fabric network

Authors: Simon Stone (@sstone1)

preview | supported by community

Install collection

Install with ansible-galaxy collection install hyperledger_labs.fabric_ansible_collection:==2.0.0


Add to requirements.yml

  collections:
    - name: hyperledger_labs.fabric_ansible_collection
      version: 2.0.0

Description

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.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
name:
    description:
    - The name of this connection profile.
    - Only required when I(state) is C(present).
    type: str

path:
    description:
    - The path to the JSON file where the connection profile will be stored.
    required: true

peers:
    description:
    - 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
      M(peer_info) or M(peer) modules.
    - Only required when I(state) is C(present).
    elements: raw
    type: list

state:
    choices:
    - absent
    - present
    default: present
    description:
    - C(absent) - If a connection profile exists at the specified path, it will be removed.
    - C(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: str

api_key:
    description:
    - The API key for the Fabric operations console.
    required: true
    type: str

api_secret:
    description:
    - The API secret for the Fabric operations console.
    - Only required when I(api_authtype) is C(basic).
    type: str

api_timeout:
    default: 60
    description:
    - The timeout, in seconds, to use when interacting with the Fabric operations console.
    type: int

api_authtype:
    description:
    - C(basic) - Authenticate to the Fabric operations console using basic authentication.
      You must provide both a valid API key using I(api_key) and API secret using I(api_secret).
    required: true
    type: str

api_endpoint:
    description:
    - The URL for the Fabric operations console.
    required: true
    type: str

organization:
    description:
    - The organization for this connection profile.
    - Only required when I(state) is C(present).

certificate_authority:
    description:
    - 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
      M(certificate_authority_info) or M(certificate_authority) modules.
    type: raw