Hi All, I have a simple playbook where I am re-directing output of crontab -l command. However its gives me an empty output file once the playbook is executed. Any suggestion please. +++ Ansible Playbook is:- +++ [root@ansible-master /]# cat test.yml ---
- hosts: target_servers tasks: - command: crontab -l register: foo_result ignore_errors: True - local_action: copy content= dest=/abc [root@ansible-master /]# +++ Output of the playbook once its executed is:- +++ [root@ansible-master /]# ansible-playbook test.yml -v Using /etc/ansible/ansible.cfg as config file PLAY [target_servers] ******************************************************************************************************************* TASK [Gathering Facts] ****************************************************************************************************************** ok: [ansible-client1] TASK [command] ************************************************************************************************************************** changed: [ansible-client1] => {"changed": true, "cmd": ["crontab", "-l"], "delta": "0:00:00.005423", "end": "2022-01-19 20:01:32.611028", "rc": 0, "start": "2022-01-19 20:01:32.605605", "stderr": "", "stderr_lines": [], "stdout": "# srvmagtCron: restarts daemons that died\n0,15,30,45 * * * * /bin/sh -c \"[ -x /etc/srvmagt/srvmagtCron ] && /etc/srvmagt/srvmagtCron\"\n\n0 * * * * /opt/FJSVswnc/bin/swnccleanup -RC\n\n# for Process Monitoring\n7 * * * * /usr/local/bin/NBPOPSTR.sh > /dev/null 2>&1\n\n# for find core dump\n0 * * * * /usr/local/bin/NBPOCMON.sh > /dev/null 2>&1\n\n# for System Disk Monitoring\n3 * * * * /usr/local/bin/NBPODMON.sh > /dev/null 2>&1\n\n# for Intarstage active session Monitoring\n0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/local/bin/NBIJSCMON_sr.sh > /dev/null 2>&1", "stdout_lines": ["# srvmagtCron: restarts daemons that died", "0,15,30,45 * * * * /bin/sh -c \"[ -x /etc/srvmagt/srvmagtCron ] && /etc/srvmagt/srvmagtCron\"", "", "0 * * * * /opt/FJSVswnc/bin/swnccleanup -RC", "", "# for Process Monitoring", "7 * * * * /usr/local/bin/NBPOPSTR.sh > /dev/null 2>&1", "", "# for find core dump", "0 * * * * /usr/local/bin/NBPOCMON.sh > /dev/null 2>&1", "", "# for System Disk Monitoring", "3 * * * * /usr/local/bin/NBPODMON.sh > /dev/null 2>&1", "", "# for Intarstage active session Monitoring", "0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /usr/local/bin/NBIJSCMON_sr.sh > /dev/null 2>&1"]} TASK [copy] ***************************************************************************************************************************** *ok: [ansible-client1 -> localhost] => {"changed": false, "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "dest": "/abc", "gid": 0, "group": "root", "mode": "0755", "owner": "root", "path": "/abc", "secontext": "unconfined_u:object_r:etc_runtime_t:s0", "size": 0, "state": "file", "uid": 0}* PLAY RECAP ****************************************************************************************************************************** ansible-client1 : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 [root@ansible-master /]# +++ -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9f7a62e8-2ab3-4d38-9687-702457ce7cdfn%40googlegroups.com.