Tested on IBP Ansible Collection version: 1.0.0
Before running the scripts, you need to make sure to have the following installed:
-
Ansible and IBP collection. To force installation of the latest version of the collection, use
ansible-galaxy collection install --force ibm.blockchain_platform -
YAML parser
yq(>= 3.4.1) - Note: Onlyyqversion 3 is supported (version 4 is NOT supported) -
Clean up
ansible-playbook 100-delete-folders.yaml
Create files from install-crd.yaml.template. 1 file is needed per cluster. Fill accordingly based on the instruction found in the template. The following example assumes that there is only 1 cluster. Create more files if needed
cp install-crd.yaml.template install-crd.yamlCreate files from install-ibp.yaml.template. 1 file is needed per IBP instance. Fill accordingly based on the instruction found in the template. The following example assumes that for each organization, there is a different IBP console
cp install-ibp.yaml.template install-ibp-org1.yaml
cp install-ibp.yaml.template install-ibp-org2.yaml
cp install-ibp.yaml.template install-ibp-org3.yamlLog in to your Openshift/Kubernetes Cluster and ensure that you can interact with the cluster. Install IBP CRDs and Console by issuing the command below. If the CRDs and Console are located in different clusters, ensure that you logged in to the respective clusters before issuing the commands.
ansible-playbook install-crd.yaml
ansible-playbook install-ibp-org1.yaml
ansible-playbook install-ibp-org2.yaml
ansible-playbook install-ibp-org3.yamlOpen your IBP console(s) in your browser and change your initial default password to log in.
Copy the organizations template file. Modify the YAML file as needed (be careful about some data consistency requirements specified in the code comments)
cp vars/organizations.template.yaml vars/organizations.yamlCopy the channels template file. Modify the YAML file as needed (be careful about some data consistency requirements specified in the code comments)
cp vars/channels.template.yaml vars/channels.yamlCreate folders to store wallet, connection profiles and configuration
ansible-playbook 00-create-folders.yamlansible-playbook 01-create-ordering-org.yaml --extra-vars "org_name=os" -v
ansible-playbook 02-create-peer-orgs.yaml --extra-vars "org_name=org1" -v
ansible-playbook 02-create-peer-orgs.yaml --extra-vars "org_name=org2" -v
ansible-playbook 02-create-peer-orgs.yaml --extra-vars "org_name=org3" -vAs the organizations are hosted in different IBP instances, import the MSP definitions and orderers to all the consoles. If the organizations are hosted in the same IBP instance, skip this section
ansible-playbook 03-import-components.yaml -vAdd organizations to consortium
ansible-playbook 04-add-orgs-to-consortium.yaml --extra-vars "os_org_name=os" -vCreate common-channel
./scripts/generate_channel_policies.sh common-channel
ansible-playbook 05-create-channel.yaml --extra-vars "channel_name=common-channel os_org_name=os creator_org_name=org1" -vCreate org1-org2-channel
./scripts/generate_channel_policies.sh org1-org2-channel
ansible-playbook 05-create-channel.yaml --extra-vars "channel_name=org1-org2-channel os_org_name=os creator_org_name=org1" -vJoin peers to common-channel
ansible-playbook 06-join-peers-to-channel.yaml --extra-vars "channel_name=common-channel os_org_name=os peer_org_name=org1" -v
ansible-playbook 06-join-peers-to-channel.yaml --extra-vars "channel_name=common-channel os_org_name=os peer_org_name=org2" -v
ansible-playbook 06-join-peers-to-channel.yaml --extra-vars "channel_name=common-channel os_org_name=os peer_org_name=org3" -vAdd anchor peers for common-channel
ansible-playbook 07-add-anchor-peer-to-channel.yaml --extra-vars "channel_name=common-channel os_org_name=os peer_org_name=org1" -v
ansible-playbook 07-add-anchor-peer-to-channel.yaml --extra-vars "channel_name=common-channel os_org_name=os peer_org_name=org2" -v
ansible-playbook 07-add-anchor-peer-to-channel.yaml --extra-vars "channel_name=common-channel os_org_name=os peer_org_name=org3" -vJoin peers to org1-org2-channel
ansible-playbook 06-join-peers-to-channel.yaml --extra-vars "channel_name=org1-org2-channel os_org_name=os peer_org_name=org1" -v
ansible-playbook 06-join-peers-to-channel.yaml --extra-vars "channel_name=org1-org2-channel os_org_name=os peer_org_name=org2" -vAdd anchor peers for org1-org2-channel
ansible-playbook 07-add-anchor-peer-to-channel.yaml --extra-vars "channel_name=org1-org2-channel os_org_name=os peer_org_name=org1" -v
ansible-playbook 07-add-anchor-peer-to-channel.yaml --extra-vars "channel_name=org1-org2-channel os_org_name=os peer_org_name=org2" -vCreate connection profile
ansible-playbook 10-create-connection-profile.yaml --extra-vars "peer_org_name=org1"
ansible-playbook 10-create-connection-profile.yaml --extra-vars "peer_org_name=org2"
ansible-playbook 10-create-connection-profile.yaml --extra-vars "peer_org_name=org3"Create wallet zip file to be imported to console
ansible-playbook 50-zip-identities-to-wallet.yamlImport bulk-import.zip to IBP Console
./scripts/network.sh up
# if you only want to set up Ordering Org and Peer Org
./scripts/network.sh -b before-channel up
# if you only want to set up Ordering Org, Peer Org and channels, without joining any peers
./scripts/network.sh -b before-join upRefer to REMOVE.md