From afe666450c62ae40f898bc68b7e47bcf0a45a0c8 Mon Sep 17 00:00:00 2001 From: Sylvain Martel Date: Fri, 17 Feb 2023 08:57:58 -0500 Subject: [PATCH 1/2] optional ec2 tags for aws module Signed-off-by: Sylvain Martel --- terraform/aws/main.tf | 4 +++- terraform/aws/variables.tf | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/terraform/aws/main.tf b/terraform/aws/main.tf index 6c3d32f..3ee34c1 100644 --- a/terraform/aws/main.tf +++ b/terraform/aws/main.tf @@ -2,7 +2,7 @@ # - When using elastic IP addresses, the limit is 5 per region # so, you are limited to 2 nodes using elastic IP addresses. module "indy-node" { - source = "github.com/ICCS-ISAC/terraform-aws-indy-node?ref=1.1.0" + source = "github.com/ICCS-ISAC/terraform-aws-indy-node?ref=1.1.1" count = var.candy_instance_count @@ -12,6 +12,7 @@ module "indy-node" { zone = data.aws_availability_zones.available.names[count.index % length(data.aws_availability_zones.available.names)] ami_id = data.aws_ami.ubuntu.id ec2_instance_type = var.candy_ec2_instance_type + opt_ec2_tags = var.optional_ec2_tags root_volume_size = var.candy_root_volume_size data_volume_size = var.candy_data_volume_size @@ -33,4 +34,5 @@ module "indy-node" { client_port = var.candy_client_port node_port = var.candy_node_port ssh_key_name = aws_key_pair.ansible.key_name + } diff --git a/terraform/aws/variables.tf b/terraform/aws/variables.tf index 75453b4..4b872b5 100644 --- a/terraform/aws/variables.tf +++ b/terraform/aws/variables.tf @@ -110,4 +110,11 @@ variable "iam_role" { variable "candy_vpc_node_cidr_block" { description = "VPC IP CIDR" +} + +variable "optional_ec2_tags" { + description = "Allows to add optional tags to EC2 vm's" + type = map(string) + default = { + } } \ No newline at end of file From 4183b8fcf1dd20b32b6e73a49ea2a89498375b0d Mon Sep 17 00:00:00 2001 From: Sylvain Martel Date: Thu, 29 Feb 2024 09:10:29 -0500 Subject: [PATCH 2/2] change from rc to stable Signed-off-by: Sylvain Martel --- .../roles/indy_node/defaults/main.yml | 8 +- .../roles/indy_node/tasks/install.yml | 254 +++++++++--------- .../templates/repository/hyperledger.pref.j2 | 3 + .../roles/indy_node_repo/tasks/main.yml | 8 +- 4 files changed, 141 insertions(+), 132 deletions(-) create mode 100644 ansible/indy_node/roles/indy_node/templates/repository/hyperledger.pref.j2 diff --git a/ansible/indy_node/roles/indy_node/defaults/main.yml b/ansible/indy_node/roles/indy_node/defaults/main.yml index 4557562..f00821b 100644 --- a/ansible/indy_node/roles/indy_node/defaults/main.yml +++ b/ansible/indy_node/roles/indy_node/defaults/main.yml @@ -1,8 +1,8 @@ --- -indy_node_channel: rc +indy_node_channel: stable indy_node_pkg: indy-node -indy_node_pkg_version: 1.13.2~rc3 -indy_plenum_pkg_version: 1.13.1~rc2 +indy_node_pkg_version: 1.13.2 +indy_plenum_pkg_version: 1.13.1 # Configuration Parameters cloud: azure @@ -20,4 +20,4 @@ indy_node_configuration: true start_indy_node: true # Don't set this, it is auto-detected -distribution_codename: null \ No newline at end of file +distribution_codename: null diff --git a/ansible/indy_node/roles/indy_node/tasks/install.yml b/ansible/indy_node/roles/indy_node/tasks/install.yml index fbd0480..b233f7c 100644 --- a/ansible/indy_node/roles/indy_node/tasks/install.yml +++ b/ansible/indy_node/roles/indy_node/tasks/install.yml @@ -10,144 +10,134 @@ - name: Install dependencies block: + # ============================= + # RocksDb and Dependenaces + #------------------------------ + - name: rocksdb + apt: + name: + - "rocksdb=5.8.8" + update_cache: true + become: true + tags: + - install + - package - # ============================= - # RocksDb and Dependenaces - #------------------------------ - - name: rocksdb - apt: - name: - - "rocksdb=5.8.8" - update_cache: true - become: true - tags: - - install - - package + - name: libgflags-dev + apt: + name: + - "libgflags-dev" + update_cache: true + become: true + tags: + - install + - package - - name: libgflags-dev - apt: - name: - - "libgflags-dev" - update_cache: true - become: true - tags: - - install - - package + - name: libsnappy-dev + apt: + name: + - "libsnappy-dev" + update_cache: true + become: true + tags: + - install + - package - - name: libsnappy-dev - apt: - name: - - "libsnappy-dev" - update_cache: true - become: true - tags: - - install - - package + - name: zlib1g-dev + apt: + name: + - "zlib1g-dev" + update_cache: true + become: true + tags: + - install + - package - - name: zlib1g-dev - apt: - name: - - "zlib1g-dev" - update_cache: true - become: true - tags: - - install - - package + - name: libbz2-dev + apt: + name: + - "libbz2-dev" + update_cache: true + become: true + tags: + - install + - package - - name: libbz2-dev - apt: - name: - - "libbz2-dev" - update_cache: true - become: true - tags: - - install - - package + - name: liblz4-dev + apt: + name: + - "liblz4-dev" + update_cache: true + become: true + tags: + - install + - package + # ============================= - - name: liblz4-dev - apt: - name: - - "liblz4-dev" - update_cache: true - become: true - tags: - - install - - package - # ============================= + - name: libssl1.0.0 + apt: + name: + - "libssl1.0.0" + update_cache: true + become: true + tags: + - install + - package - - name: libssl1.0.0 - apt: - name: - - "libssl1.0.0" - update_cache: true - become: true - tags: - - install - - package + # ============================= + # Ursa + # ----------------------------- + - name: ursa + apt: + name: + - "ursa=0.3.2-1" + update_cache: true + become: true + tags: + - install + - package - # ============================= - # Ursa - # ----------------------------- - - name: ursa - apt: - name: - - "ursa=0.3.2-1" - update_cache: true - become: true - tags: - - install - - package + # ============================= - - name: Move libursa.so to parent dirirectory - shell: > - if [ -d /usr/lib/ursa ]; then - mv /usr/lib/ursa/* /usr/lib && rm -rf /usr/lib/ursa - fi - become: true - tags: - - install - - package - # ============================= + - name: python3-libnacl + apt: + name: + - "python3-libnacl=1.6.1" + update_cache: true + become: true + tags: + - install + - package - - name: python3-libnacl - apt: - name: - - "python3-libnacl=1.6.1" - update_cache: true - become: true - tags: - - install - - package + - name: python3-ujson + apt: + name: + - "python3-ujson=1.33" + update_cache: true + become: true + tags: + - install + - package - - name: python3-ujson - apt: - name: - - "python3-ujson=1.33" - update_cache: true - become: true - tags: - - install - - package + - name: python3-sortedcontainers + apt: + name: + - "python3-sortedcontainers=1.5.7" + update_cache: true + become: true + tags: + - install + - package - - name: python3-sortedcontainers - apt: - name: - - "python3-sortedcontainers=1.5.7" - update_cache: true - become: true - tags: - - install - - package - - - name: indy-plenum - apt: - name: - - "indy-plenum={{ indy_plenum_pkg_version | default(indy_node_pkg_version) }}" - update_cache: true - become: true - tags: - - install - - package + - name: indy-plenum + apt: + name: + - "indy-plenum={{ indy_plenum_pkg_version | default(indy_node_pkg_version) }}" + update_cache: true + become: true + tags: + - install + - package when: - indy_node_channel == "rc" - distribution_codename == "focal" @@ -160,4 +150,14 @@ become: true tags: - install - - package \ No newline at end of file + - package + +- name: Move libursa.so to parent dirirectory + shell: > + if [ -d /usr/lib/ursa ]; then + mv /usr/lib/ursa/* /usr/lib && rm -rf /usr/lib/ursa + fi + become: true + tags: + - install + - package diff --git a/ansible/indy_node/roles/indy_node/templates/repository/hyperledger.pref.j2 b/ansible/indy_node/roles/indy_node/templates/repository/hyperledger.pref.j2 new file mode 100644 index 0000000..4da0414 --- /dev/null +++ b/ansible/indy_node/roles/indy_node/templates/repository/hyperledger.pref.j2 @@ -0,0 +1,3 @@ +Package: * +Pin: origin hyperledger.jfrog.io +Pin-Priority: 1001 \ No newline at end of file diff --git a/ansible/indy_node/roles/indy_node_repo/tasks/main.yml b/ansible/indy_node/roles/indy_node_repo/tasks/main.yml index 8304f8e..cc3f4ea 100644 --- a/ansible/indy_node/roles/indy_node_repo/tasks/main.yml +++ b/ansible/indy_node/roles/indy_node_repo/tasks/main.yml @@ -62,4 +62,10 @@ when: - distribution_codename == "focal" - indy_repo_node_channels|d(False, True) -# ============================================================================================================== \ No newline at end of file + +- name: Set Hyperledger repository priority + template: + src: repository/hyperledger.pref.j2 + dest: /etc/apt/preferences.d/hyperledger.pref +# ============================================================================================================== +