Re: [ansible-project] question about tags

2021-07-19 Thread Doug Hunley
I find
https://docs.ansible.com/ansible/2.8/reference_appendices/special_variables.html
to be a gold mine for these kinds of things. Just match it with whatever
version of Ansible you're supporting.

On Mon, Jul 19, 2021 at 3:56 PM John Petro  wrote:

> oh, that is cool.  I didn't know about that one.  Thanks, I will check it
> out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAMiM3L1N8j3GhE_eAq6k16WuYwv%3DyiwiuAU9Pkdg-j8E-PDtEQ%40mail.gmail.com.


Re: [ansible-project] question about tags

2021-07-19 Thread John Petro
oh, that is cool.  I didn't know about that one.  Thanks, I will check it
out.

--John

On Mon, Jul 19, 2021 at 3:48 PM Doug Hunley 
wrote:

> You could inspect ansible_run_tags and see if those three tags are not in
> it.
>
> On Mon, Jul 19, 2021 at 3:44 PM John Petro  wrote:
>
>> I have a bit of a problem, and was wondering if anyone has ever done
>> something like this.  I have a playbook I am working on, where it updates
>> firewalld rules for some kubernetes clusters we have.  Rather than have a
>> playbook per cluster, we elected to use tags, one for prod, one for
>> nonprod, and one for beta.
>>
>> What I am trying to do, is have task, that if it isn't one of the three
>> mentioned tags ( Prod, Non-Prod, Beta) then it executes, basically
>> outputting a debug message that the only accepted tags are those three.  Is
>> there a way to say something like "If tags !=[Prod,Non-Prod,Beta] then
>> output text"?
>>
>> I was fairly sure that at some point I saw that there was a way to do
>> that, and I can't seem to find the example anymore so any help anyone can
>> offer wold be greatly appreciated.
>>
>> --John
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAMiM3L3uLqzCzrrtoOwhs8e2_sk2wUmXt%3DSrPjJEnWy%2BHN%2B%2B7w%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPAjob80eSNVG5d3XG3vmFKr5LtPE%2B4k0pH8mAHqye3eZyefPw%40mail.gmail.com.


Re: [ansible-project] question about tags

2021-07-19 Thread Doug Hunley
You could inspect ansible_run_tags and see if those three tags are not in
it.

On Mon, Jul 19, 2021 at 3:44 PM John Petro  wrote:

> I have a bit of a problem, and was wondering if anyone has ever done
> something like this.  I have a playbook I am working on, where it updates
> firewalld rules for some kubernetes clusters we have.  Rather than have a
> playbook per cluster, we elected to use tags, one for prod, one for
> nonprod, and one for beta.
>
> What I am trying to do, is have task, that if it isn't one of the three
> mentioned tags ( Prod, Non-Prod, Beta) then it executes, basically
> outputting a debug message that the only accepted tags are those three.  Is
> there a way to say something like "If tags !=[Prod,Non-Prod,Beta] then
> output text"?
>
> I was fairly sure that at some point I saw that there was a way to do
> that, and I can't seem to find the example anymore so any help anyone can
> offer wold be greatly appreciated.
>
> --John
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAMiM3L3uLqzCzrrtoOwhs8e2_sk2wUmXt%3DSrPjJEnWy%2BHN%2B%2B7w%40mail.gmail.com.


[ansible-project] question about tags

2021-07-19 Thread John Petro
I have a bit of a problem, and was wondering if anyone has ever done
something like this.  I have a playbook I am working on, where it updates
firewalld rules for some kubernetes clusters we have.  Rather than have a
playbook per cluster, we elected to use tags, one for prod, one for
nonprod, and one for beta.

What I am trying to do, is have task, that if it isn't one of the three
mentioned tags ( Prod, Non-Prod, Beta) then it executes, basically
outputting a debug message that the only accepted tags are those three.  Is
there a way to say something like "If tags !=[Prod,Non-Prod,Beta] then
output text"?

I was fairly sure that at some point I saw that there was a way to do that,
and I can't seem to find the example anymore so any help anyone can offer
wold be greatly appreciated.

--John

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPAjob_d_GP-4z6E5LvcU3z78ezrXB_P%3DsDgg2WEUrtdEpa95A%40mail.gmail.com.