Explain use of pre_tasks
See original GitHub issueBook version: 1.21
Chapter 4 introduces pre_tasks
(page 63) with a brief explanation that they’re run before the main set of tasks. It’s not clear (at this point in the book anyway) how that’s any different to just adding a task at the beginning of the tasks
section.
Assuming the reasoning is covered later in the book, it would be useful to reference that section, or provide a simple explanation at this point of the book.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Ansible Pre Tasks and Post Tasks Example | Devops Junction
In this article, we are going to see how to use ansible pre tasks and post tasks with examples. ansible pre tasks. What...
Read more >Set the order of task execution in Ansible with these two ...
First, I'll define pre_tasks and post_tasks. ... My favorite aspect of Ansible is its flexibility: You can use Ansible for configuration ...
Read more >What is Ansible pre_tasks? How to Update OS, Install Python ...
What is pre_tasks in Ansible? pre_tasks is a task which Ansible executes before executing any tasks mentioned in .yml file.
Read more >pretask - Wiktionary
AdjectiveEdit. pretask (not comparable). Before commencing a task. AnagramsEdit · kepstra, ...
Read more >How to specify ansible pretasks for a role? - Stack Overflow
I use the pre_tasks to do some tasks before roles, thanks for Kashyap. ... that should override the user variable defined at apache...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@gaddman - Good point; if you don’t know the context (especially how
roles
are run prior totasks
) it might seem arbitrary. I’ve made the line read this way to hopefully clear that up:Nobody is removing them, but they do not scale, and for sake of having two ways of writing code, I am inclined to discourage their use. The net is full of users confused about where to stick tasks between roles. Even if I succeed introducing a lint rule for that, it will be optional, so anyone could bypass it.