Ansible Question and Ans Part2

Q1. Which module allows you to create a directory?

Answer: File

Q2. How to define number of parallel processes while communicating to hosts .

Answer: By Using Fork.

Q3. Is Ansible agentless configuration management Tool ?

Answer: Yes

Q4. What is Ansible Inventory ?

Answer: Ansible works against managed nodes or hosts to create or manage the infrastructure . We list down these hosts or nodes in a file known as Inventory. Inventory can be of two types one is ini and other is YAML format

Q5. Give us an example of ini format inventory ?


Q6. Give us an example of YAML format inventory ?

Answer: API’s, Modules, Host , Playbook , Cloud, Networking and Inventories.



Q7.What is Ansible TAG ?

Answer: When you need to run specific tasks in the Playbook , you can use TAGS to do this. You can apply TAGS on block level , playbook level, individual task level or role level.

Q8. What are key things required for Playbook ?

Answer: Hosts, Tasks and Ansible should already be installed.

Q9. How to use existing tasks ?

Answer: We can use by importing the tasks import_tasks

Q10. How can you secure your ansible-playbook ?

Answer: We can secure it using ansible-vault ( Encrypt and Decrypt)

Q11. What is Ansible Galaxy?

Answer: Ansible Galaxy is a repository for Ansible Roles that are available to drop directly into your Playbooks to streamline your automation projects.

Q12. How can you download roles from Ansible Galaxy ?

Answer: ansible-galaxy install username.role_name

Q13. What are Variables in ansible?

Answer: Variables are assigned a with values which are further used for commuting

Q14. Command to generate a SSH key-pair for connecting with remote machines?

Answer: ssh-keygen

Q15. What is Ansible Tower ?

Answer: Ansible tower is web based solution that makes Ansible even more to easy to use for IT teams. Ansible tower can be used for upto 10 nodes. It captures all recent activities like status of host . It integrates with notification’s about all necessary updates. It also schedules Ansible Jobs very well.

Q16. What is the command for running a playbook?

Answer: ansible-playbook my_playbook.

Q17. Does Ansible support AWS?

Answer: Yes . There are lots of modules that are present in Ansible.

Q18. How to create encrypted files using Ansible?

Answer: By using following command : ansible-vault create file.yml

Q19. What are some key features of Ansible Tower?


Dashboard – Where you can see whatever is going on , Real Time Job Updates , WHo ran , Integrated Notifications, Schedule Ansible Jobs, Remote command execution, REST API

Q20. What is first line syntax of any ansible -playbook?

Answer: Looks like a very easy , the answer is – – –

( First Line Syntax)

– name