-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (22 loc) · 851 Bytes
/
Makefile
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
# Makefile for ansible execution environments using ansible-runner
# export RUNTIME=docker to override
RUNTIME ?= podman
BASE_NAME=ansible-runner
ANSIBLE_RUNNER_IMAGE=quay.io/ansible/ansible-runner:stable-2.12-latest
.PHONY standalone:
standalone:
ansible-runner run playbooks -p playbook.yml
.PHONY python_interface:
python_interface:
./play.py
.PHONY build:
build:
ansible-builder build --build-arg ANSIBLE_RUNNER_IMAGE=${ANSIBLE_RUNNER_IMAGE} -t ${BASE_NAME} -c context --container-runtime ${RUNTIME}
.PHONY bash:
bash:
${RUNTIME} run --rm --network=host -ti -v${HOME}/.ssh:/root/.ssh -v ${PWD}/playbooks:/runner ${BASE_NAME} bash
.PHONY run:
run:
${RUNTIME} run --rm --network=host -ti -v${HOME}/.ssh:/root/.ssh -v ${PWD}/playbooks:/runner -e RUNNER_PLAYBOOK=playbook.yml ${BASE_NAME}
clean:
rm -rf .venv context playbooks/artifacts/*