--- - name: Geth | Create the container docker_container: name: '{{ geth_cont_name }}' image: '{{ geth_cont_image }}' user: root pull: true restart_policy: '{{ cont_restart_policy }}' state: '{{ cont_state }}' recreate: '{{ cont_recreate }}' restart: '{{ cont_restart }}' # some limits due to statusd hogging resources memory: '{{ cont_mem_limit }}m' memory_swap: '{{ cont_swap_limit }}m' ports: - '{{ geth_port }}:{{ geth_port }}/tcp' - '{{ geth_port }}:{{ geth_port }}/udp' - '{{ geth_rpc_addr }}:{{ geth_rpc_port }}:{{ geth_rpc_port }}' command: | {% if geth_network_name in ("ropsten", "testnet") %} --testnet {% elif geth_network_name == "rinkeby" %} --rinkeby {% elif geth_network_name == "goerli" %} --goerli {% endif %} {% if geth_v5disc_enabled %} --v5disc {% endif %} --syncmode={{ geth_sync_mode }} {% if geth_sync_mode != 'light' %} --light.serve={{ geth_light_serv }} {% endif %} {% if geth_miner_enabled %} --mine --miner.threads="{{ geth_miner_threads }}" --miner.etherbase="{{ geth_miner_account | mandatory }}" {% endif %} {% if geth_whisper_enabled %} --shh --shh.pow={{ geth_whisper_pow }} {% endif %} {% if geth_metrics_enabled %} --metrics {% endif %} --nousb --extradata={{ geth_extra_data }} --verbosity={{ geth_log_level_id }} --cache={{ geth_cache }} --maxpeers={{ geth_max_peers }} --maxpendpeers="{{ geth_max_pend_peers }}" --port={{ geth_port }} --nat=extip:{{ geth_public_addr }} --unlock={{ geth_account_addr }} --allow-insecure-unlock --datadir=/data --password=/keys/account.pass --keystore=/keys --rpc --rpcaddr=0.0.0.0 --rpcport={{ geth_rpc_port }} --rpcvhosts={{ geth_aliases | join(",") }} --rpcapi={{ geth_rcp_api }} --ipcpath={{ geth_ipc_path }} volumes: - '{{ geth_cont_vol }}/keys:/keys:rw' # WARNING: This assumes /data is mounted, see bootstrap role - '{{ geth_data_path }}:/data:rw'