Jinja2 and Ansible - Ansible for DevOps: Server and configuration management for humans (2015)

Ansible for DevOps: Server and configuration management for humans (2015)

Appendix C - Jinja2 and Ansible

TODO:

· Jinja2 Docs

· Using Variables: About Jinja2

Summary

TODO.

Changelog

This log will track changes between releases of the book. Until version 1.0, each release number will correlate to the amount complete, so ‘Version 0.75’ equals 75% complete. After the final, complete book, major version numbers will track editions.

Hopefully these notes will help readers figure out what’s changed since the last time they’ve downloaded the book.

Version 0.94 (2015-05-16)

· Added information about Capistrano and blue-green deployments in chapter 9.

· Reorganized chapter 9 with an eye towards a 1.0 release.

· Merged chapter 12 into chapter 11 with an eye towards a 1.0 release.

· Fixed vagrant init command in chapter 2 (thanks to Ned Schumann!).

· Completed ‘Delegation, Local Actions, and Pauses’ section in chapter 5.

· Completed DigitalOcean dynamic inventory example in chapter 7.

· Fixed CentOS 6 vs 7 nomenclature in chapters 2 and 3 (thanks to @39digits and Alex Litvineko!).

· Completed Ansible Tower installation guide in chapter 11.

· Completed Ansible Tower usage guide and alternatives in chapter 11.

Version 0.92 (2015-04-09)

· Update Ansible project ‘stars’ count on GitHub in the introduction.

· Added zero-downtime multi-server deployment example to chapter 9.

· Removed frequent use of the filler word ‘simply’ (thanks to a reader’s suggestion!).

· Fixed language around ‘plays’ vs. ‘tasks’ in chapters 4, 5, and 6 (thanks to André!).

· Fixed ad-hoc Django installation in chapter 3 (thanks to @wimvandijck!).

Version 0.90 (2015-03-16)

· Tweaked requirements.txt explanation in chapter 8.

· Tweaked formatting of GlusterFS cookbook in chapter 6.

· Fixed GlusterFS example ports and mount task in chapter 8.

· Fixed some examples in chapter 4 to ensure apt repositories update cache.

· Fixed some typos in chapter 8 (thanks to Juan Martinez!).

· Updated Ansible installation instructions for Debian/Ubuntu in chapter 1.

· Corrected use of yum module in fail2ban example in chapter 10 (thanks to @lekum!).

· Fixed references to ansible.cfg config file in appendix b (thanks to @lekum!).

· Fixed DigitalOcean provisioning playbook in chapter 8 (thanks to @jonathanhle!).

· Adjusted DigitalOcean dynamic inventory example in chapter 7.

· Rewrote completely nonsensical sentence in chapter 7 (thanks to @dan_bohea!).

· Fixed some errors throughout the first few chapters (thanks to nesfel!).

· Fixed a couple errors in chapters 2 and 4 (thanks to Barry McClendon!).

Version 0.89 (2015-02-26)

· Completed first deployment example for Rails app in chapter 9.

· Added notes on role requirements.txt and requirements.yml options in chapter 6.

· Tweaked language and cleaned up examples for roles in chapter 6.

· Added GlusterFS cookbook to chapter 6.

Version 0.88 (2015-02-13)

· Fixed two errors in chapter 7 (thanks to Jonathan Le / @jonathanhle!)

· Wrote introduction to chapter 9.

· Wrote first deployment example for Rails app in chapter 9.

Version 0.87 (2015-02-01)

· Cleaned up Docker examples in chapter 8.

· Fixed a typo in chapter 3 (thanks to Jonathan Le / @jonathanhle!)

· Added section on configuring firewalls with ufw and firewalld in chapter 10.

· Updated Apache Solr version in chapter 4 example.

· Fixed APC uploadprogress task in Drupal example in chapter 4.

· Added section on installing and configuring Fail2Ban in chapter 10.

· Added suggestion for setting ANSIBLE_HOSTS environment variable in chapter 3 (thanks to Jason Baker / @diermakeralch!).

· Added section on SELinux and AppArmor in chapter 10.

· Completed chapter 10.

Version 0.84 (2015-01-27)

· Added Docker introduction and cookbooks in chapter 8.

Version 0.81 (2015-01-11)

· Fixed Vagrantfile examples to work with Vagrant 1.7.x.

· Added local Mac configuration example in chapter 8.

· Used name instead of pkg for packaging modules as per updated Ansible style guide.

· Incorporated editorial changes for introduction, chapter 1, chapter 2, and chapter 3.

· Fixed references to Vagrant Cloud/HashiCorp’s Atlas.

· Finished almost all the rest of chapter 5.

Version 0.75 (2014-12-23)

· Fixed code formatting in examples in chapter 8.

· Added YAML | multiline variable delimiter example to appendix b.

· Edited and updated examples and guide for HA Infrastructure in chapter 8.

· Completed the ELK and Logstash Forwarder examples in chapter 8.

· Started on the Mac provisioning example in chapter 8.

Version 0.73 (2014-12-09)

· Added wait_for to DigitalOcean example in chapter 7.

· Completed Hightly-Available Infrastructure cookbook in chapter 8.

· Began work on ELK log monitoring cookbook in chapter 8.

· Fixed a few typos in chapters 5 and 6 (thanks to George Boobyer / @ibluebag!).

· Incorporated edits in preface from technical editor.

Version 0.71 (2014-11-27)

· Added Highly-Available Infrastructure cookbook to chapter 8.

· Updated screenshots throughout the book.

· Began incorporating changes from copy editor (more to come!).

Version 0.70 (2014-11-16)

· Coverted Testing/CI section into its own chapter.

· Added cowsay to chapter 12.

· Removed glossary (and pointed readers directly to Ansible’s very helpful glossary).

· Added missing link in chapter 7.

· Converted chapter 8 from “Ansible Modules” to “Ansible Cookbooks” due to reader interest.

· Cleaned up Vagrantfile in chapter 3, as well as throughout ansible-for-devops git repo.

· Added “Web Architecture Example” example to ansible-for-devops git repo.

· Built structure of chapter 8 (“Ansible Cookbooks”).

· Added cowsay to chapter 8.

· Added information about add_host and group_by to chapter 7.

· Reworked sections in chapter 12 and fixed a few problems.

Version 0.64 (2014-10-24)

· Added Server Check.in architecture diagram (chapter 7).

· Wrote about host_vars, group_vars, and dynamic inventory (chapter 7).

· Added Digital Ocean provisioning and dynamic inventory walkthrough (chapter 7).

Version 0.62 (2014-10-07)

· Wrote a good deal of chapter 7 (Inventories).

· Cleaned up code examples to follow updated best practices in appendix b.

· Updated installation instructions to use Ansible’s official PPA for Ubuntu (thanks to Rohit Bhute!).

Version 0.60 (2014-09-30)

· Wrote most of appendix b (Best Practices).

· Updated definition of idempotence in chapter 1.

· Fixed a few LeanPub-related code formatting issues.

· Many grammar fixes throughout the book (thanks to Jon Forrest!).

· Some spelling and ad-hoc command fixes (thanks to Hugo Posca!).

· Had a baby (thus the dearth of updates from 8/1-10/1 :-).

· Wrote introduction and basic structure of chapter 11 (Ansible Tower).

Version 0.58 (2014-08-01)

· Even more sections on variables in chapter 5 (almost finished!).

· Fixed a few old Ansible and Drupal version references.

· Added a playbook include tag example in chapter 6.

· Completed first draft of chapter 6.

· Fixed broken handler in chapter 4’s Tomcat handler (thanks to Joel Shprentz!).

· Fixed a missing closing quotation in chapter 3 example (thanks to Jonathan Nakatsui!).

Version 0.56 (2014-07-20)

· Filled in many more sections on variables in chapter 5.

· Some editing in chapter 6.

· Side work on some supplemental material for a potential chapter on Docker.

Version 0.54 (2014-07-02)

· Finished roles section in chapter 6.

· Fixed a few code examples for better style in chapter 4.

· Fixed references to official code repository in chapters 4 and 6.

Version 0.53 (2014-06-28)

· Added note about Windows Support in appendix a.

· Wrote large portion of roles section in chapter 6.

Version 0.52 (2014-06-14)

· Adjusted some code listings to make more readable line breaks.

· Added section on Ansible testing with Travis CI in chapter 12.

· Expanded mention of Ansible’s excellent documentation in introduction.

· Greatly expanded security coverage in chapter 10.

· Added link to security role on Ansible Galaxy in chapter 10.

Version 0.50 (2014-05-05)

· Wrote includes section in chapter 6.

· Added links to code repository examples in chapters 4 and 6.

· Fixed broken internal links.

· Fixed typos in chapter 10.

· Added note about --force-handlers (new in Ansible 1.6) in chapter 4.

· Use Ansible’s apache2_module module for LAMP example in chapter 4.

· Moved Jinja2 chapter to appendix c.

· Removed ‘Variables’ chapter (variables will be covered in-depth elsewhere).

· Added Appendix B - Ansible Best Practices and Conventions.

· Started tagging code in Ansible for DevOps GitHub repository to match manuscript version (starting with this version, 0.50).

· Fixed various layout issues.

Version 0.49 (2014-04-24)

· Completed history of SSH in chapter 10.

· Clarified definition of the word ‘DevOps’ in chapter 1.

· Added section “Testing Ansible Playbooks” in chapter 14.

· Added links to Ansible for DevOps GitHub repository in the introduction and chapter 4.

Version 0.47 (2014-04-13)

· Added Apache Solr example in chapter 4.

· Updated VM diagrams in chapter 4.

· Added information about ansible-playbook command in chapter 4 (thanks to a reader’s suggestion!).

· Clarified code example in preface.

Version 0.44 (2014-04-04)

· Expanded chapter 10 (security).

· Fixed formatting issues in Warning/Info/Tip asides.

· Fixed formatting of some code examples to prevent line wrapping.

· Added section on Ansible Galaxy in chapter 6.

· Updated installation section in chapter 1 with simplified install processes.

· Added warnings concerning faster SSH in Ansible 1.5+ (thanks to @LeeVanSteerthem).

Version 0.42 (2014-03-25)

· Added history of SSH section.

· Expanded chapter 10 (security).

· Many small spelling and grammar mistakes corrected.

· Fixed formatting of info/warning/tip asides.

Version 0.38 (2014-03-11)

· Added Appendix A - Using Ansible on Windows workstations (thanks to a reader’s suggestion!).

· Updated chapter 1 to include a reference to appendix a.

· Clarified and expanded installation instructions for Mac and Linux in chapter 1.

· Added chapter 10 - Server Security and Ansible

· Updated chapter 1 to include a reference to chapter 10.

· Added notes and TODOs to a few more areas of the book (random).

Version 0.35 (2014-02-25)

· Added this changelog.

· Split out roles and playbook organization into its own chapter.

· Expanded ‘Environment Variables’ section in chapter 5.

· Expanded ‘Variables’ section in chapter 5.

· MORE COWBELL! (Cowsay motivational quotes at the end of every completed chapter).

· Fixed NTP installation examples in chapter 2 (thanks to a reader’s suggestion!).

Version 0.33 (2014-02-20)

· Initial published release, up to chapter 4, part of chapter 5.