How can I hide skipped tasks output in Ansible

后端 未结 5 2168
你的背包
你的背包 2020-12-30 23:32

I have Ansible role, for example

---
- name: Deploy app1
  include: deploy-app1.yml
  when: \'deploy_project == \"{{app1}}\"\'

- name: Deploy app2
  include         


        
5条回答
  •  一个人的身影
    2020-12-30 23:42

    If you are using roles, you can use when to cancel the include in main.yml

    # roles/myrole/tasks/main.yml
    - include: somefile.yml
      when: somevar is defined
    
    
    # roles/myrole/tasks/somefile.yml
    - name: this task will only run (and be seen in the output) if somevar is defined
      debug:
        msg: "Hello World"
    

提交回复
热议问题