forked from hyperledger/bevel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-external-chaincode.yaml
44 lines (42 loc) · 2.49 KB
/
deploy-external-chaincode.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
# This playbook executes required tasks to commit chaincode
# on existing Kubernetes clusters. The Kubernetes clusters should already be created and the infomation
# to connect to the clusters be updated in the network.yaml file that is used as an input to this playbook
###########################################################################################
# To Run this playbook from this directory, use the following command (network.yaml also in this directory)
# ansible-playbook platforms/hyperledger-fabric/configuration/commit-chaincode.yaml -e "@./network.yaml"
############################################################################################
# Please ensure that the ../../shared/configuration playbooks have been run using the same network.yaml
---
# This will apply to ansible_provisioners. /etc/ansible/hosts should be configured with this group
- hosts: ansible_provisioners
gather_facts: no
tasks:
############################################################################################
# This task deploys the external chaincode server for desired org
- name: Deploy external chaincode server
include_role:
name: "create/external_chaincode"
vars:
docker_url: "{{ network.docker.url }}"
name: "{{ item.name | lower}}"
namespace: "{{ item.name | lower}}-net"
component_type: "{{ item.type | lower}}"
component_peers: "{{ item.services.peers }}"
org_name: "{{ item.name | lower }}"
org_ns: "{{ item.name | lower }}-net"
kubernetes: "{{ item.k8s }}"
vault: "{{ item.vault }}"
peers: "{{ item.services.peers }}"
git_url: "{{ item.gitops.git_url }}"
git_branch: "{{ item.gitops.branch }}"
charts_dir: "{{ item.gitops.chart_source }}"
values_dir: "{{playbook_dir}}/../../../{{item.gitops.release_dir}}/{{ item.name | lower }}"
loop: "{{ network['organizations'] }}"
when: item.type == 'peer' and item.org_status == 'new'
vars: #These variables can be overriden from the command line
privilege_escalate: false #Default to NOT escalate to root privledges
install_os: "linux" #Default to linux OS
install_arch: "amd64" #Default to amd64 architecture
bin_install_dir: "~/bin" #Default to /bin install directory for binaries
add_new_org: 'false' # Default to false as this is for main network creation
external_chaincode: false # Default to false