Not sure what you mean by 'it doesn't like this method'? I'm guessing
you're getting an error - which would have been helpful in diagnosing the
issue.

So again, guessing, and hard to see from this message, but it looks like
the indentation of the when statement is way off. It should be at the same
column as name and debug.

Dick

On Thu, 10 Aug 2017 at 22:55, Ryan <jryan...@gmail.com> wrote:

> How do I add a conditionals to debug msg lists?
>
>      - name: Print results
>        debug:
>          msg:
>            - "Board: {{ ansible_product_name }}"
>            - "CPU: {{ ansible_processor[1] }}   Cores: {{
> ansible_processor_cores }}   CPU Count: {{ ansible_processor_count }}"
>            - "Memory: {{ ansible_memtotal_mb }}"
>            - "ansible processor count: {{ ansible_processor_count }}"
>            - "Log File: {{ logfile }}"
>            - "{{ out.stdout.split('\n') }}"
>            - "{{sel_out.stdout.split('\n') }}"
>
>
> Depending on the results, sometimes "register: out" and/or "register:
> sel_out" may not be defined, so the last two messages, will fail if not
> defined.  I tried using the following, but it does not like this method, so
> i am doing it wrong.
>
>      - name: Print results
>        debug:
>          msg:
>            - "Board: {{ ansible_product_name }}"
>            - "CPU: {{ ansible_processor[1] }}   Cores: {{
> ansible_processor_cores }}   CPU Count: {{ ansible_processor_count }}"
>            - "Memory: {{ ansible_memtotal_mb }}"
>            - "ansible processor count: {{ ansible_processor_count }}"
>            - "Log File: {{ logfile }}"
>            - "{{ out.stdout.split('\n') }}"
>            - "{{sel_out.stdout.split('\n') }}"
>                when: sel_out is defined
>
>
> --
> 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 post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/9e896ba5-12df-4a8b-8cff-0dec822277bd%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/9e896ba5-12df-4a8b-8cff-0dec822277bd%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Dick Visser
G√ČANT

Want to join us? We're hiring: https://www.geant.org/jobs

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwMoRdGObnXZQmgMNBh18eKqzBaMBrZiKL06H9eE7ymY6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to