diff --git a/group_vars/all.yml.example b/group_vars/all.yml.example index c5a784a..323b1af 100644 --- a/group_vars/all.yml.example +++ b/group_vars/all.yml.example @@ -71,6 +71,8 @@ key_name: "id_rsa.pub" #If this variable is set to "True" all the VMs will be rebooted after setup. reboot_after_completion: false +"Path to spec.json file. If no file provided, spec.json will be downloaded from GitHub +spec_json: "" ##Bootnode-related variables. diff --git a/roles/preconf/defaults/main.yml b/roles/preconf/defaults/main.yml index 5f263fa..c5be53e 100644 --- a/roles/preconf/defaults/main.yml +++ b/roles/preconf/defaults/main.yml @@ -7,4 +7,6 @@ home: "/home/{{ username }}" GENESIS_NETWORK_NAME: "PoA" MAIN_REPO_FETCH: "poanetwork" -GENESIS_BRANCH: "master" \ No newline at end of file +GENESIS_BRANCH: "master" + +spec_json: "" \ No newline at end of file diff --git a/roles/preconf/tasks/spec.yml b/roles/preconf/tasks/spec.yml index 172df18..bc42462 100644 --- a/roles/preconf/tasks/spec.yml +++ b/roles/preconf/tasks/spec.yml @@ -1,6 +1,11 @@ --- +- name: Copy spec.json to remote machine + copy: src={{ spec_json }} dest={{ home }}/ mode=0644 group={{ username }} owner={{ username }} + when: spec_json != "" + - name: Download spec.json get_url: url={{ item }} dest={{ home }}/ mode=0644 group={{ username }} owner={{ username }} with_items: - "https://raw.githubusercontent.com/{{ MAIN_REPO_FETCH }}/poa-chain-spec/{{ GENESIS_BRANCH }}/spec.json" - - "https://raw.githubusercontent.com/{{ MAIN_REPO_FETCH }}/poa-chain-spec/{{ GENESIS_BRANCH }}/bootnodes.txt" \ No newline at end of file + - "https://raw.githubusercontent.com/{{ MAIN_REPO_FETCH }}/poa-chain-spec/{{ GENESIS_BRANCH }}/bootnodes.txt" + when: spec_json == "" \ No newline at end of file