We have a playbook where, once its completed, we'd like to email the stdout 
to certain users.  Right now I am testing with the command module in the 
playbook as follows:

- name: Get job output
  command: curl -k -u admin:{{ tower_pass }}  -X GET 
https://<server>/api/v2/jobs/{{ tower_id }}/stdout/
  register: output

-name: Print output
  debug:
    msg: "{{ output.stdout }}"

Obviously it doesn't work or else I wouldn't be posting this.  The error I 
get is:

The task includes an option with an undefined variable. The error was: 
'tower_id' is undefined\n\nThe error appears to be in 
'/var/lib/awx/projects/tsose/tsose_uptime.yml': line 15, column 6, but 
may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe 
offending line appears to be:\n\n\n   - name: Get job output\n     ^ here\n

Any ideas on how we can get a job's stdout via the API once the job is 
completed?

Thanks,
Harry

-- 
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/a77b3edf-582c-435c-9339-f72b86bca8c1%40googlegroups.com.

Reply via email to