Ansible Interview Questions 3
Q21) Is it possible to keep secret data in the playbook?
Answer: Yes, it is possible to keep secret data in your Ansible content with the use of Vault in playbooks. With V mode you have to use some commands to hide sensitive data from others.
Q22) Explain ad-hoc commands.
Answer: The ad-hocs are used to take action on the hosts without writing the playbooks. So, if you have to reboot the hosts in a specific group then there are two ways to do that. You can either create a new playbook or you can simply use the one-off ad-hoc command.
þÿ Q 2 3 ) E x p l a i n t h e t e r m f a c t i n A n s i b l e .
Q24) What is the right way to copy files recursively onto a target host?
Answer : This copy module of Ansible has recursivepar a meters . You can synchronize modules if you need to per form more efficient forahugen important to use comm and switch synchronize modules .
Q25) Explain the meaning of Ansible tasks.
Answer: The Ansible tasks are majorly used to break up bits of configuration policy in little files.
These small blocks of code that are used to automate any process.
Q26) Explain the Ansible role and what makes it different from the playbooks?
Answer: The Ansible role is completely another level of abstraction. These are used to organize playbooks. It provides an independent structure and a reusable collection of various things. It includes templates, files, variables, tasks, etc.
Q27) Why Ansible vaults are used?
Answer: The Ansible vaults are used to keep all your secret data safe. It facilitates the encryption of sensitive data but also integrates them into your playbooks. The files can either be entirely encrypted or unencrypted, the vault is implemented with file-level granularity. The Ansible vaults are very user-friendly.
Q28) Explain the features of the Ansible tower.
Answer: The Ansible towers display everything happening in the Ansible environment like inventory status, hosts and other recent activities. It also integrates the notifications about all the necessary updates. The multi-playbook workflow feature of Ansible tower makes it easier to chain all the playbooks. It is also useful for scheduling Ansible jobs.
Q29) How can you connect other devices within Ansible?
Answer: After installing Ansible on the controlling systems, one inventory file is created which particularly explains the connection between other nodes. The SSH protocol can be used to make a connection. If you want to check its connection, then you can use the ping module. The command to check this connection is: ansible -m ping all
Q30) Does Ansible support AWS?
Answer: There are hundreds of modules present in Ansible that support AWS. It includes:
Virtual Private Cloud (VPC)
Relational Database Service (RDS)
Elastic Cloud Compute (EC2)
Q 3 1 ) Which one is not a valid value of state argument module?
Q32) Which module can be utilized to copy files from a remote machine to a control machine?
Q33) If you do not need any facts from the host, what command would you use?
- gather_facts: no
- gather_facts: False
- both gather_facts: no or gather_facts: False
- gather_facts: y
Answer: gather_facts: no
Q34)Where is Inventory file located by default?
Q35) What is the default location for Ansible?
Q36) What module can be utilized to stop a playbook execution for a specific period?
Q37) Which module will you utilize to create a directory?
Q38) Which module can be used to force a handler to run in between
- None of the options
Q39) Which Ansible module is utilized for managing docker services and containers?