Yes, that works also, and is simpler than my example. Nice!
+++
---
- name: testing when
hosts: localhost
become: no
gather_facts: no
vars:
my_lines:
- "idle-queue:idle-queue_00 RUNNING pid 32292, uptime 1:21:01"
- "idle-queue:idle-queue_01 RUNNING pid 32293, uptime 1:21:01"
- "idle-queue:idle-queue_02 RUNNING pid 32291, uptime 1:21:01"
tasks:
- debug: msg="running found"
when: my_lines is search('RUNNING')
+++
... yields ...
+++
% ansible-playbook -i localhost, foo.yml
PLAY [testing when]
****************************************************************************************************
TASK [debug]
***********************************************************************************************************
ok: [localhost] => {
"msg": "running found"
}
PLAY RECAP
*************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0
skipped=0 rescued=0 ignored=0
+++
Walter
--
Walter Rowe, Chief
Infrastructure Services
Office of Information Systems Management
National Institute of Standards and Technology
United States Department of Commerce
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/3F9B2FC8-8FFD-403C-BCF3-96F9D2DFF709%40nist.gov.