如何避免在Ansible中记录跳过角色的输出

如何避免在Ansible中记录跳过角色的输出,ansible,Ansible,我跳过Ansible using when condition中的一个角色,但在我运行剧本时它仍在打印任务。是否有方法不记录这些任务,或者如果他们正在记录,则添加类似于跳过任务的内容 /角色/copyrepo/tasks/main.yml --- - include: real_tasks.yml when: temp.stat.isdir is undefined /角色/copyrepo/tasks/real_tasks.yml - name: Ensuring that th

我跳过Ansible using when condition中的一个角色,但在我运行剧本时它仍在打印任务。是否有方法不记录这些任务,或者如果他们正在记录,则添加类似于跳过任务的内容

/角色/copyrepo/tasks/main.yml

---
- include: real_tasks.yml
  when: temp.stat.isdir is undefined
/角色/copyrepo/tasks/real_tasks.yml

    - name: Ensuring that the web deployment folder is created on nodes for each web application
      file:
        path: "{{release_location}}/Release{{release_version}}/{{item}}/webapp"
        state: directory
        mode: 0755
      with_items:
       - "{{ myapps }}"

    - name: Copying the release war files from local server to tomcat nodes
      copy: src={{local_server_release_location}}/{{release_version}}/{{item}}-{{release_version}}.war dest={{release_location}}/Release{{release_version}}/{{item}}
      with_items:
       - "{{ myapps }}"

    - name: Overriding the directory name
      command: mv /temp/myapp-web /temp/myapp
display\u skipped\u hosts=False此处不起作用,因为无论任务是否被跳过,任务头仍将显示

我如何避免在输出中显示以下标题,因为它们没有被执行

Ensuring that the web deployment folder is created on nodes for each web application...
Tuesday 02 June 2020  16:54:11 +0100 (0:00:00.216)       0:00:07.378 **********
Copying the MyVM release war files from local server to tomcat nodes...
Tuesday 02 June 2020  16:54:11 +0100 (0:00:00.204)       0:00:07.582 **********
Overriding the directory name...
Tuesday 02 June 2020  16:54:12 +0100 (0:00:00.205)       0:00:07.787 **********

如果有人能提供建议,请告诉我。

如果您对的不满意,那么您可以编写自己的,精确显示您想要的输出,精确格式化。据我所知,如果你想把插件打包成普通的playbook分发机制,甚至可以使用它们