diff --git a/defaults/main.yml b/defaults/main.yml index 15a99f8..1f9239b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -36,5 +36,9 @@ beacon_node_consul_metrics_service_name: '{{ beacon_node_consul_service_name }}- # Goerli RPC beacon_node_web3_url: 'wss://goerli.infura.io/ws/v3/6224f3c792cc443fafb64e70a98f871e' +# Netkey file contents, optional. +#beacon_node_netkey: '{"key":"json"}' +beacon_node_netkey_cont_path: 'data/netkey' + # general container management compose_recreate: false diff --git a/tasks/compose.yml b/tasks/compose.yml index e8eaa5c..226d168 100644 --- a/tasks/compose.yml +++ b/tasks/compose.yml @@ -1,19 +1,4 @@ --- -- name: 'Create container dir: {{ beacon_node_cont_name }}' - file: - path: '{{ beacon_node_cont_vol }}/data' - state: directory - owner: dockremap - group: docker - mode: 0750 - with_items: - - '{{ beacon_node_cont_vol }}/data' - - '{{ beacon_node_secrets_path }}' - -- name: Verify network name - assert: - that: '{{ beacon_node_network in ["toledo", "pyrmont", "mainnet"] }}' - - name: 'Create container config: {{ beacon_node_cont_name }}' set_fact: beacon_node_compose: @@ -45,7 +30,7 @@ --log-level={{ beacon_node_log_level }} --tcp-port={{ beacon_node_listening_port }} --udp-port={{ beacon_node_discovery_port }} - --netkey-file=/data/netkey + --netkey-file=/{{ beacon_node_netkey_cont_path }} --insecure-netkey-password=true --rpc --rpc-address=0.0.0.0 diff --git a/tasks/config.yml b/tasks/config.yml new file mode 100644 index 0000000..36ad8b8 --- /dev/null +++ b/tasks/config.yml @@ -0,0 +1,25 @@ +--- +- name: 'Create container dir: {{ beacon_node_cont_name }}' + file: + path: '{{ beacon_node_cont_vol }}/data' + state: directory + owner: dockremap + group: docker + mode: 0750 + with_items: + - '{{ beacon_node_cont_vol }}/data' + - '{{ beacon_node_secrets_path }}' + +- name: 'Create netkey file (optional)' + copy: + dest: '{{ beacon_node_cont_vol }}/{{ beacon_node_netkey_cont_path }}' + content: '{{ beacon_node_netkey }}' + owner: dockremap + group: docker + mode: 0600 + when: beacon_node_netkey is defined + +- name: Verify network name + assert: + that: '{{ beacon_node_network in ["toledo", "pyrmont", "mainnet"] }}' + diff --git a/tasks/install.yml b/tasks/install.yml index f9d19ed..fc69ff0 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,8 +1,8 @@ --- -- name: Install docker-compose +- name: Install docker-compose utility apt: name: docker-compose -- name: Install docker-compose +- name: Install docker-compose python module pip: name: docker-compose diff --git a/tasks/main.yml b/tasks/main.yml index 856d689..7e9076c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,5 +1,6 @@ --- - import_tasks: install.yml +- import_tasks: config.yml - import_tasks: compose.yml - import_tasks: container.yml - import_tasks: firewall.yml