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 .

An s w e r : In the Ansible environment , fact is the most commonly address used by Ansible to get information about the host and store. The Ansible runs the setup modules to generate these facts.

READ ALSO
INSERT / SELECT / UPDATE / DELETE: basics SQL Statements

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.

READ ALSO
Ansible Interview Questions 1

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.

READ ALSO
How to check datapump export progress

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:

Autoscaling groups

CloudFormation

Virtual Private Cloud (VPC)

Security Groups

Relational Database Service (RDS)

CloudTrail

Elastic Cloud Compute (EC2)

READ ALSO
Ansible Interview Questions 7

Q 3 1 ) Which one is not a valid value of state argument module?

  1. file
  1. absent
  2. folder
  3. link

Answer: Folder

Q32) Which module can be utilized to copy files from a remote machine to a control machine?

  1. ping
  2. fetch
  3. copy
  4. move

Answer: fetch

Q33) If you do not need any facts from the host, what command would you use?

  1. gather_facts: no
  2. gather_facts: False
  3. both gather_facts: no or gather_facts: False
  4. gather_facts: y

Answer: gather_facts: no

Q34)Where is Inventory file located by default?

  1. /etc/ansible/hosts
  1. /etc/inventory
  2. /etc/configurations
  3. /etc/ansible

Answer: /etc/ansible/hosts

Q35) What is the default location for Ansible?

Answer:Default location for Ansible modules is /usr/share/ansible

READ ALSO
Ansible Interview Questions 6

Q36) What module can be utilized to stop a playbook execution for a specific period?

  1. Sleep
  2. Pause
  3. Stop
  4. Suspend

Answer: Pause

Q37) Which module will you utilize to create a directory?

  1. File
  2. template
  3. fetch
  4. copy

Answer: File

Q38) Which module can be used to force a handler to run in between

two tasks?

  1. Flush
  2. None of the options
  3. assest
  4. meta

Answer: meta

Q39) Which Ansible module is utilized for managing docker services and containers?

  1. docker_service
  2. docker_login
  3. docker_image
  4. docker

Answer: docker_service