ansible-inventory

How to output loop.index in jinja

How to output loop.index in jinja Question: I want to be able to output the loop.index iteration to my template , i am using ansible and i have template file.j2 and inventory file have the below group [all_servers] app01 ansible_host=10.10.1.100 app02 ansible_host=10.10.1.102 app03 ansible_host=10.10.1.103 app04 ansible_host=10.10.1.104 app05 ansible_host=10.10.1.105 app06 ansible_host=10.10.1.106 I have jinja file inside …

Total answers: 1

Passing a number to a python script

Passing a number to a python script Question: I am working in Linux using Ansible. I am trying to run a script from a playbook, but I need to pass the script a few arguments: a string and 2 numbers. The first number is the number of times I need to retry to run the …

Total answers: 3

Transforming any YAML file into Ansible inventory

Transforming any YAML file into Ansible inventory Question: I’m trying to create an Ansible Inventory file from an existing YAML file. Here is the yaml file I am talking about: – Fabric: AAA Hauteur: 20 Nom de l’equipement: AAA-BAT1 Role: BGW Salle: ‘1’ Travee: 4 Type de materiel: N9K-C9YTR – Hauteur: 20 Nom de l’equipement: …

Total answers: 1