koenig-logo

Ansible with Linux and Windows Administration Quiz Questions and Answers

Answer :
  • It allows execution of commands with root-level privileges.

Explanation :

Privilege escalation enables Ansible to execute commands that require higher permissions, typically as root, ensuring the necessary privileges are maintained for certain operations.
Answer :
  • Execute the playbook multiple times on the same server

Explanation :

Idempotency refers to the ability to run a playbook multiple times on the same server without causing changes after the first execution. Option "c " checks this aspect effectively.
Answer :
  • 80 seconds

Explanation :

With serial execution set to 2, tasks run in batches of 2 hosts. 3 batches are required: 20 seconds x 3 = 60 seconds, plus 1 more to accommodate the remainder, totaling 80 seconds.
Answer :
  • Execute the role multiple times and ensure no changes occur after the first run.

Explanation :

To test idempotency, a role should be run multiple times without affecting the system state after the initial execution, confirming the tasks do not have unintended side effects.
Answer :
  • /inventory/group_vars/ and /inventory/host_vars/

Explanation :

Placing your variable files in /inventory/group_vars/ and /inventory/host_vars/ directories enables Ansible to automatically assign these variables to specified groups or hosts.
Answer :
  • By ensuring templates do not change output on repeated execution

Explanation :

Jinja2 templates help maintain idempotency by ensuring that if there is no change in the input data, the output will remain the same, preventing unnecessary task re-execution.
Answer :
  • To allow selective access for different user groups

Explanation :

Using multiple vault IDs allows organizations to control access at a granular level, enabling different teams to decrypt only the secrets relevant to their responsibilities.
Answer :
  • Connection plugins differ based on operating system.

Explanation :

Different operating systems use various connection types (e.g., SSH for Linux and WinRM for Windows), necessitating separate configuration for effective task execution.
Answer :
  • To be easily referenced and overridden if necessary.

Explanation :

Placing defaults in the correct directory ensures that these variables provide baseline values and can be easily overridden while maintaining clarity and manageability.
Answer :
  • It provides pre-built roles and community support

Explanation :

Ansible Galaxy is beneficial because it offers a repository of pre-built roles that can be used as-is or customized, along with community support for shared solutions.