Skip to content

Add collect_enodes playbook #60

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ faucet.yml
reverse_proxy.yml
dshackle.yml
.vscode/settings.json
enodes.json

23 changes: 23 additions & 0 deletions playbooks/tasks/collect_enodes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- name: Collect enodes
hosts: execution
gather_facts: false
serial: 20
tasks:
- name: Get enode from logs
shell: docker logs {{execution_container_name}} | grep enode:// | sed 's/.*enode:\/\///'
register: enode_noprefix_cmd
- name: Set each node's own enode
set_fact:
execution_enode: "enode://{{enode_noprefix_cmd.stdout}}"
- name: Write enodes
hosts: localhost
gather_facts: true
tasks:
- name: Create a map with all node's enodes
with_items: "{{ groups['execution'] }}"
set_fact:
execution_enodes: "{{ execution_enodes|default({}) | combine( {item: hostvars[item]['execution_enode']} ) }}"
- name: Write enodes
copy:
content: "{{ execution_enodes.values() | list | to_nice_json }}"
dest: "../../enodes.json"