feat: replace ansible templating with makejinja (#1156)

This commit is contained in:
Devin Buhl authored and GitHub committed 2024-01-14 23:03:02 -05:00
1 parent a4731906d9
commit f9481d6202
114 files changed
+555 -906

No files matched your search

+28 -1
View File
@@ -47,6 +47,33 @@ tasks:
configure:
desc: Configure repository from Ansible vars
prompt: Any conflicting config in the root kubernetes and ansible directories will be overwritten... continue?
cmd: ./.venv/bin/ansible-playbook {{.BOOTSTRAP_DIR}}/configure.yaml
cmds:
- task: .validate
- task: .template
- task: sops:encrypt:all
.validate:
internal: true
cmd: ./.venv/bin/ansible-playbook {{.BOOTSTRAP_DIR}}/validate.yaml
env:
ANSIBLE_DISPLAY_SKIPPED_HOSTS: "false"
preconditions:
- { msg: "addons file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/addons.yaml" }
- { msg: "config file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/config.yaml" }
.template:
internal: true
cmds:
- ./.venv/bin/makejinja
--input "{{.BOOTSTRAP_DIR}}/templates"
--output "{{.ROOT_DIR}}"
--data "{{.BOOTSTRAP_DIR}}/vars/config.yaml"
--data "{{.BOOTSTRAP_DIR}}/vars/addons.yaml"
--import-path "{{.BOOTSTRAP_DIR}}/scripts"
--loader "loader:Loader"
--jinja-suffix ".j2" --quiet --force
- find {{.ANSIBLE_DIR}} {{.KUBERNETES_DIR}} -type d -empty -delete
preconditions:
- { msg: "addons file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/addons.yaml" }
- { msg: "config file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/vars/config.yaml" }
- { msg: "loader file not found", sh: "test -f {{.BOOTSTRAP_DIR}}/scripts/loader.py" }