-
Notifications
You must be signed in to change notification settings - Fork 11
/
02-enable-fabricv2-channel.yml
80 lines (72 loc) · 2.63 KB
/
02-enable-fabricv2-channel.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#
# SPDX-License-Identifier: Apache-2.0
#
---
- name: Fetch the channel configuration
hyperledger.fabric_ansible_collection.channel_config:
api_endpoint: "{{ api_endpoint }}"
api_authtype: "{{ api_authtype }}"
api_key: "{{ api_key }}"
api_secret: "{{ api_secret | default(omit) }}"
ordering_service: "{{ ordering_service_name }}"
identity: "{{ organization_admin_identity }}"
msp_id: "{{ organization_msp }}"
operation: fetch
name: "{{ channel_name }}"
path: original_config.bin
register: result
- name: Fail on channel not existing
fail:
msg: "{{ result.msg }}"
when: result.msg is defined and 'NOT_FOUND' in result.msg
- name: Create a copy of the channel configuration
copy:
src: original_config.bin
dest: updated_config.bin
- name: Enable Fabric v2.x capabilities
hyperledger.fabric_ansible_collection.channel_capabilities:
path: updated_config.bin
channel: V2_0
application: V2_0
- name: Add Endorsement Policy
hyperledger.fabric_ansible_collection.channel_policy:
name: Endorsement
policy: endorsement-policy.json
path: updated_config.bin
- name: Compute the channel configuration update
hyperledger.fabric_ansible_collection.channel_config:
operation: compute_update
name: "{{ channel_name }}"
original: original_config.bin
updated: updated_config.bin
path: config_update.bin
register: compute_update
- name: Sign the channel configuration update with Ordering Svc Admin
hyperledger.fabric_ansible_collection.channel_config:
operation: sign_update
identity: "{{ ordering_service_admin_identity }}"
msp_id: "{{ ordering_service_msp }}"
name: "{{ channel_name }}"
path: config_update.bin
when: compute_update.path
- name: Sign the channel configuration update with Organization Admin
hyperledger.fabric_ansible_collection.channel_config:
operation: sign_update
identity: "{{ organization_admin_identity }}"
msp_id: "{{ organization_msp }}"
name: "{{ channel_name }}"
path: config_update.bin
when: compute_update.path
- name: Apply the channel configuration update
hyperledger.fabric_ansible_collection.channel_config:
api_endpoint: "{{ api_endpoint }}"
api_authtype: "{{ api_authtype }}"
api_key: "{{ api_key }}"
api_secret: "{{ api_secret | default(omit) }}"
operation: apply_update
ordering_service: "{{ ordering_service_name }}"
identity: "{{ organization_admin_identity }}"
msp_id: "{{ organization_msp }}"
name: "{{ channel_name }}"
path: config_update.bin
when: compute_update.path