# Ansible Performance - Moving to Jinja2 for Automated Documentation

DevFeed: [Ansible Performance - Moving to Jinja2 for Automated Documentation](<https://devfeed.tech/articles/ansible-performance-moving-to-jinja2-for-automated-documentation-60831.md>)

Original publisher: [Read original article](<https://automateyournetwork.com/blogs/ansible-performance-moving-to-jinja2-for-automated-documentation/>)

Author: John Capobianco

Published: 2020-12-02T12:00:00Z

Content type: tutorial

Language: en

Sources: [Automate Your Network](<https://devfeed.tech/sources/automate-your-network.md>)

Topics: [Ansible](<https://devfeed.tech/topics/ansible.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>)

Tags: [ansible](<https://devfeed.tech/tags/ansible.md>), [automated](<https://devfeed.tech/tags/automated.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [performance](<https://devfeed.tech/tags/performance.md>)

## AI overview

The author describes refactoring Ansible playbooks to use Jinja2 templates to generate documentation from structured data. The approach replaces slower copy or lineinfile tasks and can generate multiple output files, including CSV and Markdown, from a template loop.

## Source excerpt

When Ivan Pepelnjak has advice for you - take it! I wrote a post about untangling dynamic nested loops in Ansible. In another recent post about trying to improve Ansible performance I didn't get very far - but this could be the silver bulle