diff --git a/platforms/hyperledger-fabric/charts/fabric-orderernode/templates/configmap.yaml b/platforms/hyperledger-fabric/charts/fabric-orderernode/templates/configmap.yaml index aba0209a936..03e3239be3b 100644 --- a/platforms/hyperledger-fabric/charts/fabric-orderernode/templates/configmap.yaml +++ b/platforms/hyperledger-fabric/charts/fabric-orderernode/templates/configmap.yaml @@ -50,6 +50,7 @@ data: {{ end }} --- +{{- if ne $.Values.metadata.network.version "2.5.4" }} apiVersion: v1 kind: ConfigMap metadata: @@ -62,4 +63,5 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} {{- include "labels.custom" . | nindent 2 }} data: - genesis.block.base64: {{ .Values.genesis | quote }} \ No newline at end of file + genesis.block.base64: {{ .Values.genesis | quote }} +{{ end }} diff --git a/platforms/hyperledger-fabric/charts/fabric-orderernode/templates/deployment.yaml b/platforms/hyperledger-fabric/charts/fabric-orderernode/templates/deployment.yaml index ff4819a9c74..0946683fde2 100644 --- a/platforms/hyperledger-fabric/charts/fabric-orderernode/templates/deployment.yaml +++ b/platforms/hyperledger-fabric/charts/fabric-orderernode/templates/deployment.yaml @@ -61,12 +61,14 @@ spec: - key: ca.crt.pem path: ca-certificates.crt # curl expects certs to be in /etc/ssl/certs/ca-certificates.crt {{ end }} + {{- if ne $.Values.metadata.network.version "2.5.4" }} - name: {{ $.Values.orderer.name }}-genesis-volume configMap: name: genesis-block-{{ $.Values.orderer.name }} items: - key: genesis.block.base64 path: genesis.block.base64 + {{ end }} - name: scripts-volume configMap: name: bevel-vault-script @@ -207,9 +209,11 @@ spec: volumeMounts: - name: datadir mountPath: /var/hyperledger/production/orderer + {{- if ne $.Values.metadata.network.version "2.5.4" }} - name: {{ $.Values.orderer.name }}-genesis-volume mountPath: /var/hyperledger/orderer/genesis readOnly: true + {{- end }} - name: certificates mountPath: /var/hyperledger/orderer/crypto readOnly: true diff --git a/platforms/hyperledger-fabric/charts/fabric-osnadmin-channel-create/templates/configmap.yaml b/platforms/hyperledger-fabric/charts/fabric-osnadmin-channel-create/templates/configmap.yaml index 4c0800e8dc2..c12c9a80854 100644 --- a/platforms/hyperledger-fabric/charts/fabric-osnadmin-channel-create/templates/configmap.yaml +++ b/platforms/hyperledger-fabric/charts/fabric-osnadmin-channel-create/templates/configmap.yaml @@ -23,8 +23,16 @@ data: CHANNEL_NAME: {{ $.Values.channel.name }} ADMIN_TLS_CERTS: /opt/gopath/src/github.com/hyperledger/fabric/crypto GENESIS_FILE: /opt/gopath/src/github.com/hyperledger/fabric/orderer/genesis +{{- if $.Values.add_orderer }} + CORE_PEER_LOCALMSPID: {{ $.Values.orderer.localmspid }} + CORE_PEER_TLS_ROOTCERT_FILE: /opt/gopath/src/github.com/hyperledger/fabric/crypto/admin/msp/tlscacerts/tlsca.crt + CORE_PEER_MSPCONFIGPATH: /opt/gopath/src/github.com/hyperledger/fabric/crypto/admin/msp + CORE_PEER_ADDRESS: {{ $.Values.orderer.address }} + ORDERER_CA: /opt/gopath/src/github.com/hyperledger/fabric/crypto/{{ $.Values.orderer.name }}/tls/ca.crt +{{ end }} --- +{{- if not $.Values.add_orderer }} apiVersion: v1 kind: ConfigMap metadata: @@ -38,3 +46,4 @@ metadata: {{- include "labels.custom" . | nindent 2 }} data: genesis.block.base64: {{ $.Values.genesis | quote }} +{{ end }} diff --git a/platforms/hyperledger-fabric/charts/fabric-osnadmin-channel-create/templates/osn_create_channel.yaml b/platforms/hyperledger-fabric/charts/fabric-osnadmin-channel-create/templates/osn_create_channel.yaml index 6e094255b5b..ff878e240a3 100644 --- a/platforms/hyperledger-fabric/charts/fabric-osnadmin-channel-create/templates/osn_create_channel.yaml +++ b/platforms/hyperledger-fabric/charts/fabric-osnadmin-channel-create/templates/osn_create_channel.yaml @@ -45,12 +45,14 @@ spec: - key: ca.crt.pem path: ca-certificates.crt {{ end }} + {{- if not $.Values.add_orderer }} - name: genesis configMap: name: genesis-block items: - key: genesis.block.base64 path: genesis.block.base64 + {{ end }} - name: certificates emptyDir: medium: Memory @@ -68,6 +70,8 @@ spec: value: {{ $.Values.vault.authpath }} - name: VAULT_APP_ROLE value: {{ $.Values.vault.role }} + - name: VAULT_ADMIN_SECRET_PREFIX + value: "{{ $.Values.vault.adminsecretprefix }}" - name: VAULT_ORDERER_SECRET_PREFIX value: "{{ $.Values.vault.orderersecretprefix }}" - name: ORDERERS_NAMES @@ -127,6 +131,29 @@ spec: echo "${CLIENTKEY}" >> ${OUTPUT_PATH}/server.key done + ############################################################################### + echo "Getting MSP certificates from Vault using key $vault_secret_key" + vaultBevelFunc "readJson" "${VAULT_ADMIN_SECRET_PREFIX}/msp" + + ADMINCERT=$(echo ${VAULT_SECRET} | jq -r '.["admincerts"]') + CACERTS=$(echo ${VAULT_SECRET} | jq -r '.["cacerts"]') + KEYSTORE=$(echo ${VAULT_SECRET} | jq -r '.["keystore"]') + SIGNCERTS=$(echo ${VAULT_SECRET} | jq -r '.["signcerts"]') + TLSCACERTS=$(echo ${VAULT_SECRET} | jq -r '.["tlscacerts"]') + + OUTPUT_PATH="${MOUNT_PATH}/admin/msp" + mkdir -p ${OUTPUT_PATH}/admincerts + mkdir -p ${OUTPUT_PATH}/cacerts + mkdir -p ${OUTPUT_PATH}/keystore + mkdir -p ${OUTPUT_PATH}/signcerts + mkdir -p ${OUTPUT_PATH}/tlscacerts + + echo "${ADMINCERT}" >> ${OUTPUT_PATH}/admincerts/admin.crt + echo "${CACERTS}" >> ${OUTPUT_PATH}/cacerts/ca.crt + echo "${KEYSTORE}" >> ${OUTPUT_PATH}/keystore/server.key + echo "${SIGNCERTS}" >> ${OUTPUT_PATH}/signcerts/server.crt + echo "${TLSCACERTS}" >> ${OUTPUT_PATH}/tlscacerts/tlsca.crt + volumeMounts: {{ if .Values.vault.tls }} - name: vaultca @@ -149,12 +176,19 @@ spec: value: "{{ $.Values.orderers.orderer_info }}" - name: NAMESPACE value: "{{ $.Values.metadata.namespace }}" + - name: ADD_ORDERER + value: "{{ $.Values.add_orderer }}" command: ["sh", "-c"] args: - |- #!/usr/bin/env sh echo "Fetch genesis file..." - cat ./genesis/genesis.block.base64 | base64 -d > orderer.genesis.block + if [ $ADD_ORDERER = false ] + then + cat ./genesis/genesis.block.base64 | base64 -d > orderer.genesis.block + else + peer channel fetch config ${CHANNEL_NAME}_config_block.pb -o ${CORE_PEER_ADDRESS} -c ${CHANNEL_NAME} --tls --cafile ${ORDERER_CA} + fi list=$(echo "$ORDERERS_INFO" | tr "*" "\n") for ORDERER_NAME in $list @@ -167,10 +201,16 @@ spec: CHANNEL_LIST_QUERY_RESPONSE=$(osnadmin channel list --channelID ${CHANNEL_NAME} -o "${ORDERER_URL}" --ca-file "${OSN_TLS_CA_ROOT_CERT}" --client-cert "${ADMIN_TLS_SIGN_CERT}" --client-key "${ADMIN_TLS_PRIVATE_KEY}") if echo "$CHANNEL_LIST_QUERY_RESPONSE" | grep '404'; then echo "Creating channel....." - osnadmin channel join --channelID "${CHANNEL_NAME}" --config-block orderer.genesis.block -o "${ORDERER_URL}" --ca-file "${OSN_TLS_CA_ROOT_CERT}" --client-cert "${ADMIN_TLS_SIGN_CERT}" --client-key "${ADMIN_TLS_PRIVATE_KEY}" + if [ $ADD_ORDERER = false ] + then + osnadmin channel join --channelID "${CHANNEL_NAME}" --config-block orderer.genesis.block -o "${ORDERER_URL}" --ca-file "${OSN_TLS_CA_ROOT_CERT}" --client-cert "${ADMIN_TLS_SIGN_CERT}" --client-key "${ADMIN_TLS_PRIVATE_KEY}" + else + osnadmin channel join --channelID "${CHANNEL_NAME}" --config-block ${CHANNEL_NAME}_config_block.pb -o "${ORDERER_URL}" --ca-file "${OSN_TLS_CA_ROOT_CERT}" --client-cert "${ADMIN_TLS_SIGN_CERT}" --client-key "${ADMIN_TLS_PRIVATE_KEY}" + fi osnadmin channel list -o "${ORDERER_URL}" --ca-file "${OSN_TLS_CA_ROOT_CERT}" --client-cert "${ADMIN_TLS_SIGN_CERT}" --client-key "${ADMIN_TLS_PRIVATE_KEY}" elif echo "$CHANNEL_LIST_QUERY_RESPONSE" | grep '200\|201'; then echo "Channel ${CHANNEL_NAME}, is already created for url: ${ORDERER_URL}" + osnadmin channel list --channelID ${CHANNEL_NAME} -o "${ORDERER_URL}" --ca-file "${OSN_TLS_CA_ROOT_CERT}" --client-cert "${ADMIN_TLS_SIGN_CERT}" --client-key "${ADMIN_TLS_PRIVATE_KEY}" else echo $CHANNEL_LIST_QUERY_RESPONSE fi @@ -183,6 +223,8 @@ spec: - name: certificates mountPath: /opt/gopath/src/github.com/hyperledger/fabric/crypto readOnly: true + {{- if not $.Values.add_orderer }} - name: genesis mountPath: /opt/gopath/src/github.com/hyperledger/fabric/orderer/genesis readOnly: true + {{ end }} diff --git a/platforms/hyperledger-fabric/configuration/add-orderer.yaml b/platforms/hyperledger-fabric/configuration/add-orderer.yaml index 4db4c254725..b2362e7f507 100644 --- a/platforms/hyperledger-fabric/configuration/add-orderer.yaml +++ b/platforms/hyperledger-fabric/configuration/add-orderer.yaml @@ -57,7 +57,7 @@ loop: "{{ network.organizations }}" loop_control: loop_var: org - when: org.type == 'orderer' + when: org.type == 'orderer' and '2.5.' not in network.version # This role creates value file new orderer - name: "create new orderer" @@ -92,7 +92,18 @@ loop: "{{ network.organizations }}" loop_control: loop_var: org - when: org.type == 'orderer' + when: org.type == 'orderer' and '2.5.' not in network.version + + # This role creates the value file for creating channel from creator organization + # to the vault. + - name: Create all create-channel jobs + include_role: + name: "create/osnchannels" + vars: + build_path: "./build" + docker_url: "{{ network.docker.url }}" + loop: "{{ network['channels'] }}" + when: add_new_org == 'false' and '2.5.' in network.version # Generate script to modify the fetched configuration block from application channel - name: "Modify the application channel with tls and address information of new orderer" diff --git a/platforms/hyperledger-fabric/configuration/add-peer.yaml b/platforms/hyperledger-fabric/configuration/add-peer.yaml index 0ffd6f8c759..3126997b595 100644 --- a/platforms/hyperledger-fabric/configuration/add-peer.yaml +++ b/platforms/hyperledger-fabric/configuration/add-peer.yaml @@ -34,25 +34,39 @@ kubernetes: "{{ item.k8s }}" release_dir: "{{playbook_dir}}/../../../{{item.gitops.release_dir}}/{{ item.name | lower }}" loop: "{{ network['organizations'] }}" + + # Setup script for Vault and OS Package Manager + - name: "Setup script for Vault and OS Package Manager" + include_role: + name: "{{ playbook_dir }}/../../shared/configuration/roles/setup/scripts" + vars: + namespace: "{{ org.name | lower }}-net" + network_type: "{{ network.type | lower }}" + kubernetes: "{{ org.k8s }}" + loop: "{{ network['organizations'] }}" + loop_control: + loop_var: org + when: org.org_status == 'new' # Setup Vault-Kubernetes accesses and Regcred for docker registry for new organization - include_role: name: "{{ playbook_dir }}/../../shared/configuration/roles/setup/vault_kubernetes" - vars: - name: "{{ org.name | lower }}" - component_name: "{{ org.name | lower }}-vaultk8s-job" - component_type: "{{ org.type | lower }}" - component_ns: "{{ org.name | lower }}-net" - component_auth: "{{ network.env.type }}{{ org.name | lower }}-net-auth" - kubernetes: "{{ org.k8s }}" - vault: "{{ org.vault }}" - policy_type: "fabric" - gitops: "{{ org.gitops }}" - reset_path: "platforms/hyperledger-fabric/configuration" - loop: "{{ network['organizations'] }}" - loop_control: - loop_var: org - + vars: + name: "{{ org.name | lower }}" + component_name: "{{ org.name | lower }}-vaultk8s-job" + component_type: "{{ org.type | lower }}" + component_ns: "{{ org.name | lower }}-net" + component_auth: "{{ network.env.type }}{{ org.name | lower }}-net-auth" + kubernetes: "{{ org.k8s }}" + vault: "{{ org.vault }}" + policy_type: "fabric" + gitops: "{{ org.gitops }}" + reset_path: "platforms/hyperledger-fabric/configuration" + loop: "{{ network['organizations'] }}" + loop_control: + loop_var: org + when: org.org_status == 'new' + # Create Storageclass for new organization - include_role: name: "{{ playbook_dir }}/../../../platforms/shared/configuration/roles/setup/storageclass" @@ -78,6 +92,7 @@ component_type: "{{ item.type | lower}}" component_services: "{{ item.services }}" orderer_org: "{{ item.orderer_org | lower }}" + sc_name: "{{ component }}-{{ item.cloud_provider | lower }}-storageclass" kubernetes: "{{ item.k8s }}" vault: "{{ item.vault }}" ca: "{{ item.services.ca }}" diff --git a/platforms/hyperledger-fabric/configuration/roles/create/new_orderer/create_appchannel_block/templates/update_channel_script.tpl b/platforms/hyperledger-fabric/configuration/roles/create/new_orderer/create_appchannel_block/templates/update_channel_script.tpl index 939238467a5..cbd762eb059 100644 --- a/platforms/hyperledger-fabric/configuration/roles/create/new_orderer/create_appchannel_block/templates/update_channel_script.tpl +++ b/platforms/hyperledger-fabric/configuration/roles/create/new_orderer/create_appchannel_block/templates/update_channel_script.tpl @@ -3,22 +3,34 @@ set -x CURRENT_DIR=${PWD} +NETWORK_VERSION="{{ version }}" echo "installing jq " apt-get install -y jq -echo "installing configtxlator" -mkdir temp -cd temp/ -wget https://github.com/hyperledger/fabric/releases/download/v{{ version }}/hyperledger-fabric-{{ os }}-{{ arch }}-{{ version }}.tar.gz -tar -xvf hyperledger-fabric-{{ os }}-{{ arch }}-{{ version }}.tar.gz -mv bin/configtxlator ../ -cd ../ -rm -r temp +if [ "$NETWORK_VERSION" != "2.5.4" ]; then + echo "installing configtxlator" + mkdir temp + cd temp/ + wget https://github.com/hyperledger/fabric/releases/download/v{{ version }}/hyperledger-fabric-{{ os }}-{{ arch }}-{{ version }}.tar.gz + tar -xvf hyperledger-fabric-{{ os }}-{{ arch }}-{{ version }}.tar.gz + mv bin/configtxlator ../ + cd ../ + rm -r temp +fi + echo "converting the channel_config_block.pb to channel_config.json using configtxlator and jq" configtxlator proto_decode --input {{ channel_name }}_config_block.pb --type common.Block | jq .data.data[0].payload.data.config > {{ channel_name }}_config.json echo "adding new organization crypto material from config.json to the channel_config.json to make channel_modified_config.json" -jq --argjson a "$(cat ./orderer)" '.channel_group.values.OrdererAddresses.value.addresses += $a' {{ channel_name }}_config.json > {{ channel_name }}_modified_intermediate_config.json -jq --argjson a "$(cat ./orderer-tls)" '.channel_group.groups.Orderer.values.ConsensusType.value.metadata.consenters += $a' {{ channel_name }}_modified_intermediate_config.json > {{ channel_name }}_modified_config.json +if [ "$NETWORK_VERSION" != "2.5.4" ]; then + echo "version 2.2.2++++" + jq --argjson a "$(cat ./orderer)" '.channel_group.values.OrdererAddresses.value.addresses += $a' {{ channel_name }}_config.json > {{ channel_name }}_modified_intermediate_config.json + jq --argjson a "$(cat ./orderer-tls)" '.channel_group.groups.Orderer.values.ConsensusType.value.metadata.consenters += $a' {{ channel_name }}_modified_intermediate_config.json > {{ channel_name }}_modified_config.json +else + echo "version 2.5.4++++" + jq --argjson a "$(cat ./orderer)" '.channel_group.values.OrdererAddresses.value.addresses += $a' {{ channel_name }}_config.json > {{ channel_name }}_modified_intermediate_address_config.json + jq --argjson a "$(cat ./orderer)" '.channel_group.groups.Orderer.groups.{{ component_name }}MSP.values.Endpoints.value.addresses += $a' {{ channel_name }}_modified_intermediate_address_config.json > {{ channel_name }}_modified_intermediate_endpoints_config.json + jq --argjson a "$(cat ./orderer-tls)" '.channel_group.groups.Orderer.values.ConsensusType.value.metadata.consenters += $a' {{ channel_name }}_modified_intermediate_endpoints_config.json > {{ channel_name }}_modified_config.json +fi echo "converting the channel_config.json and channel_modified_config.json to .pb files" configtxlator proto_encode --input {{ channel_name }}_config.json --type common.Config --output {{ channel_name }}_config.pb configtxlator proto_encode --input {{ channel_name }}_modified_config.json --type common.Config --output {{ channel_name }}_modified_config.pb diff --git a/platforms/hyperledger-fabric/configuration/roles/create/orderers/tasks/main.yaml b/platforms/hyperledger-fabric/configuration/roles/create/orderers/tasks/main.yaml index c7c62e3ac97..c5eb9bc431d 100644 --- a/platforms/hyperledger-fabric/configuration/roles/create/orderers/tasks/main.yaml +++ b/platforms/hyperledger-fabric/configuration/roles/create/orderers/tasks/main.yaml @@ -66,7 +66,25 @@ loop_var: orderer when: - component_services.orderers is defined and component_services.consensus is defined - - orderer.status is not defined or orderer.status == 'new' + - (orderer.status is not defined or orderer.status == 'new') and '2.5.' not in network.version + +# Create the value file for the Orderers as per requirements mentioned in network.yaml +- name: "create orderers" + include_role: + name: helm_component + vars: + name: "orderer" + org_name: "{{ item.name | lower }}" + sc_name: "{{ org_name }}-{{ item.cloud_provider | lower}}-storageclass" + component_name: "{{ orderer.name }}-{{ org_name }}" + type: "orderers" + consensus: "{{component_services.consensus}}" + loop: "{{ component_services.orderers }}" + loop_control: + loop_var: orderer + when: + - component_services.orderers is defined and component_services.consensus is defined + - (orderer.status is not defined or orderer.status == 'new') and '2.5.' in network.version # Git Push: Push the above generated files to git directory - name: Git Push diff --git a/platforms/hyperledger-fabric/configuration/roles/create/osnchannels/tasks/valuefile.yaml b/platforms/hyperledger-fabric/configuration/roles/create/osnchannels/tasks/valuefile.yaml index db86668f639..8d78ea1c044 100644 --- a/platforms/hyperledger-fabric/configuration/roles/create/osnchannels/tasks/valuefile.yaml +++ b/platforms/hyperledger-fabric/configuration/roles/create/osnchannels/tasks/valuefile.yaml @@ -17,6 +17,19 @@ orderer_kubeconfig: "{{ org.k8s.config_file }}" orderer_context: "{{ org.k8s.context }}" +# Reset ca-tools pod +- name: "Reset ca-tools pod" + include_role: + name: create/refresh_certs/reset_pod + vars: + pod_name: "osn-createchannel-{{item.channel_name|lower}}" + file_path: "{{playbook_dir}}/../../../{{org.gitops.release_dir}}/{{ org.name | lower }}/{{ org.name | lower }}/{{item.channel_name|lower}}.yaml" + gitops_value: "{{ org.gitops }}" + component_ns: "{{ org.name | lower }}-net" + kubernetes: "{{ org.k8s }}" + hr_name: "channel-{{ org.name | lower }}-{{item.channel_name|lower}}" + when: add_orderer is defined and add_orderer == 'true' + # Create the value file for creator Organization - name: "Create Create_Channel value file osnadmin" include_role: @@ -35,6 +48,30 @@ orderers_list: "{{ org.services.orderers }}" genesis: "{{ lookup('file', '{{ build_path }}/channel-artifacts/genesis.block.base64') }}" values_dir: "{{playbook_dir}}/../../../{{org.gitops.release_dir}}/{{ org.name | lower }}" + add_orderer_value: "{{ add_orderer | default('false') }}" + when: add_orderer is not defined or add_orderer == false + +# Create the value file for creator Organization +- name: "Create Create_Channel value file osnadmin" + include_role: + name: helm_component + vars: + name: "{{ org.name | lower }}" + type: "osn_create_channel_job" + component_name: "{{item.channel_name|lower}}" + component_ns: "{{ org.name | lower}}-net" + git_protocol: "{{ org.gitops.git_protocol }}" + git_url: "{{ org.gitops.git_url }}" + git_branch: "{{ org.gitops.branch }}" + charts_dir: "{{ org.gitops.chart_source }}" + vault: "{{ org.vault }}" + k8s: "{{ org.k8s }}" + orderers_list: "{{ org.services.orderers }}" + first_orderer: "{{ org.services.orderers | first }}" + values_dir: "{{playbook_dir}}/../../../{{org.gitops.release_dir}}/{{ org.name | lower }}" + add_orderer_value: "{{ add_orderer | default('false') }}" + external_url_suffix: "{{ org.external_url_suffix }}" + when: add_orderer is defined and add_orderer == 'true' # Git Push: Push the above generated files to git directory - name: Git Push diff --git a/platforms/hyperledger-fabric/configuration/roles/create/peers/tasks/main.yaml b/platforms/hyperledger-fabric/configuration/roles/create/peers/tasks/main.yaml index 45a81ab6a29..9c5d756bd4f 100644 --- a/platforms/hyperledger-fabric/configuration/roles/create/peers/tasks/main.yaml +++ b/platforms/hyperledger-fabric/configuration/roles/create/peers/tasks/main.yaml @@ -44,7 +44,7 @@ tags: - notest -# Wait for the Orderer HelmRelease +# Wait for the peer HelmRelease - name: 'Wait for {{ peer.name }} HelmRelease in {{ namespace }}' k8s_info: api_version: "helm.toolkit.fluxcd.io/v2beta1" diff --git a/platforms/hyperledger-fabric/configuration/roles/create/peers/tasks/nested_main.yaml b/platforms/hyperledger-fabric/configuration/roles/create/peers/tasks/nested_main.yaml index cdee0e65511..872226cf4c0 100644 --- a/platforms/hyperledger-fabric/configuration/roles/create/peers/tasks/nested_main.yaml +++ b/platforms/hyperledger-fabric/configuration/roles/create/peers/tasks/nested_main.yaml @@ -2,6 +2,8 @@ - name: Remove existing value file for {{ peer.name }} shell: | rm -f {{ values_dir }}/{{ item.name | lower }}/values-{{ peer.name }}.yaml + when: + - add_peer is not defined or add_peer == 'false' # Fetch the custom core.yaml - name: Fetch the custom core.yaml diff --git a/platforms/hyperledger-fabric/configuration/roles/helm_component/templates/orderernode.tpl b/platforms/hyperledger-fabric/configuration/roles/helm_component/templates/orderernode.tpl index f189d7ff1a3..066c2cbd0c4 100644 --- a/platforms/hyperledger-fabric/configuration/roles/helm_component/templates/orderernode.tpl +++ b/platforms/hyperledger-fabric/configuration/roles/helm_component/templates/orderernode.tpl @@ -101,9 +101,10 @@ spec: proxy: provider: {{ network.env.proxy }} external_url_suffix: {{ item.external_url_suffix }} - +{% if '2.5' not in network.version %} genesis: |- {{ genesis | indent(width=6, first=True) }} +{% endif %} config: pod: diff --git a/platforms/hyperledger-fabric/configuration/roles/helm_component/templates/osn_create_channel_job.tpl b/platforms/hyperledger-fabric/configuration/roles/helm_component/templates/osn_create_channel_job.tpl index a374cfd84cf..707531f4f00 100644 --- a/platforms/hyperledger-fabric/configuration/roles/helm_component/templates/osn_create_channel_job.tpl +++ b/platforms/hyperledger-fabric/configuration/roles/helm_component/templates/osn_create_channel_job.tpl @@ -33,6 +33,7 @@ spec: {% else %} authpath: {{ network.env.type }}{{ component_ns }}-auth {% endif %} + adminsecretprefix: {{ vault.secret_path | default('secretsv2') }}/data/crypto/ordererOrganizations/{{ component_ns }}/users/admin orderersecretprefix: {{ vault.secret_path | default('secretsv2') }}/data/crypto/ordererOrganizations/{{ component_ns }}/orderers serviceaccountname: vault-auth type: {{ vault.type | default("hashicorp") }} @@ -47,5 +48,14 @@ spec: orderers: orderer_info: {% for orderer in orderers_list %}{% for key, value in orderer.items() %}{% if key == 'name' %}{{ value }}{% endif %}{% endfor %}*{% endfor %} + add_orderer: {{ add_orderer_value }} + +{% if add_orderer is not defined or add_orderer is sameas false %} genesis: |- {{ genesis | indent(width=6, first=True) }} +{% else %} + orderer: + name: {{ first_orderer.name }} + localmspid: {{ org.name | lower}}MSP + address: {{ first_orderer.ordererAddress }} +{% endif %}