-
Notifications
You must be signed in to change notification settings - Fork 0
/
06-join-peers-to-channel.yaml
44 lines (43 loc) · 1.74 KB
/
06-join-peers-to-channel.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#
# SPDX-License-Identifier: Apache-2.0
#
---
- name: Join the channel
hosts: localhost
vars_files:
- vars/common.yaml
- vars/organizations.yaml
- vars/channels.yaml
vars:
# os_org_name: os
# peer_org_name: org1
# channel_name: samplechannel1
os_org: "{{ vars['ordering_organization'][os_org_name] }}"
peer_org: "{{ vars['peer_organizations'][peer_org_name] }}"
peer_org_msp_admin: "{{ wallet_path }}/{{ peer_org.msp.admin }}.json"
tasks:
- name: Fetch the genesis block for the channel
ibm.blockchain_platform.channel_block:
api_endpoint: "{{ peer_org.console.api_endpoint }}"
api_authtype: "{{ peer_org.console.api_authtype }}"
api_key: "{{ peer_org.console.api_key | default(omit) }}"
api_secret: "{{ peer_org.console.api_secret | default(omit)}}"
operation: fetch
ordering_service: "{{ os_org.orderer.name }}"
identity: "{{ peer_org_msp_admin }}"
msp_id: "{{ peer_org.msp.id }}"
name: "{{ channel_name }}"
target: "0"
path: "{{ channel_config_path }}/{{ channel_name }}_genesis_block.bin"
- name: Join the peer(s) to the channel
ibm.blockchain_platform.peer_channel:
api_endpoint: "{{ peer_org.console.api_endpoint }}"
api_authtype: "{{ peer_org.console.api_authtype }}"
api_key: "{{ peer_org.console.api_key | default(omit) }}"
api_secret: "{{ peer_org.console.api_secret | default(omit)}}"
operation: join
peer: "{{ item }}"
identity: "{{ peer_org_msp_admin }}"
msp_id: "{{ peer_org.msp.id }}"
path: "{{ channel_config_path }}/{{ channel_name }}_genesis_block.bin"
loop: "{{ vars['channels'][channel_name]['members'][peer_org_name]['peers'] }}"