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 {{ }}?



When should I use {{ }}?..

Answer / Vijayendra Kumar Gautam

In Ansible, you should use `{{ }}` for variable interpolation. It allows you to reference variables within your playbooks or templates and have their values substituted at runtime. For example:
```yaml
- hosts: webservers
vars:
server_name: mywebsite.com
tasks:
- name: Set hostname
hostname: {{ server_name }}
```
In the example above, the `server_name` variable is interpolated and its value (mywebsite.com) is used to set the hostname on the webservers.

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  


How do I generate crypted passwords for the user module?

1 Answers  


How do I submit a change to the documentation?

1 Answers  


Can you copy files recursively onto a target host? If yes, how?

1 Answers  


How do I copy files recursively onto a target host?

0 Answers  


How can you connect other devices within ansible?

1 Answers  


How can I display all the inventory vars defined for my host?

1 Answers  


What features does the ansible tower provide?

1 Answers  


How to access a variable of the first host in a group?

1 Answers  


Talk about ansible architecture.

1 Answers  


How can one interpolate variables or dynamic variable names?

1 Answers  


How would you install ansible on a centos system?

1 Answers  


Categories