Friday, September 28, 2018

ansible interview questions


  • What is Ansible?

Ansible is developed in Python language.

2.What Are The Advantages and use Of Ansible?
Answer:
Ansible has a huge number of benefits:
•No Agent: Agent is not required for setting up Ansible. If Box can support ssh and it has python, then no issue to set up Ansible.
•Idempotent: Architecture of Ansible is totally structured around the concept of idempotency. The main or core idea is that only those things need to be added which are needed, and those things will be repeatable without side effects.
•Declarative not procedural: a Normal attitude of other configuration tools of following a procedural process, means do this then do that and so on. But Ansible normally writes the description of the state of machine what we want and it takes proper steps toward fulfilling that description.
•Very Easy to learn and low overhead.

3.How Ansible Works?
Playbooks are in YAML file format.

7.What Is The Best Way To Make Content Reusable/ redistributable?
There have 3 ways to reuse files in playbooks of Ansible. 3 ways include, imports and roles.
Roles also can be uploaded and shared by Ansible Galaxy.

https://www.educba.com/ansible-interview-questions/


  • If your Ansible inventory fluctuates over time, with hosts spinning up and shutting down in response to business demands, the static inventory solutions described in Working with Inventory will not serve your needs

You may need to track hosts from multiple sources: cloud providers, LDAP, Cobbler, and/or enterprise CMDB systems.

Ansible integrates all of these options via a dynamic external inventory system. Ansible supports two ways to connect with external inventory: Inventory Plugins and inventory scripts.

If you’d like a GUI for handling dynamic inventory, the Red Hat Ansible Tower inventory database syncs with all your dynamic inventory sources, provides web and REST access to the results, and offers a graphical inventory editor. With a database record of all of your hosts, you can correlate past event history and see which hosts have had failures on their last playbook runs.

Inventory Script Example: Cobbler
Ansible integrates seamlessly with Cobbler, a Linux installation server
While primarily used to kickoff OS installations and manage DHCP and DNS, Cobbler has a generic layer that can represent data for multiple configuration management systems (even at the same time) and serve as a ‘lightweight CMDB’.

Using Inventory Directories and Multiple Inventory Sources
Ansible can use multiple inventory sources at the same time. When doing so, it is possible to mix both dynamic and statically managed inventory sources in the same ansible run. Instant hybrid cloud


https://docs.ansible.com/ansible/latest/user_guide/intro_dynamic_inventory.html#static-groups-of-dynamic-groups

No comments:

Post a Comment