Hide (standard) output of tasks

Hello, I hope someone can answer my following question:
It is possible to run ansible tasks in background, or hiding their output from playbook?

Here is an example:
In an playbook I have the following task:

  • name: create some directories
    command: mkdir -p /really/important/directory
    tags: common

It may possible, that the directory is missing on the server, but I won’t get an output of the command, even not if one of the directories wre created.
The whole task should be hidden from the summary, is this possible with ansible?

Many thanks!

The ‘async’ command as detailed in the documentation will background commands and optionally poll for their completion, but there’s no need to poll a mkdir as it’s not a long running operation.

If you want to see the results of running the command in Ansible, supply “-v” when executing the playbook.

I guess I’m not understanding why you would want to hide the output.

I would still implement this with “file: dest=/really/important/directory state=directory mode=700 …”

Hi Michael,

thank you for the fast reply. This answered my question. The ‘mkdir’ was only an example for a short running operation which do not tends to go wrong.

Best, Max