May 3, 22
Write a Variable to a File - Ansible module copy vs template
How to save the value of a variable to file using the Ansible copy vs template modules. Included the comparison and a step-by-step example.
Feb 1, 22
Concatenate multiple files in a specific order - Ansible module template and YAML
How to automate the concatenation of multiple files and format using a list in the YAML and Ansible module template with Jinja2 language. Included example with "a.txt", "b.txt" and "includes.yaml" files for Pandoc.
Nov 24, 21
Loop in file template - Ansible module template - Generate hosts file
How to use for loop in Ansible module template to generate/etc/myhosts file with IP address, hostname, and short name from Ansible inventory. Ansible Playbook, Jinja2 template, and with Magic Variables included.