Skip to content

Instantly share code, notes, and snippets.

@proditis
Created April 12, 2022 10:37
Show Gist options
  • Save proditis/2c251dd94588433c04778cb4506002e8 to your computer and use it in GitHub Desktop.
Save proditis/2c251dd94588433c04778cb4506002e8 to your computer and use it in GitHub Desktop.
A standalone playbook to process jinja templates. Download `chmod +x` and run
#!/usr/bin/env ansible-playbook
# Stand-alone jinja2 template parser script
# usage:
# atemplate -e TEMPLATE_SOURCE=/source/file -e TEMPLATE_DESTINATION=/destination/file -e template_var1=value1
#
---
- name: Process Jinja2 Template
connection: local
gather_facts: false
tasks:
- template:
src: "{{TEMPLATE_SOURCE}}"
dest: "{{TEMPLATE_DESTINATION}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment