Skip to content

Commit

Permalink
ansible: add roles.py script to manage roles
Browse files Browse the repository at this point in the history
status-im/infra-template#5
Signed-off-by: Jakub Sokołowski <[email protected]>
  • Loading branch information
jakubgs committed Jun 13, 2024
1 parent f8c1221 commit eca6fc2
Show file tree
Hide file tree
Showing 13 changed files with 419 additions and 122 deletions.
21 changes: 9 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@ PROVISIONER_ARCHIVE = $(PROVISIONER_NAME)-$(subst _,-,$(ARCH))_$(PROVISIONER_VER
PROVISIONER_URL = https://github.com/radekg/terraform-provisioner-ansible/releases/download/$(PROVISIONER_VERSION)/$(PROVISIONER_ARCHIVE)
PROVISIONER_PATH = $(TF_PLUGINS_DIR)/$(ARCH)/$(PROVISIONER_NAME)_$(PROVISIONER_VERSION)

all: requirements install-provisioner secrets init-terraform
all: roles-install install-provisioner secrets init-terraform
@echo "Success!"

requirements-install:
ansible-galaxy install --keep-scm-meta --ignore-errors --force -r ansible/requirements.yml
roles-install:
ansible/roles.py --install

requirements-check:
ansible/versioncheck.py
roles-check:
ansible/roles.py --check

requirements: requirements-install requirements-check
roles-update:
ansible/roles.py --update

roles: roles-install roles-check

$(PROVISIONER_PATH):
@mkdir -p $(TF_PLUGINS_DIR)/$(ARCH); \
Expand All @@ -46,9 +49,3 @@ init-terraform:

cleanup:
rm -r $(TF_PLUGINS_DIR)/$(ARCHIVE)

ssh-config: export SSH_CONFIG_DIR ?= $(HOME)/.ssh/config.d
ssh-config: export SSH_CONFIG_FILE ?= infra-nimbus
ssh-config: export SSH_USERNAME ?= $(USER)
ssh-config:
scripts/create-ssh-config.sh
2 changes: 1 addition & 1 deletion ansible/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
run_once: true
gather_facts: false
tasks:
- local_action: command ./versioncheck.py
- local_action: command ./roles.py --check
changed_when: false

- name: Bootstrap Python support for Ansible
Expand Down
2 changes: 1 addition & 1 deletion ansible/era.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
run_once: true
gather_facts: false
tasks:
- local_action: command ./versioncheck.py
- local_action: command ./roles.py --check
changed_when: false

- name: Configure ERA files hosting
Expand Down
2 changes: 1 addition & 1 deletion ansible/eth1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
run_once: true
gather_facts: false
tasks:
- local_action: command ./versioncheck.py
- local_action: command ./roles.py --check
changed_when: false

- name: Configure RocketPool & Eth1 nodes
Expand Down
2 changes: 1 addition & 1 deletion ansible/fluffy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
run_once: true
gather_facts: false
tasks:
- local_action: command ./versioncheck.py
- local_action: command ./roles.py --check
changed_when: false

- name: Configure Nimbus Fluffy nodes
Expand Down
2 changes: 1 addition & 1 deletion ansible/geth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
run_once: true
gather_facts: false
tasks:
- local_action: command ./versioncheck.py
- local_action: command ./roles.py --check
changed_when: false

- name: Configure geth nodes
Expand Down
2 changes: 1 addition & 1 deletion ansible/holesky.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
run_once: true
gather_facts: false
tasks:
- local_action: command ./versioncheck.py
- local_action: command ./roles.py --check
changed_when: false

- name: Deploy Holesky Linux Beacon Nodes
Expand Down
2 changes: 1 addition & 1 deletion ansible/logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
run_once: true
gather_facts: false
tasks:
- local_action: command ./versioncheck.py
- local_action: command ./roles.py --check
changed_when: false

- name: Configure ElasticSearch servers
Expand Down
2 changes: 1 addition & 1 deletion ansible/mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
run_once: true
gather_facts: false
tasks:
- local_action: command ./versioncheck.py
- local_action: command ./roles.py --check
changed_when: false

- name: Configure network mainnet bootnodes
Expand Down
30 changes: 0 additions & 30 deletions ansible/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,139 +1,109 @@
---
- name: infra-role-bootstrap-linux
src: [email protected]:status-im/infra-role-bootstrap-linux.git
scm: git

- name: infra-role-bootstrap-windows
src: [email protected]:status-im/infra-role-bootstrap-windows.git
scm: git

- name: infra-role-bootstrap-macos
src: [email protected]:status-im/infra-role-bootstrap-macos.git
scm: git

- name: infra-role-wireguard
src: [email protected]:status-im/infra-role-wireguard.git
scm: git

- name: infra-role-open-ports
src: [email protected]:status-im/infra-role-open-ports.git
scm: git

- name: infra-role-swap-file
src: [email protected]:status-im/infra-role-swap-file.git
scm: git

- name: infra-role-nginx
src: [email protected]:status-im/infra-role-nginx.git
version: 3043c998cbc92a634a71dc48363b3e2525696d26
scm: git

- name: infra-role-origin-certs
src: [email protected]:status-im/infra-role-origin-certs.git
version: f2b061da8976444d6576b755578f0e799cde4372
scm: git

- name: infra-role-oauth-proxy
src: [email protected]:status-im/infra-role-oauth-proxy.git
version: 9119f7af1feb809b28fcf68ce044795affe1aa76
scm: git

- name: infra-role-consul-service
src: [email protected]:status-im/infra-role-consul-service.git
version: d62993069bd045edade5d5fd90c098655089db85
scm: git

- name: infra-role-beacon-node-linux
src: [email protected]:status-im/infra-role-beacon-node-linux.git
version: c2ba324a5b442b6e46e2bdf4746320e8e8a24579
scm: git

- name: infra-role-beacon-node-windows
src: [email protected]:status-im/infra-role-beacon-node-windows.git
version: ebfece8f56ef18ba6dbb413778fbf7f56de06683
scm: git

- name: infra-role-beacon-node-macos
src: [email protected]:status-im/infra-role-beacon-node-macos.git
version: f1411a2f0dfc3f2b35cdcda618cd81766a22e4e7
scm: git

- name: infra-role-validator-client
src: [email protected]:status-im/infra-role-validator-client.git
version: aaf86e765ab8024bcc359e26d72f7767dc24ab3d
scm: git

- name: infra-role-nimbus-eth1
src: [email protected]:status-im/infra-role-nimbus-eth1.git
version: f4dfbb31eea9a1fa1fed575749723f9576844c84
scm: git

- name: infra-role-nimbus-fluffy
src: [email protected]:status-im/infra-role-nimbus-fluffy.git
version: 164cd9b1f8bf18cdcc3cce7be43e73743394adaf
scm: git

- name: infra-role-dist-validators
src: [email protected]:status-im/infra-role-dist-validators.git
version: 95a5de787aef58712121d2ac6c0bd97b6948baec
scm: git

- name: infra-role-rocketpool
src: [email protected]:status-im/infra-role-rocketpool.git
version: ab6834c7d291c9bf115a8e106afc83246bf803ae
scm: git

- name: infra-role-winsw
src: [email protected]:status-im/infra-role-winsw.git
version: 93c8a5b5ac091a128efe937c028b548751295297
scm: git

- name: infra-role-kibana
src: [email protected]:status-im/infra-role-kibana.git
version: ccc1c3a41d2ea2f125db9a3418e447958c72bfce
scm: git

- name: infra-role-elasticsearch
src: [email protected]:status-im/infra-role-elasticsearch.git
version: 1e86928b7848ab5520ead99a5f1432770af4fc22
scm: git

- name: infra-role-elasticsearch-lb
src: [email protected]:status-im/infra-role-elasticsearch-lb.git
version: 5ff5e5d526e38a7faf1ff7dfb809c6b6e5bdc17a
scm: git

- name: infra-role-systemd-timer
src: [email protected]:status-im/infra-role-systemd-timer.git
version: 9bbb72fe9df7379c5c63cfe9f144efa30ed828d9
scm: git

- name: infra-role-launchd-timer
src: [email protected]:status-im/infra-role-launchd-timer.git
version: 791174a9de57ffbbb4d60cdde05d74a66415f1bd
scm: git

- name: infra-role-geth
src: [email protected]:status-im/infra-role-geth.git
version: cd4fd6403549673e86047c10e2289cb6d34a4e20
scm: git

- name: infra-role-geth-exporter
src: [email protected]:status-im/infra-role-geth-exporter.git
version: c129dc06a407b153371c1467e5293b7ebaca04ab
scm: git

- name: infra-role-erigon
src: [email protected]:status-im/infra-role-erigon.git
version: 8568c7c0b8fefe85bad9a704d0e4d56f9c628631
scm: git

- name: infra-role-nethermind
src: [email protected]:status-im/infra-role-nethermind.git
version: c014302215821b0b7df07947a1259027b60a614e
scm: git

- name: infra-role-smart-metrics
src: [email protected]:status-im/infra-role-smart-metrics.git
version: 76aba3c459e6c5e8afc6979dd9532c8cea0fbeea
scm: git
Loading

0 comments on commit eca6fc2

Please sign in to comment.