On 11. aug. 2017 08:25, Ryan wrote:

Sorry, I will attache the error next time.

But you didn't include all relevant output.


I tried indenting it to the same column as name and debug, but it still
failed.  If I change the command to something that returns a value for
sel_out, the debug msg returns the expected output.  The error only comes
when sel_out is not defined.

- 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


fatal: [192.168.100.11]: FAILED! => {"ansible_job_id":
"717909993947.50020", "changed": true, "cmd": "ipmitool sel list | grep -i
ecc", "delta": "0:00:00.088089", "end": "2017-08-11 06:02:57.289040",
"failed": true, "finished": 1, "rc": 1, "start": "2017-08-11
06:02:57.200951", "stderr": "", "stderr_lines": [], "stdout": "",
"stdout_lines": []} >

This error has noting to do with you debug task, it's the task you running "ipmitool sel list" Had you included more information about this error you would have seen that easy a few lines before this statement.

grep isn't finding any ecc in the output av return code 1, this means failure to ansible.
To change this you have can add "changed_when" to the task.


--
Kai Stian Olstad

--
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/78385974-9deb-9c76-5d13-3e2d8c0334ab%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to