# how to use import roles in playbook

**URL:** <https://forum.ansible.com/t/how-to-use-import-roles-in-playbook/28498>\
**Category:** Ansible Project\
**Created:** [September 4, 2018, 9:35pm UTC](https://forum.ansible.com/t/how-to-use-import-roles-in-playbook/28498 "2018-09-04T21:35:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tim\_huang](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tim\_huang](https://forum.ansible.com/u/tim_huang)\
**Post date:** [September 4, 2018, 9:35pm UTC](https://forum.ansible.com/t/how-to-use-import-roles-in-playbook/28498/1 "2018-09-04T21:35:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tim\_huang](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tim\_huang](https://forum.ansible.com/u/tim_huang)\
**Post date:** [September 5, 2018, 4:28pm UTC](https://forum.ansible.com/t/how-to-use-import-roles-in-playbook/28498/2 "2018-09-05T16:28:44Z")

</div>

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
