--tags tag1 AND tag2, possible?

Hi,

I have a role which supports multiple platforms (Debian, RHEL,
FreeBSD, OpenBSD). I use 'when: ansible_pkg_mgr == ...' a lot to
autodetect, but that results in a lot of skipping... so I thought I
might use tags in addition, so users can choose to specifically select
only their platform to speedup playbook runs.

I would have OS specific tags in mind (debian, freebsd, ...) and task
oriented tags (install, configure, ...).

While playing with it, I noticed that '--tags debian,install' runs
tasks that are tagged as 'debian' OR 'install' (which includes tasks
tagged as freebsd,install -> results in lot of skipping again), is
there a way to say run only 'debian' *AND* 'install' tagged tasks?

thanks!
nusenu

not currently, a feature request we have is that tags get ‘host expressions’, so this would look like;

tag1:&tag2

but there is currently no code that does this

Brian Coca:

not currently, a feature request we have is that tags get 'host
expressions', so this would look like;

tag1:&tag2

but there is currently no code that does this

thanks for the prompt reply.

I tried to find that feature request, via:

https://github.com/ansible/ansible/issues?utf8=✓&q=is%3Aopen+label%3Afeature_idea+tags

but did not find it. Would you point me to it?

thanks

I was not thinking of a specific ticket, but there should be many
instances of this being requested via the maliing lists and IRC and
even as comments in other tag related tickets.

Brian Coca:

I was not thinking of a specific ticket, but there should be many
instances of this being requested via the maliing lists and IRC
and even as comments in other tag related tickets.

ok sounds like one should create an issue for it:

https://github.com/ansible/ansible/issues/11185