I have the following playbook, and I'd like to get the debug oupput:
---
- name: Install and configure chrony
hosts: '{{ hostgroup }}'
gather_facts: no
become: yes
become_method: sudo
tasks:
- name: make sure chronyd is installed
yum:
name: chrony
state: latest
update_cache: yes
register: command_output
- name: Print result of install chronyd
debug:
var: command_output.stdout_lines
But this what I get:
[WARNING]: log file at /var/log/ansible.log is not writeable and we cannot create it, aborting
/usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (2.2.1) doesn't match a supported version!
RequestsDependencyWarning)
PLAY [Install and configure chrony] *********************************************************************************************************************************************************************************************************
TASK [make sure chronyd is installed] *******************************************************************************************************************************************************************************************************
ok: [serv8]
TASK [Print result of install chronyd] ******************************************************************************************************************************************************************************************************
ok: [serv8] => {
"command_output.stdout_lines": "VARIABLE IS NOT DEFINED!"
}
PLAY RECAP **********************************************************************************************************************************************************************************************************************************
serv8 : ok=2 changed=0 unreachable=0 failed=0
How can I fix the playbook for getting the debug output?