infra-nimbus/ansible/mainnet.yml

125 lines
3.8 KiB
YAML

---
- name: 'Verify Ansible versions'
hosts: all
tags: always
become: false
run_once: true
gather_facts: false
tasks:
- local_action: command ./roles.py --check
changed_when: false
- name: Configure network mainnet bootnodes
become: true
serial: '{{ serial|default(1) }}'
hosts: 'nimbus-mainnet-small'
vars_files: layout/mainnet.yml
vars:
# WARNING: Since these are Eth 2 bootnodes we need to keep the keys and IPs unchanged.
beacon_node_netkey: '{{lookup("vault", "beacon-node/netkey", field=hostname)}}'
roles:
- { role: infra-role-swap-file, tags: [ swap-file ] }
- { role: infra-role-open-ports, tags: [ open-ports ] }
- { role: redirect-ports, tags: [ redirect-ports ] }
- { role: get-geth-api-urls, tags: [ get-geth-api-urls, beacon-node ] }
tasks:
- include_role:
name: infra-role-beacon-node-linux
apply: { tags: always }
tags: [ beacon-node ]
with_items: '{{ nodes_layout[inventory_hostname] }}'
loop_control:
loop_var: node
index_var: idx
- name: Deploy mainnet linux beacon nodes
become: true
serial: '{{ serial|default(1) }}'
hosts:
- nimbus-mainnet-geth
- nimbus-mainnet-erigon
- nimbus-mainnet-nec
vars_files: layout/mainnet.yml
vars:
# FIXME: Use all Geth nodes available in the fleet until we resync.
geth_node_api_fleet_names: ['nimbus.geth']
roles:
- { role: update-netplan, tags: [ update-netplan ], when: ansible_system == 'Linux' }
- { role: infra-role-swap-file, tags: [ swap-file ] }
- { role: infra-role-open-ports, tags: [ open-ports ] }
- { role: infra-role-smart-metrics, tags: [ smart-metrics ] }
- { role: redirect-ports, tags: [ redirect-ports ] }
- { role: get-geth-api-urls, tags: [ get-geth-api-urls, beacon-node ] }
- { role: nimbus-era-files, tags: [ nimbus-era-files ] }
tasks:
- include_role:
name: infra-role-beacon-node-linux
apply: { tags: always }
tags: [ beacon-node ]
with_items: '{{ nodes_layout[inventory_hostname] }}'
loop_control:
loop_var: node
index_var: idx
- name: Deploy Mainnet Geth Nodes
become: true
serial: '{{ serial|default(1) }}'
hosts: nimbus-mainnet-geth
vars_files: layout/mainnet.yml
tasks:
- include_role:
name: infra-role-geth
apply:
tags: always
tags: [ geth ]
when:
- "'el' in node"
- node.el == "geth"
with_items: '{{ nodes_layout[inventory_hostname] }}'
loop_control: { loop_var: node, index_var: idx }
- include_role:
name: infra-role-geth-exporter
apply:
tags: always
tags: [ geth-exporter ]
when:
- "'el' in node"
- node.el == "geth"
with_items: '{{ nodes_layout[inventory_hostname] }}'
loop_control: { loop_var: node, index_var: idx }
- name: Deploy Mainnet Erigon Nodes
become: true
serial: '{{ serial|default(1) }}'
hosts: nimbus-mainnet-erigon
vars_files: layout/mainnet.yml
tasks:
- include_role:
name: infra-role-erigon
apply:
tags: always
tags: [ erigon ]
when:
- "'el' in node"
- node.el == "erigon"
with_items: '{{ nodes_layout[inventory_hostname] }}'
loop_control: { loop_var: node, index_var: idx }
- name: Deploy Mainnet Nimbus ETH1 Nodes
become: true
serial: '{{ serial|default(1) }}'
hosts: nimbus-mainnet-nec
vars_files: layout/mainnet.yml
tasks:
- include_role:
name: infra-role-nimbus-eth1
apply:
tags: always
tags: [ nimbus-eth1 ]
when:
- "'el' in node"
- node.el == "nec"
with_items: '{{ nodes_layout[inventory_hostname] }}'
loop_control: { loop_var: node, index_var: idx }