Re: [ansible-project] When Or statement

2020-12-01 Thread Stefan Hornburg (Racke)
On 12/1/20 5:17 PM, James Lagermann wrote: > Have you tried to put the line in double quotes?  I'm not sure if it's always > required, however, some of my 'or' > statements will not work without them so I just put all of them in double > quotes. > >       when:  "(item.key is not regex("(Port|Vl

Re: [ansible-project] When Or statement

2020-12-01 Thread James Lagermann
Have you tried to put the line in double quotes? I'm not sure if it's always required, however, some of my 'or' statements will not work without them so I just put all of them in double quotes. when: "(item.key is not regex("(Port|Vlan)")) or (item.key not in po_ints)" On Monday, Novem

Re: [ansible-project] When Or statement

2020-11-30 Thread J C
Hello, Just thought I would uypdate. I was not able to find the correct syntax for an or in a when statement. What I end up doing, and I am sure there is a better way to do it, was create separate lists then adding them together. - name: Create a list without Gigabit interfaces set_f

Re: [ansible-project] When Or statement

2020-11-25 Thread J C
I apologize I did miss a line in my task when I copied. So I used the (Port|Vlan). Which again works as a single statement. Also tried putting the statements in () - name: Apply policy to the interfaces cisco.ios.ios_config: parents: interface {{ item.key }} lines:

Re: [ansible-project] When Or statement

2020-11-25 Thread Stefan Hornburg (Racke)
On 11/25/20 4:44 PM, colli...@gmail.com wrote: > In an ansible play, is "or" not supported with conditional statements? I have > a task that is searching a variable for 2 > values. The when statements work alone, but with "or" it runs but doesn't do > what I am expecting. Here is the task, is > m

[ansible-project] When Or statement

2020-11-25 Thread colli...@gmail.com
In an ansible play, is "or" not supported with conditional statements? I have a task that is searching a variable for 2 values. The when statements work alone, but with "or" it runs but doesn't do what I am expecting. Here is the task, is my syntax wrong or is it just not supported? - - n