Last active
November 1, 2022 19:29
-
-
Save Kaezon/574b7cc428bc06b908925e2c2d12ddfd to your computer and use it in GitHub Desktop.
AWX Operator - Debug Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This play will render a specified template file and output it | |
# | |
# Note: Templates which include other templates will require this playbook to be place in their respective | |
# template directories due to the use of relative paths in those templates. | |
# Note: You will also likely need to include appropriate default vars files for the template with the '-e' directive | |
# Note: Depending on the template, you may still need to add some extra vars to satisfy the template's needs. | |
# | |
# Invokation example: | |
# ansible-playbook debug-template.yaml -e template_path=/opt/ansible/roles/installer/templates/configmaps/config.yaml.j2 -e @/opt/ansible/roles/installer/defaults/main.yml | |
--- | |
- name: Debug Play | |
hosts: localhost | |
connection: local | |
vars_files: | |
- /opt/ansible/roles/backup/vars/main.yml | |
- /opt/ansible/roles/installer/vars/main.yml | |
- /opt/ansible/roles/restore/vars/main.yml | |
- /opt/ansible/playbooks/debug-vars.yaml | |
tasks: | |
- name: Render template | |
vars: | |
rendered_template: "{{lookup('template', template_path)}}" | |
ansible.builtin.debug: | |
msg: "{{ rendered_template.split('\n') }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
ansible_operator_meta: | |
name: awx | |
namespace: awx | |
service_type: nodeport |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment