-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (30 loc) Β· 1.5 KB
/
Copy pathMakefile
File metadata and controls
39 lines (30 loc) Β· 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
INVENTORY=inventory.yaml
PLAYBOOK=main.yaml
EXTRA_VARS="configure=true update=true"
TAGS=""
.PHONY: help install run tags clean debug
help:
@echo "Available commands:"
@echo " make install - Install Ansible dependencies (ansible-galaxy)."
@echo " make run - Run the playbook with default options."
@echo " make tags=<tags> - Run with specific tags, e.g., make tags='cli,gui'"
@echo " make clean - Remove generated files or temporary state."
@echo " make debug - Run with debug mode (verbose output)."
install:
@echo "π§ Installing Ansible roles from requirements.yaml"
@ansible-galaxy install -r requirements.yaml
run:
@echo "π Running full playbook with default options"
@ansible-playbook $(PLAYBOOK) --inventory $(INVENTORY) --ask-become-pass --extra-vars $(EXTRA_VARS)
tags:
@echo "π·οΈ Running playbook with tags: $(TAGS)"
@ansible-playbook $(PLAYBOOK) --inventory $(INVENTORY) --ask-become-pass --extra-vars $(EXTRA_VARS) --tags "$(TAGS)"
update:
@echo "π Running playbook with update=true"
@ansible-playbook $(PLAYBOOK) --inventory $(INVENTORY) --ask-become-pass --extra-vars update=true
configure:
@echo "π Running playbook with configure=true"
@ansible-playbook $(PLAYBOOK) --inventory $(INVENTORY) --ask-become-pass --extra-vars configure=true
debug:
@echo "π Running in debug mode with extra verbosity and debug=true"
@ansible-playbook $(PLAYBOOK) --inventory $(INVENTORY) --ask-become-pass -vvvv --extra-vars '$(EXTRA_VARS) debug=true'