I'm new to Ansible an thus this question may seem silly to more advanced users, I'm not sure if it's possible to do what I'm asking since Ansibel is very limited when it comes to loops and conditionals.
I'm performing tasks on a Virtual Connect switch thus I'm limited to use the raw module.
I have a following STDOUT:
=========================================================================
Profile Port Network PXE/IP MAC Address Allocated Status
Name Boot Order Speed
(min-max)
=========================================================================
CLO01ES 1 CLO_355 UseBIOS/Au 00-17-A4-77-58-0 -- -- OK
X02 _1 to 0
-------------------------------------------------------------------------
CLO01ES 2 CLO_355 UseBIOS/Au 00-17-A4-77-58-0 -- -- OK
X02 _2 to 2
-------------------------------------------------------------------------
CLO01ES 3 Multipl UseBIOS/Au 00-17-A4-77-58-0 -- -- OK
X02 e to 4
Network
-------------------------------------------------------------------------
CLO01ES 4 Multipl UseBIOS/Au 00-17-A4-77-58-0 -- -- OK
X02 e to 6
Network
-------------------------------------------------------------------------
<omitted>
The issue is that STDOUT can have multiple lines with different profiles in them i.e. I don't know the line numbers or MAC addresses beforehand.
What I want to achive is a status check. If Profile CLO01ESX02
has Network Name: Multiple Network
twice, then I want to skip the task.
Whenever I was googling parsing variables or STDOUT I would get just basic answers.
Is this possible with Ansible or am I forced to write a custom script?