Skip to content

Instantly share code, notes, and snippets.

@BrianAker
Created March 4, 2016 12:28
Show Gist options
  • Select an option

  • Save BrianAker/1356a19479b984e48cc6 to your computer and use it in GitHub Desktop.

Select an option

Save BrianAker/1356a19479b984e48cc6 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ANSIBLE_HOSTS="localhost," ansible-playbook
#
# Huh?
# Often I want to render a template but I don't really want to deal with all
# of ansible. So this is command line tool for generating and install a
# jinja template using ansible. No inventory file is required.
#
# Example:
# SRC=./templates/curlrc.j2 DEST=~/.curlrc ./template.yaml
#
---
- name: template expander
hosts: localhost
connection: local
no_log: True
tasks:
- template:
src: "{{ ansible_env.SRC }}"
dest: "{{ ansible_env.DEST }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment