Skip to content

jeremyschulman/py-demo-simple-template

Repository files navigation

Template Rendering 101

This repo contains very simple demos that illustrates the bare-basics needed to load a YAML data file and render it with a Jinja2 template. The "subject matter" was taken from a blog post by Ethan Banks, here.

Be sure to read more from Ethan on his blog site, The Peering Introvert and on Packet Pushers.

Python Script Usage

user@linux> python demo_render.py

output looks like this.

Ansible Playbook Usage

[jeremy@linux]$ ansible-playbook ansible.pb.yml 

PLAY [simple template render] ************************************************* 

TASK: [build demo_render.conf] ************************************************ 
changed: [localhost]

PLAY RECAP ******************************************************************** 
localhost                  : ok=1    changed=1    unreachable=0    failed=0   

creates file demo_render.conf.

Further Reading

About

Demonstrating simple template render using Python or Ansible

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages