From a5e0959ddb9e457400601aefa2c7a6a752f3a1e0 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Sun, 13 Mar 2022 13:53:15 +0100 Subject: [PATCH] fix(makefile): improve makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add TAGS that will allow running specific parts of playbooks - rename ‹fedora-bootstrap› to ‹bootstrap›, since it's generic - introduce target for switching fedora repositories - with optional REMOTE variable Signed-off-by: Matej Focko --- Makefile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 79e0bed..39bb81d 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,29 @@ -.PHONY: deps fedora-deps fedora-bootstrap fedora-release-upgrade gpg keys +.PHONY: deps bootstrap fedora-deps fedora-release-upgrade fedora-switch-repository gpg keys CONNECTION ?= local INVENTORY ?= localhost +TAGS ?= all ANSIBLE_PYTHON := /usr/bin/python3 -AP := ansible-playbook -vv -K -c $(CONNECTION) -i $(INVENTORY), -e ansible_python_interpreter=$(ANSIBLE_PYTHON) +AP := ansible-playbook -vv -K -c $(CONNECTION) -i $(INVENTORY), -e ansible_python_interpreter=$(ANSIBLE_PYTHON) --tags $(TAGS) $(AP_ARGS) deps: ansible-galaxy collection install community.general +bootstrap: + $(AP) playbooks/bootstrap.yml + # Fedora fedora-deps: sudo dnf install -y ansible ansible-collection-community-general -fedora-bootstrap: - $(AP) playbooks/fedora.yml - fedora-release-upgrade: $(AP) playbooks/fedora_upgrade.yml +REMOTE ?= local +fedora-switch-repository: + $(AP) -e source=$(REMOTE) playbooks/fedora_repository.yml + # Scripts gpg: bash scripts/generate_gpg.sh @@ -26,5 +31,6 @@ gpg: keys: bash scripts/export_keys.sh +# Catch any other playbook %.yml: $(AP) $@