Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


When should I use {{ }}? Also, how to interpolate variables or dynamic variable names



When should I use {{ }}? Also, how to interpolate variables or dynamic variable names..

Answer / Pushpendra Singh Thakur

In Ansible, double curly braces `{{ }}` are used for variable interpolation. This means that Ansible replaces the double curly braces with the value of the specified variable at runtime. For example, if you have a variable named `host`, you can use it in your playbook like this: `hosts: {{ host_list }}`. To interpolate dynamic variable names, you can use the `set_fact` or ` vars ` keywords to define a new variable dynamically during the playbook execution.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ansible Interview Questions

How can one generate encrypted passwords for the user module?

1 Answers  


Describe your newsletter ansible and who it’s aimed at.

1 Answers  


What are the variables in ansible?

1 Answers  


How to keep secret data in a playbook?

1 Answers  


How does ansible work?

1 Answers  


When to use {{}} ? How to interpolate variables or dynamic variable names?

1 Answers  


Suppose you’re using ansible to configure the production environment and your playbook uses an encrypted file. Encrypted files prompt the user to enter passwords. But since ansible is used for automation, can this process be automated?

1 Answers  


Is it possible to build our modules in ansible?

1 Answers  


Write a playbook to create a backup of a file in the remote servers before copy.

1 Answers  


Does ansible support aws?

1 Answers  


What are the advantages of ansible?

1 Answers  


why don’t you ship in x format?

1 Answers  


Categories