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 6ae82c6 commit 9fce0e4
Show file tree
Hide file tree
Showing 6 changed files with 412 additions and 90 deletions.
15 changes: 9 additions & 6 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 Down
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/main.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 Waku Storage DB Nodes
Expand Down
10 changes: 0 additions & 10 deletions ansible/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
---
- name: infra-role-bootstrap-linux
src: [email protected]:status-im/infra-role-bootstrap-linux.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-consul-service
src: [email protected]:status-im/infra-role-consul-service.git
scm: git

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

- name: infra-role-nim-waku
src: [email protected]:status-im/infra-role-nim-waku.git
version: 0948fc8aa6c5738ca963d7faac2b203645d22afd
scm: git

- name: infra-role-certbot
src: [email protected]:status-im/infra-role-certbot.git
version: 17986a809058ce17ef45300365b268f3ed33a00a
scm: git

- name: infra-role-postgres-ha
src: [email protected]:status-im/infra-role-postgres-ha.git
version: 8d8b9fbbae27e42995cf8b1ed806787236639162
scm: git
Loading

0 comments on commit 9fce0e4

Please sign in to comment.