homelab/.justfile

44 lines
1.2 KiB
Makefile

# Repo management tasks
mod repo '.devfiles/justfile'
export ANSIBLE_VAULT_PASSWORD_FILE := justfile_directory() + "/.decrypt-pass.txt"
export ANSIBLE_BECOME_PASSWORD_FILE := justfile_directory() + "/.become-pass.txt"
# Debug output, disabled in CI
export ANSIBLE_DISPLAY_ARGS_TO_STDOUT := if env('CI', '') == 'true' { 'false' } else { 'true' }
# export ANSIBLE_ENABLE_TASK_DEBUGGER := if env('CI', '') == 'true' { 'false' } else { 'true' }
play +ARGS:
uv run ansible-playbook {{ ARGS }}
deploy-services: (play "./playbooks/docker/services.yaml")
ansible +ARGS:
uv run ansible {{ ARGS }}
list-host:
uv run ansible-inventory --list
[no-cd]
encrypt-file +ARGS:
uv run ansible-vault encrypt {{ ARGS }}
encrypt-var NAME +CONTENT='':
uv run ansible-vault encrypt_string {{ if CONTENT != "" { "--name" } else { "--stdin-name" } }} {{ NAME }} {{ CONTENT }}
decrypt-var FILE NAME:
uv run ansible localhost -m ansible.builtin.debug -e "@{{ FILE }}" -a var="{{ NAME }}"
[no-cd]
decrypt-file +ARGS:
uv run ansible-vault edit {{ ARGS }}
[no-cd]
decrypt-store +ARGS:
uv run ansible-vault decrypt {{ ARGS }}
[no-cd]
tofu +ARGS:
tofu {{ ARGS }}