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

What is the way to access shell environment variables in ansible?

1 Answers  


How do I access a variable name programmatically?

0 Answers  


What are playbooks in ansible?

1 Answers  


How to keep secret data in playbook?

0 Answers  


What are ad-hoc commands? Give an example.

1 Answers  


Explain the callback plugin in ansible?

1 Answers  


Explain what are playbooks in ansible? Explain with some examples.

1 Answers  


Explain the concept behind infrastructure as code (iac).

1 Answers  


How would you access a variable of the first host in a group?

1 Answers  


What is the use of ansible vaults?

1 Answers  


How can you speed up management inside in ec2?

1 Answers  


What is ansible and what makes it stand out from the rest of the configuration management tools?

1 Answers  


Categories