Skip to content

Commit

Permalink
feat: update geth tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
willianpaixao committed Mar 3, 2024
1 parent dc4d699 commit 3376964
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 25 deletions.
1 change: 1 addition & 0 deletions inventory/hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ all:
logos:
mjolnir:
mnemosyne:
vishnu:
amd64:
hosts:
dozer:
Expand Down
2 changes: 1 addition & 1 deletion playbooks/group_vars/geth/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
# file: group_vars/geth/main.yml

geth_version: 1.11.5-a38f4108
geth_version: 1.13.14-2bd6bd01
2 changes: 1 addition & 1 deletion playbooks/roles/geth/files/beacon-chain.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ After=syslog.target network.target
User=prysm
Group=prysm
Type=simple
ExecStart=/usr/local/bin/beacon-chain --execution-endpoint=http://localhost:8551 --prater --datadir=/var/lib/prysm --jwt-secret=/var/lib/prysm/jwtsecret --monitoring-host 0.0.0.0 --accept-terms-of-use
ExecStart=/usr/local/bin/beacon-chain --execution-endpoint=http://localhost:8551 --holesky --datadir=/var/lib/prysm --jwt-secret=/var/lib/prysm/jwtsecret --monitoring-host 0.0.0.0 --accept-terms-of-use
Nice=10
KillMode=process
KillSignal=SIGINT
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/geth/files/geth.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ After=syslog.target network.target
User=geth
Group=geth
Type=simple
ExecStart=/usr/local/bin/geth --datadir /var/lib/geth --identity mjolnir --http --http.addr 0.0.0.0 --http.api eth,net,engine,admin --metrics --metrics.addr 0.0.0.0 --goerli --authrpc.jwtsecret /var/lib/geth/geth/jwtsecret
ExecStart=/usr/local/bin/geth --datadir /var/lib/geth --identity mjolnir --http --http.addr 0.0.0.0 --http.api eth,net,engine,admin --metrics --metrics.addr 0.0.0.0 --holesky --authrpc.jwtsecret /var/lib/geth/geth/jwtsecret
Nice=10
KillMode=process
KillSignal=SIGINT
Expand Down
31 changes: 13 additions & 18 deletions playbooks/roles/geth/tasks/geth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,38 @@

- name: "[{{ ansible_architecture }}] Download Geth"
ansible.builtin.unarchive:
src: https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-{{ geth_version }}.tar.gz
dest: /usr/local/bin
src: https://gethstore.blob.core.windows.net/builds/geth-linux-arm64-{{ geth_version }}.tar.gz
dest: /tmp
remote_src: yes
when: ansible_architecture == 'x86_64'
when: ansible_architecture == "aarch64"

- name: "[{{ ansible_architecture }}] Download Geth"
ansible.builtin.unarchive:
src: https://gethstore.blob.core.windows.net/builds/geth-alltools-linux-arm64-{{ geth_version }}.tar.gz
dest: /usr/local/bin
- name: Copy geth binary
ansible.builtin.copy:
src: /tmp/geth-linux-arm64-{{ geth_version }}/geth
dest: /usr/local/bin/geth
remote_src: yes
when: ansible_architecture == "aarch64"
owner: root
group: root
mode: '0755'

- name: Create data directory for geth
file:
ansible.builtin.file:
path: /var/lib/geth
owner: geth
group: geth
state: directory
mode: '0755'

- name: Copy systemd file for geth service
copy:
ansible.builtin.copy:
src: geth.service
dest: /lib/systemd/system/geth.service
owner: root
group: root
mode: '0644'

- name: Install pcscd
package:
ansible.builtin.package:
update_cache: yes
name: pcscd
state: present
Expand All @@ -59,10 +61,3 @@
ansible.builtin.service:
name: geth
state: started

- name: Allow access to port 30303
community.general.ufw:
rule: allow
port: '30303'
proto: tcp
when: ansible_facts['distribution'] == "Ubuntu"
19 changes: 17 additions & 2 deletions playbooks/roles/geth/tasks/prysm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,21 @@

- name: "[{{ ansible_architecture }}] Download Prysm - beacon-chain"
ansible.builtin.get_url:
url: https://github.com/prysmaticlabs/prysm/releases/download/v4.0.2/beacon-chain-v4.0.2-linux-arm64
url: https://github.com/prysmaticlabs/prysm/releases/download/v5.0.0/beacon-chain-v5.0.0-linux-arm64
dest: /usr/local/bin/beacon-chain
mode: '0755'
when: ansible_architecture == "aarch64"

- name: "[{{ ansible_architecture }}] Download Prysm - client-stats"
ansible.builtin.get_url:
url: https://github.com/prysmaticlabs/prysm/releases/download/v5.0.0/client-stats-v5.0.0-linux-arm64
dest: /usr/local/bin/client-stats
mode: '0755'
when: ansible_architecture == "aarch64"

- name: "Download Prysm - genesis state"
ansible.builtin.get_url:
url: https://github.com/eth-clients/eth2-networks/raw/master/shared/prater/genesis.ssz
url: https://github.com/eth-clients/holesky/raw/main/custom_config_data/genesis.ssz
dest: /var/lib/prysm/
owner: prysm
group: prysm
Expand Down Expand Up @@ -63,3 +70,11 @@
ansible.builtin.service:
name: beacon-chain
state: started

- name: Allow access to port 8080

Check failure on line 74 in playbooks/roles/geth/tasks/prysm.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

syntax-check[specific]

couldn't resolve module/action 'community.general.ufw'. This often indicates a misspelling, missing collection, or incorrect module path.
community.general.ufw:
rule: allow
port: '8080'
proto: tcp
when: ansible_facts['distribution'] == "Ubuntu"
tags: ufw
2 changes: 1 addition & 1 deletion playbooks/roles/prometheus/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

alertmanager_version: 0.21.0
blackbox_exporter_version: 0.20.0
node_exporter_version: 1.5.0
node_exporter_version: 1.7.0
prometheus_version: 2.22.2
2 changes: 1 addition & 1 deletion playbooks/roles/prometheus/tasks/node-exporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
remote_src: yes
when: ansible_architecture == 'x86_64'

- name: Move node-exporter binary to PATH
- name: "[{{ ansible_architecture }}] Move node-exporter binary to PATH"
ansible.builtin.copy:
src: '/tmp/node_exporter-{{ node_exporter_version }}.linux-arm64/node_exporter'
dest: '/usr/local/bin/node_exporter'
Expand Down

0 comments on commit 3376964

Please sign in to comment.