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 Magic Variables included.
https://www.ansiblepilot.com/articles...
Timestamps
00:00 Introduction
00:33 ansible.builtin.template Ansible module
01:42 parameters of ansible.builtin.template
03:26 template module demo playbook
08:27 Ansible Magic Variables
09:10 template module execution and verification
12:19 Recap
FREE Top 10 Best Practices of Ansible Automation: save time, reduce errors and stress - http://eepurl.com/hJv3j9
BUY the Complete PDF BOOK to easily Copy and Paste the 200+ Ansible code
200+ Automation Examples For Linux and Windows System Administrator and DevOps
https://leanpub.com/ansiblebyexamples
my VIDEO COURSE: Ansible by Examples
200+ Automation Examples For Linux and Windows System Administrator and DevOps
https://www.udemy.com/course/ansible-...