Skip to content

Commit

Permalink
Fixed molecule test errors
Browse files Browse the repository at this point in the history
Signed-off-by: suvajit-sarkar <[email protected]>
  • Loading branch information
suvajit-sarkar committed Jun 17, 2021
1 parent 2a80eac commit abb929a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
failed: True
peers: "{{ item.services.peers }}"
bin_install_dir: "~/bin"
go_root_folder: "{{ playbook_dir }}/build"
install_os: "linux"
install_arch: "amd64"
organisation: "{{ item.name | lower }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

- name: Generate enode url for each node and create a geth account and keystore
shell: |
bootnode --nodekey build/{{ component_name }}/{{ peer.name }}/nodekey --writeaddress > build/{{ component_name }}/{{ peer.name }}/enode
{{ bin_install_dir }}/bootnode --nodekey build/{{ component_name }}/{{ peer.name }}/nodekey --writeaddress > build/{{ component_name }}/{{ peer.name }}/enode
echo {{ peer.geth_passphrase }} >> build/{{ component_name }}/{{ peer.name }}/password
geth account new --datadir build/{{ component_name }}/{{ peer.name }} --password build/{{ component_name }}/{{ peer.name }}/password
{{ bin_install_dir }}/geth account new --datadir build/{{ component_name }}/{{ peer.name }} --password build/{{ component_name }}/{{ peer.name }}/password
cp build/{{ component_name }}/{{ peer.name }}/keystore/* build/{{ component_name }}/{{ peer.name }}/keystore.json
when: vault_nodekey_result.failed == True
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
- name: Generate istanbul files
shell: |
cd build
istanbul setup --num {{ validator_node_list | length }} --nodes --quorum --save --verbose
{{ bin_install_dir }}/istanbul setup --num {{ validator_node_list | length }} --nodes --quorum --save --verbose
when: vault_check|default(0)|int != 0
tags:
molecule-idempotence-notest
Expand Down
20 changes: 11 additions & 9 deletions platforms/quorum/configuration/roles/setup/golang/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,31 @@
mode: 0440
when: not go_stat_result.stat.exists

- name: Extract the Go tarball
unarchive:
src: "{{ tmp_directory.path }}/go{{ go.version }}.{{install_os}}-{{install_arch}}.tar.gz"
dest: "/usr/local"
copy: no
when: not go_stat_result.stat.exists

- name: create bin directory
file:
path: "{{ bin_install_dir }}"
state: directory
when: not go_stat_result.stat.exists

- name: Extract the Go tarball
unarchive:
src: "{{ tmp_directory.path }}/go{{ go.version }}.{{install_os}}-{{install_arch}}.tar.gz"
dest: "{{ go_root_folder }}/"
copy: no
when: not go_stat_result.stat.exists

- name: Copy go binary to destination directory
copy:
src: "/usr/local/go/bin/go"
src: "{{ go_root_folder }}/go/bin/go"
dest: "{{ bin_install_dir }}/"
mode: 0755
remote_src: yes
when: not go_stat_result.stat.exists

- name: Test go installation
command: "go version"
command: "{{ bin_install_dir }}/go version"
changed_when: false
environment:
GOROOT: "{{ go_root_folder }}/go"
tags:
- molecule-idempotence-notest
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ tmp_directory: "{{ lookup('env', 'TMPDIR') | default('/tmp',true) }}"

go:
version: 1.13.5
go_root_folder: {{ go_root_folder | default("/usr/local") }}

0 comments on commit abb929a

Please sign in to comment.