how to use import roles in playbook

Hi,

I’m working on the ansible to automate some tasks for the Cisco network switches, and I have created roles for ciscoios.

I’m trying to use import roles in my playbook to run “check_ip_address” task rather than just run main.yml.

If I use this syntax, it works fine. However, it will run main.yml only. I want to run check_ip_address.yml only and don’t want to use tag in the CLI to do the filtering.

Figure it out by myself. If the import role is used in the playbook, it will be treated as the task. Then the gather_facts is executed before the task, and we need to disable the gather_facts when using the import roles