Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json #77

Merged
merged 73 commits into from
Jul 31, 2024
Merged

Json #77

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
650dbad
update plenum and node to latest release
SylvainMartel Feb 15, 2024
53410fd
init output in json
SylvainMartel Feb 15, 2024
cb6ea33
plenum back to rc4
SylvainMartel Feb 15, 2024
269b35d
m
SylvainMartel Feb 15, 2024
45f3d7a
m
SylvainMartel Feb 15, 2024
9e6e204
m
SylvainMartel Feb 15, 2024
d297a97
m
SylvainMartel Feb 15, 2024
c586c38
m
SylvainMartel Feb 15, 2024
eae601a
m
SylvainMartel Feb 15, 2024
1a71ace
m
SylvainMartel Feb 15, 2024
eb949b8
m
SylvainMartel Feb 15, 2024
45e1c79
m
SylvainMartel Feb 15, 2024
2061d2a
m
SylvainMartel Feb 15, 2024
ed5752b
m
SylvainMartel Feb 15, 2024
12d61bf
m
SylvainMartel Feb 15, 2024
a6c06b9
m
SylvainMartel Feb 16, 2024
9a578a9
m
SylvainMartel Feb 16, 2024
17b1427
m
SylvainMartel Feb 16, 2024
41990bf
m
SylvainMartel Feb 16, 2024
44e9ce2
m
SylvainMartel Feb 16, 2024
34c1516
m
SylvainMartel Feb 16, 2024
e54f6db
m
SylvainMartel Feb 16, 2024
77efeef
m
SylvainMartel Feb 16, 2024
1e102d8
m
SylvainMartel Feb 16, 2024
adabee7
m
SylvainMartel Feb 19, 2024
74e33ba
m
SylvainMartel Feb 19, 2024
4d87da8
m
SylvainMartel Feb 19, 2024
d1dc88a
m
SylvainMartel Feb 19, 2024
396f29e
m
SylvainMartel Feb 19, 2024
ca81214
m
SylvainMartel Feb 19, 2024
4cd753e
m
SylvainMartel Feb 19, 2024
26c1fe3
m
SylvainMartel Feb 19, 2024
1f4bfa4
m
SylvainMartel Feb 19, 2024
2e5879a
m
SylvainMartel Feb 19, 2024
87f7910
m
SylvainMartel Feb 19, 2024
201e084
m
SylvainMartel Feb 19, 2024
d9d21d6
m
SylvainMartel Feb 19, 2024
a7a31e5
m
SylvainMartel Feb 19, 2024
9cfdc8f
m
SylvainMartel Feb 19, 2024
c4bcc64
m
SylvainMartel Feb 19, 2024
d1b3806
m
SylvainMartel Feb 19, 2024
7aa0eba
m
SylvainMartel Feb 19, 2024
67f0b5a
m
SylvainMartel Feb 19, 2024
a0e030c
m
SylvainMartel Feb 20, 2024
b079583
m
SylvainMartel Feb 20, 2024
eb6ec87
m
SylvainMartel Feb 20, 2024
a334fc0
m
SylvainMartel Feb 20, 2024
3fdff23
m
SylvainMartel Feb 20, 2024
d452339
m
SylvainMartel Feb 20, 2024
a9b05c8
m
SylvainMartel Feb 20, 2024
b56c252
m
SylvainMartel Feb 20, 2024
5854475
m
SylvainMartel Feb 20, 2024
3773689
m
SylvainMartel Feb 20, 2024
53d38ef
m
SylvainMartel Feb 20, 2024
346429e
m
SylvainMartel Feb 20, 2024
907beec
m
SylvainMartel Feb 20, 2024
9e35c71
m
SylvainMartel Feb 20, 2024
627a6f5
m
SylvainMartel Feb 21, 2024
ce32beb
m
SylvainMartel Feb 21, 2024
392dd1f
m
SylvainMartel Feb 21, 2024
1d2e812
m
SylvainMartel Feb 21, 2024
41c7fff
m
SylvainMartel Feb 28, 2024
f5eb185
m
SylvainMartel Feb 28, 2024
0605cae
m
SylvainMartel Feb 28, 2024
ccb5f21
changement de priorité repo hyperledger
SylvainMartel Feb 28, 2024
8c53b7b
m
SylvainMartel Feb 28, 2024
6011408
Merge bmergeranch 'stable' into json
SylvainMartel Feb 29, 2024
f511012
m
SylvainMartel Apr 10, 2024
9f89d6a
m
SylvainMartel Apr 10, 2024
8192d7f
m
SylvainMartel Apr 10, 2024
a11ecc0
Merge branch 'ICCS-ISAC:main' into json
SylvainMartel May 23, 2024
95958b1
m
SylvainMartel May 23, 2024
1c11491
indy-node-aws module version
SylvainMartel May 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 56 additions & 14 deletions ansible/indy_node/roles/indy_node/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

- name: Set node_alias variable
set_fact:
node_alias: "{{ hostname.stdout }}"
node_alias: "{{ hostname.stdout }}"

- name: Print node_alias
debug:
var: node_alias
var: node_alias
# ============================================================

- name: Check that required variables are specified
Expand Down Expand Up @@ -122,17 +122,17 @@
# ----------------------------------------------------------------------------------------------------------------------------------------------------------
- name: Generate init_indy_node command
set_fact:
init_indy_node_cmd: "sudo -i -u indy init_indy_node {{ node_alias }} {{ node_ip }} {{ node_port }} {{ client_ip }} {{ client_port }}"
init_indy_node_cmd: "sudo -i -u indy init_indy_node {{ node_alias }} {{ node_ip }} {{ node_port }} {{ client_ip }} {{ client_port }}"
when: node_seed is undefined

- name: Generate init_indy_node command with provided seed
set_fact:
init_indy_node_cmd: "sudo -i -u indy init_indy_node {{ node_alias }} {{ node_ip }} {{ node_port }} {{ client_ip }} {{ client_port }} {{ node_seed }}"
init_indy_node_cmd: "sudo -i -u indy init_indy_node {{ node_alias }} {{ node_ip }} {{ node_port }} {{ client_ip }} {{ client_port }} {{ node_seed }}"
when: node_seed is defined

- name: Print init_indy_node command
debug:
var: init_indy_node_cmd
var: init_indy_node_cmd

- name: Initialize Indy Node
shell: "{{ init_indy_node_cmd }}"
Expand Down Expand Up @@ -162,14 +162,14 @@

- name: Start indy-node service
block:
- name: Enable service
service:
name: indy-node
enabled: true
- name: Start service
service:
name: indy-node
state: started
- name: Enable service
service:
name: indy-node
enabled: true
- name: Start service
service:
name: indy-node
state: started
become: true
when: domain_transactions_genesis.stat.exists and pool_transactions_genesis.stat.exists and start_indy_node | bool
# =================================================================================================
Expand All @@ -181,11 +181,53 @@
debug:
msg: "ENSUE YOU RECORD THE FOLLOWING INITIALIZATION OUTPUT IN A SAFE LOCATION!"

- name: Ensure json output file exists
file:
path: init_output.json
state: touch
delegate_to: localhost

- name: DEBUG - Show template content
debug:
msg: "{{ lookup('template', 'init_output.j2') }}"

- name: ensures /tmp/candy dir exists
file:
path: "/tmp/candy"
state: directory
delegate_to: localhost

- name: Render init_output template and write to file
template:
src: init_output.j2
dest: /tmp/candy/init_output_{{ inventory_hostname }}.json
delegate_to: localhost

- name: Assemble JSON files into one
assemble:
src: /tmp/candy
dest: init_output.json
delegate_to: localhost

- name: Add [ at the beginning of the file
lineinfile:
path: init_output.json
insertbefore: BOF
line: "["
delegate_to: localhost

- name: Add ] at the end of the file
lineinfile:
path: init_output.json
insertafter: EOF
line: "]"
delegate_to: localhost

- name: Print init_indy_node result
debug:
var: init_indy_node_result.stdout_lines

- name: Print /etc/indy/indy.env
debug:
var: indy_env.stdout_lines
# ===============================================
# ===============================================
9 changes: 9 additions & 0 deletions ansible/indy_node/roles/indy_node/templates/init_output.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"{{ inventory_hostname }}":{
"hostname": "{{ inventory_hostname }}",
"initialization_output": {{ init_indy_node_result.stdout_lines | to_json }},
"node_ip": {{ hostvars[inventory_hostname]['tf_node_ip'] | to_json }},
"client_ip": {{ hostvars[inventory_hostname]['tf_client_ip'] | to_json }}
}
},

2 changes: 1 addition & 1 deletion terraform/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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.1"
source = "github.com/ICCS-ISAC/terraform-aws-indy-node?ref=1.2.0"


count = var.candy_instance_count
Expand Down