ordering_service_node – Manage a Hyperledger Fabric ordering service node
Synopsis
Create, update, or delete a Hyperledger Fabric ordering service node.
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- An ordering service node matching the specified name will be stopped and removed.
present- Asserts that an ordering service node matching the specified name and configuration exists. If no ordering service node matches the specified name, an ordering service node will be created. If an ordering service node matches the specified name but the configuration does not match, then the ordering service node 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 (required)
The name for the ordering service node.
Type: str- ordering_service
The name of the ordering service that this ordering service node belongs to.
You can pass a string, which is the display name of a ordering service 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(ordering_service_info)” at index 82: Module name “ordering_service_info” is not a FQCN or ERROR while parsing: While parsing “M(ordering_service)” at index 110: Module name “ordering_service” is not a FQCN modules.
Only required when config is not specified.
Type: str- msp_id
The MSP ID for this ordering service node.
Only required when state is
present.Type: str- orderer_type
raft- The ordering service node will use the Raft consensus algorithm.Type: strDefault value:raft- system_channel_id
The name of the system channel for this ordering service node.
Type: strDefault value:testchainid- config_block
The path to where the config block for the system channel is stored.
You must first update the config for the system channel by adding this ordering service node into the consenter set of the system channel.
The config block will only be submitted to the ordering service node if the ordering service node has been pre-created and is not ready for use.
Type: str- certificate_authority
The certificate authority to use to enroll the identity for this ordering service node.
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.
Only required when config is not specified.
Type: raw- enrollment_id
The enrollment ID, or user name, of an identity registered on the certificate authority for this ordering service node.
Only required when config is not specified.
Type: str- enrollment_secret
The enrollment secret, or password, of an identity registered on the certificate authority for this ordering service node.
Only required when config is not specified.
Type: str- admins
The list of administrator certificates for this ordering service node.
Administrator certificates must be supplied as base64 encoded PEM files.
Only required when config is not specified.
Type: listElements: str- config
The initial configuration for the ordering service node. This is only required if you need more advanced configuration than is provided by this module using certificate_authority and related options.
Type: dict- config_override
The configuration overrides for the ordering service node.
See the Hyperledger Fabric documentation for available options: https://github.com/hyperledger/fabric/blob/release-1.4/sampleconfig/core.yaml
Type: dict- crypto
Component crypto configuration for connecting to a certificate authority
Type: dict
- enrollment
Enrollment information for connecting to a certificate authority
Type: dict
- component
Admin certificates for connecting to a certificate authority
Type: dict
- admins
An array that contains base 64 encoded PEM identity certificates for administrators. Also known as signing certificates of an organization administrator.
Type: dict- ca
Configuration for connecting to the certificate authority
Type: dict
- host
The CA’s hostname. Do not include protocol or port. Must be a hostname from a known CA.
Type: str- port
The CA’s port.
Type: str- name
The CA’s “CAName” attribute. This name is used to distinguish this CA from the TLS CA.
Type: str- tls_cert
The TLS certificate as base 64 encoded PEM. Certificate is used to secure/validate a TLS connection with this component.
Type: str- enroll_id
The username of the enroll id.
Type: str- enroll_secret
The password of the enroll id.
Type: str- tlsca
Configuration for connecting to the TLS certificate authority
Type: dict
- host
The CA’s hostname. Do not include protocol or port. Must be a hostname from a known CA.
Type: str- port
The CA’s port.
Type: str- name
The CA’s “CAName” attribute. This name is used to distinguish this CA from the TLS CA.
Type: str- tls_cert
The TLS certificate as base 64 encoded PEM. Certificate is used to secure/validate a TLS connection with this component.
Type: str- enroll_id
The username of the enroll id.
Type: str- enroll_secret
The password of the enroll id.
Type: str- resources
The Kubernetes resource configuration for the ordering service node.
Type: dict
- orderer
The Kubernetes resource configuration for the orderer container.
Type: dict
- requests
The Kubernetes resource requests for the orderer container.
Type: str
- cpu
The Kubernetes CPU resource request for the orderer container.
Type: strDefault value:250m- memory
The Kubernetes memory resource request for the orderer container.
Type: strDefault value:500M- proxy
The Kubernetes resource configuration for the proxy container.
Type: dict
- requests
The Kubernetes resource requests for the proxy container.
Type: str
- cpu
The Kubernetes CPU resource request for the proxy container.
Type: strDefault value:100m- memory
The Kubernetes memory resource request for the proxy container.
Type: strDefault value:200M- storage
The Kubernetes storage configuration for the ordering service node.
Type: dict
- orderer
The Kubernetes storage configuration for the orderer container.
Type: dict
- size
The size of the Kubernetes persistent volume claim for the orderer container.
Type: strDefault value:100Gi- class
The Kubernetes storage class for the the Kubernetes persistent volume claim for the orderer container.
By default, the Kubernetes storage class for the Fabric operations console is used.
Type: str- hsm
The PKCS #11 compliant HSM configuration to use for the ordering service node.
Type: dict
- pkcs11endpoint
The HSM proxy endpoint that the ordering service node should use.
Type: str- label
The HSM label that the ordering service node should use.
Type: str- pin
The HSM pin that the ordering service node should use.
Type: str- zone
The Kubernetes zone for this ordering service node.
If you do not specify a Kubernetes zone, and multiple Kubernetes zones are available, then a random Kubernetes zone will be selected for you.
See the Kubernetes documentation for more information: https://kubernetes.io/docs/setup/best-practices/multiple-zones/
Type: str- version
The version of Hyperledger Fabric to use for this ordering service node.
If you do not specify a version, the default Hyperledger Fabric version will be used for a new ordering service node.
If you do not specify a version, an existing ordering service node will not be upgraded.
If you specify a new version, an existing ordering service node will be automatically upgraded.
The version can also be specified as a version range specification, for example
>=2.2,<3.0, which will match Hyperledger Fabric v2.2 and greater, but not Hyperledger Fabric v3.0 and greater.See the
semantic_versionPython module documentation for more information: https://python-semanticversion.readthedocs.io/en/latest/reference.html#semantic_version.SimpleSpecType: str- wait_timeout
The timeout, in seconds, to wait until the ordering service node is available.
Type: intDefault value:60
Examples
- name: Create ordering service node
hyperledger.fabric_ansible_collection.ordering_service_node:
state: present
api_endpoint: https://console.example.org:32000
api_authtype: basic
api_key: xxxxxxxx
api_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
name: Ordering Service Node 2
msp_id: OrdererOrgMSP
certificate_authority: Orderer Org CA
enrollment_id: orderingorgorderer
enrollment_secret: orderingorgordererpw
admin_certificates:
- LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0t...
- name: Create ordering service node with custom resources and storage
hyperledger.fabric_ansible_collection.ordering_service_node:
state: present
api_endpoint: https://console.example.org:32000
api_authtype: basic
api_key: xxxxxxxx
api_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
name: Ordering Service Node 2
msp_id: OrdererOrgMSP
certificate_authority: Orderer Org CA
enrollment_id: orderingorgorderer
enrollment_secret: orderingorgordererpw
admin_certificates:
- LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0t...
resources:
orderer:
requests:
cpu: 500m
memory: 1000M
storage:
orderer:
size: 200Gi
class: ibmc-file-gold
- name: Create ordering service node that uses an HSM
hyperledger.fabric_ansible_collection.ordering_service_node:
state: present
api_endpoint: https://console.example.org:32000
api_authtype: basic
api_key: xxxxxxxx
api_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
name: Ordering Service Node 2
msp_id: OrdererOrgMSP
nodes: 5
certificate_authority: Orderer Org CA
enrollment_id: orderingorgorderer
enrollment_secret: orderingorgordererpw
admin_certificates:
- LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0t...
hsm:
pkcs11endpoint: tcp://pkcs11-proxy.example.org:2345
label: Org1 CA label
pin: 12345678
- name: Destroy ordering service node
hyperledger.fabric_ansible_collection.ordering_service_node:
state: absent
api_endpoint: https://console.example.org:32000
api_authtype: basic
api_key: xxxxxxxx
api_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
name: Ordering Service Node 2
Return Values
- ordering_service_node
The ordering service node.
Returned: when state ispresentType: dict
- name
The name of the ordering service node.
Type: strSample:Ordering Service_1- api_url
The URL for the API of the ordering service node.
Type: strSample:grpcs://orderingservice1-api.example.org:32000- operations_url
The URL for the operations service of the ordering service node.
Type: strSample:https://orderingservice1-operations.example.org:32000- grpcwp_url
The URL for the gRPC web proxy of the ordering service node.
Type: strSample:https://orderingservice1-grpcwebproxy.example.org:32000- msp_id
The MSP ID of the ordering service node.
Type: strSample:OrdererOrgMSP- pem
The TLS certificate chain for the ordering service node.
The TLS certificate chain is returned as a base64 encoded PEM.
Type: strSample:LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0t...- tls_ca_root_cert
The TLS certificate chain for the ordering service node.
The TLS certificate chain is returned as a base64 encoded PEM.
Type: strSample:LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0t...- tls_cert
The TLS certificate for the ordering service node.
The TLS certificate is returned as a base64 encoded PEM.
Type: strSample:LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0t...- location
The location of the ordering service node.
Type: strSample:ibmcloud- system_channel_id
The name of the system channel for the ordering service node.
Type: strSample:testchainid- client_tls_cert
The client TLS certificate for the ordering service node.
The client TLS certificate is returned as a base64 encoded PEM.
Type: strSample:LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0t...- server_tls_cert
The server TLS certificate for the ordering service node.
The server TLS certificate is returned as a base64 encoded PEM.
Type: strSample:LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0t...- cluster_id
The unique ID of the ordering service cluster.
Type: strSample:abcdefgh- cluster_name
The name of the ordering service cluster.
Type: strSample:Ordering Service- consenter_proposal_fin
True if the ordering service node has been added to the consenter set of the system channel, false otherwise. Ordering service nodes that have not been added to the consenter set of the system channel are not ready for use.
Type: booleanSample:True