D
D
DEMonBond2019-03-09 13:59:12
Ansible
DEMonBond, 2019-03-09 13:59:12

What is the difference between task and role?

Hello, I have such a question - what is the fundamental difference between tasks and roles? I have a task to provide a tool that provides continuous integration and distribution delivery, and the tool must be flexible, some steps can be excluded or added. I came up with two solutions in the first case, I divided all the stages into roles, it’s convenient to launch the playbook with the necessary roles directly from the command line, but it seems to me that it’s wrong to break the server setup into roles, and in the second case I break everything into tasks.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Shumov, 2019-03-09
@DEMonBond

A task is one step of a playbook. A role is one or more logically related playbooks. For example, you have a task to restart the web server, and you have a playbook to deploy the entire server

P
Puma Thailand, 2019-03-09
@opium

There can be many tasks in a role

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question