How to run role with a particular tag in a playbook?

Hello, I need to run role in a playbook with a particular tag, **without "--tags" option.** Something like this:


- hosts: somehost
  remote_user: someuser 
  roles:
    - { role: somerole, with-tags: 'sometag' }

I expect that role will run only with the tag "sometag".
This functionality exists? I read docs and can't find anything like my example above.

I think you are looking this one:

  • hosts: somehost
    remote_user: someuser
    roles:
  • { role: somerole, tags: ‘sometag’ }

no, that will tag all tasks in the role with ‘sometag’. The functionality does not current exist to select a tag on role import.

Thank you.