infra/ansible/Makefile
Graham McIntire 6f0d308fea
cleanup: remove forgejo, fix ssh key paths, fix tracking issues, update docs
- Remove forgejo role, play, group, host_vars, and DNS references
- Replace hardcoded /Users/graham/.ssh/ paths with env var lookup
- Remove broken setup-user Makefile target
- Add community.mysql collection to requirements.yml
- Add .ansible/ to .gitignore
- git rm --cached .DS_Store files and .vscode/settings.json
- Update CLAUDE.md and README.md to reflect actual state
- Add findings.md with audit results
2026-06-04 14:27:31 -05:00

70 lines
2.1 KiB
Makefile

ANSIBLE_CMD = ansible-playbook
build-local:
docker build -t docker.nsnw.ca/ansible:local .
build-latest:
docker build -t docker.nsnw.ca/ansible:latest .
run-local:
docker run --rm -it -e ANSIBLE_SETUP_OPTIONS -e SSH_PRIVATE_KEY -e ANSIBLE_OPTIONS -e SKIP_SETUP -e SKIP_PLAYBOOK -v ${PWD}/run/fact_cache:/app/fact_cache docker.nsnw.ca/ansible:local
run-local-shell:
docker run --rm -it -e ANSIBLE_SETUP_OPTIONS -e SSH_PRIVATE_KEY -e ANSIBLE_OPTIONS -e SKIP_SETUP -e SKIP_PLAYBOOK docker.nsnw.ca/ansible:local /bin/bash
run-latest:
docker run --rm -it -e ANSIBLE_SETUP_OPTIONS -e SSH_PRIVATE_KEY -e ANSIBLE_OPTIONS -e SKIP_SETUP -e SKIP_PLAYBOOK docker.nsnw.ca/ansible:latest
push-latest:
docker push docker.nsnw.ca/ansible:latest
clean:
rm -rfv tmp
dirs:
mkdir -pv tmp/fact_cache
chmod a+rxw tmp/fact_cache
base-latest: build-base-latest push-base-latest
base-local: build-base-local
latest: build-latest push-latest
local: dirs build-local run-local
facts:
ansible -m setup all
bootstrap-network:
$(ANSIBLE_CMD) -l $(HOSTNAME) -e ansible_host=$(ANSIBLE_HOST) -t network --skip-tags network_restart general.yml
bootstrap-reboot:
ssh -i ~/.ssh/ansible ansible@$(ANSIBLE_HOST) -t "sudo reboot" || true
bootstrap-init:
$(ANSIBLE_CMD) -l $(HOSTNAME) -e ansible_user=graham -e ansible_host=$(ANSIBLE_HOST) -k -K bootstrap.yml
bootstrap-init-root:
ANSIBLE_CONFIG=ansible-bootstrap.cfg $(ANSIBLE_CMD) -l $(HOSTNAME) -e ansible_user=root -e ansible_host=$(ANSIBLE_HOST) -e ansible_become=no bootstrap.yml
bootstrap: bootstrap-init bootstrap-network bootstrap-reboot
bootstrap-root: bootstrap-init-root bootstrap-network bootstrap-reboot
run-all:
$(ANSIBLE_CMD) -l $(HOSTNAME) -e ansible_host=$(ANSIBLE_HOST) general.yml
install-ssh-key:
ssh-copy-id $(ANSIBLE_HOST)
reboot:
ssh -i ~/.ssh/ansible ansible@$(ANSIBLE_HOST) -t "sudo reboot"
qc-web:
$(ANSIBLE_CMD) -l qc_web -t caddy general.yml
install-collections:
ansible-galaxy collection install -r requirements.yml --force
ansible-galaxy role install -r roles/requirements.yml --force
./scripts/fix-deprecated-imports.sh