Skip to content

Commit

Permalink
feat(quorum): replace ansible roles readme with inline code comments
Browse files Browse the repository at this point in the history
This PR enhances the readability and understanding of our roles by adding comment messages throughout the code.

Changes:
- Added clear and concise comment messages in ansible roles.
- Maintained proper code indentation for increased code reliability.
- Removed the roles' Readme.md if it existed.

Additional changes:
- Deleted the entire storageclass role along with its tpl as we have already migrated it to the shared platform.
- Deleted reset-network.yaml from the Quorum platform as we have delete-network.yaml and cleanup.yaml in the shared and Quorum platforms respectively for the same purpose.

fixes #2326

Signed-off-by: saurabhkumarkardam <[email protected]>
  • Loading branch information
saurabhkumarkardam committed Oct 25, 2023
1 parent a8cd445 commit 4f4b1ff
Show file tree
Hide file tree
Showing 52 changed files with 131 additions and 1,314 deletions.
8 changes: 5 additions & 3 deletions platforms/quorum/configuration/cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Playbook to cleanup platform specific resources
##################################################
---
# This will apply to ansible_provisioners. /etc/ansible/hosts should be configured with this group
# This will apply to ansible_provisioners. /etc/ansible/hosts should be configured with this group
- hosts: ansible_provisioners
gather_facts: no
no_log: "{{ no_ansible_log | default(false) }}"
Expand All @@ -27,12 +27,14 @@
kubernetes: "{{ item.k8s }}"
loop: "{{ network['organizations'] }}"

# delete build directory
# Delete build directory
- name: Remove build directory
file:
path: "./build"
state: absent
vars: #These variables can be overriden from the command line

#These variables can be overriden from the command line
vars:
privilege_escalate: false # Default to NOT escalate to root privledges
install_os: "linux" # Default to linux OS
install_arch: "amd64" # Default to amd64 architecture
Expand Down
31 changes: 16 additions & 15 deletions platforms/quorum/configuration/deploy-network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
path: "./build"
state: absent

# create namespace, service account and clusterrolebinding
- name: "Create namespace and service account"
# create namespace
- name: "Create namespace"
include_role:
name: create/namespace
vars:
Expand Down Expand Up @@ -98,7 +98,7 @@
loop_control:
loop_var: org

# This role generates the crypto material for quorum network based on RAFT consensus and store it in vault
# Generate the crypto material for quorum network based on RAFT consensus and store it in vault
- name: "Generate crypto material for RAFT consensus"
include_role:
name: create/crypto/raft
Expand All @@ -117,20 +117,20 @@
loop_control:
loop_var: org

# This role makes up the istanbul binary and place it in the bin directory
# Build istanbul binary and place it in the bin directory
- name: "Setup istanbul-tools"
include_role:
name: setup/istanbul
loop: "{{ network['organizations'] }}"
when: network.config.consensus == 'ibft'

# This role generates the genesis.json and nodekey/enode for all orgs of the network
# Generate the genesis.json and nodekey/enode for all orgs of the network
- name: "Generate genesis and nodekey/enode for the network"
include_role:
name: create/genesis_nodekey
when: network.config.consensus == 'ibft'

# This role generates the crypto material for quorum network based on ibft consensus and store it in vault
# Generate the crypto material for quorum network based on ibft consensus and store it in vault
- name: "Generate crypto material for IBFT consensus"
include_role:
name: create/crypto/ibft
Expand All @@ -149,7 +149,7 @@
loop_var: org
when: network.config.consensus == 'ibft'

# This role generates the crypto materials for tessera tm
# Generate the crypto materials for tessera tm
- name: "Generate crypto for the Tessera transaction manager"
include_role:
name: create/crypto/tessera
Expand All @@ -169,7 +169,7 @@
when:
- network.config.transaction_manager == 'tessera'

# This role deploys Tessera transaction manager node
# Deploy Tessera transaction manager node
- name: "Deploy Tessera Transaction Manager"
include_role:
name: create/tessera
Expand All @@ -188,7 +188,7 @@
loop_var: org
when: network.config.transaction_manager == 'tessera'

# This role deploys member nodes
# Deploy member nodes
- name: "Deploy member nodes"
include_role:
name: create/member_node
Expand All @@ -212,7 +212,7 @@
loop_control:
loop_var: org

# This role deploys validator nodes
# Deploy validator nodes
- name: "Deploy validator nodes"
include_role:
name: create/validator_node
Expand All @@ -236,8 +236,9 @@
loop_control:
loop_var: org

vars: #These variables can be overriden from the command line
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
#These variables can be overriden from the command line
vars:
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 # 'add_new_org' flag, defaults to false when not defined.
161 changes: 0 additions & 161 deletions platforms/quorum/configuration/reset-network.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# and places them in vault. Certificates are created using openssl

---
# This task creates the value files for each node of organization
# Create the value files for each node of organization
- name: Create value file for ambassador job
include_role:
name: helm_component
Expand All @@ -18,7 +18,7 @@
type: "certs-ambassador-quorum"
external_url: "{{ org.external_url_suffix }}"

# Git Push : Pushes the above generated files to git directory
# Git Push : Push the above generated files to git directory
- name: Git Push
include_role:
name: "{{ playbook_dir }}/../../shared/configuration/roles/git_push"
Expand All @@ -40,7 +40,7 @@
tags:
- notest

# This task creates the Ambassador tls credentials
# Create the Ambassador tls credentials
- name: "Create the Ambassador credentials"
include_role:
name: create/k8s_secrets
Expand Down
56 changes: 0 additions & 56 deletions platforms/quorum/configuration/roles/create/crypto/ibft/Readme.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# SPDX-License-Identifier: Apache-2.0
##############################################################################################

# Create crypto material for each peer with IBFT consensus
- name: Create crypto material for each peer with IBFT consensus
include_tasks: nested_main.yaml
loop: "{{ peers }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
# SPDX-License-Identifier: Apache-2.0
##############################################################################################

# ---------------------------------------------------------------------
# generate tessera crypto helmrelease file
# Generate tessera crypto helmrelease file
- name: "Create ibft crypto file"
include_role:
name: helm_component
Expand All @@ -15,8 +14,7 @@
name: "{{ org.name | lower }}"
component_name: "{{ peer.name }}-ibft-job"

# ---------------------------------------------------------------------
# push the created deployment files to repository
# Push the created deployment files to repository
- name: "Push the created deployment files to repository"
include_role:
name: "{{ playbook_dir }}/../../shared/configuration/roles/git_push"
Expand Down
Loading

0 comments on commit 4f4b1ff

Please sign in to comment.