How to exclude the task from role

19 views
Skip to first unread message

Suresh Karpurapu

unread,
Apr 24, 2020, 2:34:17 PM4/24/20
to Ansible Project
Hi Team,

I have the role which has 10 tasks. I would like to exclude 1 task out of 10 as the task already executed in previous play.. Is there anyway to do

---
  - name: Required Checks for the migration
    hosts: localhost
    gather_facts: no
    become: yes
    tasks:
      - include_role:
          name: validation
          tasks_from: sshcheck
  - name: check ssh connectivity
    hosts: sshgroup
    gather_facts: no
    become: yes
    any_errors_fatal: false
    tasks:
      - name: Checking SSH connectivity
        wait_for:
          host: "{{ inventory_hostname }}"
          port: 22
  - name: stale and mount permissions check
    hosts: localhost
    gather_facts: no
    become: yes
    roles:
      - { name: validation, sshcheck: false }
...

Regards,
Suresh

Dick Visser

unread,
Apr 24, 2020, 7:50:43 PM4/24/20
to ansible...@googlegroups.com
Use tags 

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/dd1e851f-2a2a-4fd3-8d75-2b57a99eb7fe%40googlegroups.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.
Reply all
Reply to author
Forward
0 new messages