how to run specific task locally on ansible ?

there are no of tasks in play book,

all tasks are running remotely on host. I want to run only one task locally.

How do I do that ? Thanks

Hi

Use tags to achieve this.

Thanks,
Vivek

there are no of tasks in play book,

all tasks are running remotely on host. I want to run only one task locally.

How do I do that ? Thanks

- name: ...
  ....
  delegate_to: localhost

You may also add the following:

  run_once: true

Regards
      Racke

You can use:

local_action or delegate_to: localhost at task level.

-Suneel

Thank you.

Thank you!