# CLI option to not output skipped tasks

**URL:** <https://forum.ansible.com/t/cli-option-to-not-output-skipped-tasks/13443>\
**Category:** Ansible Project\
**Created:** [September 10, 2013, 9:30am UTC](https://forum.ansible.com/t/cli-option-to-not-output-skipped-tasks/13443 "2013-09-10T09:30:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jurgen\_Haas2](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@Jurgen\_Haas2](https://forum.ansible.com/u/Jurgen_Haas2)\
**Post date:** [September 10, 2013, 9:30am UTC](https://forum.ansible.com/t/cli-option-to-not-output-skipped-tasks/13443/1 "2013-09-10T09:30:38Z")

</div>

Is there a command line option that allows to not output ignored tasks?

Currently and by default, ansible-playbook outputs thetask name followed by a line “skipping: {{ inventory\_hostname }}” and if used with with\_items then the skipping line gets repeated for each item with its current value. I wonder if it was possible to skip this output if a task got ignored completely.

Use case: within our huge repository of roles we sometimes want to executed only very little parts of them and as we use role dependencies and other includes, etc. we introduced lots of conditions so that we have fine-tuned control over what’s actually being executed. That is great because we can make use of default role variables and many other things that we are re-using by this approach. However, this list of ignored tasks now gets pretty long sometimes and it is not so pretty anymore. That’s why we’d be glad to just not output them at all if a specific option was given.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [September 10, 2013, 12:33pm UTC](https://forum.ansible.com/t/cli-option-to-not-output-skipped-tasks/13443/2 "2013-09-10T12:33:16Z")

</div>

Nope, there’s no option for this.

I generally like to contain option sprawl.

You might want to use “group\_by” to target just the hosts you want in many cases as it will avoid duplicate output.

---

<div class="post-metadata">

**Author:** ![Jurgen\_Haas2](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@Jurgen\_Haas2](https://forum.ansible.com/u/Jurgen_Haas2)\
**Post date:** [September 10, 2013, 12:46pm UTC](https://forum.ansible.com/t/cli-option-to-not-output-skipped-tasks/13443/3 "2013-09-10T12:46:04Z")

</div>

Thanks Michael,

The grouping is no issue and I don’t see duplicate output either. Let me give you an example:

I have roles like common, mysql, apache, many others and a role migrate.

In common and mysql, there are some default variables that might get overwritten by hosts or groups, it depends on the used inventory.

Now, I have a playbook that only runs the role “migrate” (it migrates a live webserver to a development server) and for that role to operate properly I want to make sure that the default variables from common and mysql get read-in as usual. So I have the following play:

- name: “Migration”  
hosts: “{{myhosts}}”  
connection: ssh  
accelerate: “{{accelerate}}”  
gather\_facts: false  
sudo: no  
pre\_tasks:
- name: “Migrate | Find out current username”  
local\_action: shell whoami  
register: current\_user  
roles:
- { role: common, when: ignore\_these\_tasks is defined }
- { role: mysql, when: ignore\_these\_tasks is defined }
- { role: migrate }

This is running common and mysql, so it reads their default variables too. But because of the condition “ignore\_these\_tasks” all their tasks get ignored, which is exactly what I want. But I get an output for each of their tasks because they get ignored.

It’s not a big deal, but certainly a very nice to have.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [September 10, 2013, 12:50pm UTC](https://forum.ansible.com/t/cli-option-to-not-output-skipped-tasks/13443/4 "2013-09-10T12:50:07Z")

</div>

"The grouping is no issue "

I think you might be misunderstanding me. Take a look at “group\_by” in the module docs.

It’s a way to select tasks dynamically based on a condition, and will not produce duplicate output for different hosts.

Generally speaking though, it’s not a major concern for me and I don’t want to add a flag for this, since I want to control option sprawl.

---

<div class="post-metadata">

**Author:** ![Nick\_Groenen](https://avatars.discourse-cdn.com/v4/letter/n/c77e96/32.png) [@Nick\_Groenen](https://forum.ansible.com/u/Nick_Groenen)\
**Post date:** [September 10, 2013, 1:07pm UTC](https://forum.ansible.com/t/cli-option-to-not-output-skipped-tasks/13443/5 "2013-09-10T13:07:04Z")

</div>

I'm in the same boat as Jürgen (group\_by doesn't cut it for me in this  
situation) and would like to see an option for this as well, actually.

I can understand wanting to limit the number of options, but is this  
something that would be considered if it was added as an option in the  
configuration file, as opposed to a flag on the command line?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [September 10, 2013, 1:59pm UTC](https://forum.ansible.com/t/cli-option-to-not-output-skipped-tasks/13443/6 "2013-09-10T13:59:37Z")

</div>

I would definitely accept a configuration file option.
