Question: 1 / 165

What three components are Ansible Roles typically made up of?

Tasks, Handlers, Configurations

Ansible Roles are a way to organize and encapsulate automation content in a reusable manner, making it easier to manage complex configurations. The three primary components that define an Ansible Role are tasks, handlers, and configurations. Tasks are the core of Ansible automation; they define the actions to be performed on the managed systems, such as installing packages or copying files. Each task is typically structured in a way that allows it to be easily reused across different roles or plays. Handlers are special types of tasks that are triggered only when there is a change in the state of the system. For instance, if a service needs to be restarted after a configuration file is changed, a handler can be defined to perform that action only when necessary. This ensures that not every task results in the execution of a handler, optimizing performance. Configurations involve various configuration files required for the role, which may include variable definitions or defaults. These configurations allow roles to be customizable while maintaining a clear structure. The other options do not fully capture the essence of Ansible Roles. While components like scripts, variables, templates, modules, and playbooks play important roles in Ansible, they are not the fundamental components that define a Role's structure, thereby distinguishing A as the correct answer in

Scripts, Variables, Templates

Modules, Handlers, Playbooks

Tasks, Playbooks, Inventories

Next

Report this question