I'm sure this is probably something I'm doing wrong, but I can't seem to figure out the right thing, so hopefully someone else can.
Given the following playbook:
---
- name: Jenkins Status Info
hosts: localhost
connection: local
user: root
gather_facts: False
vars:
project: member-web-dev
tasks:
- name: Get jenkins status
uri: url={{ jenkins_url }}/{{ project }}/lastBuild/api/json return_content=yes status_code=200
register: jenkinsStatus
- name: show the output
debug: var=jenkinsStatus.json.changeSet.items.0.comment
I'm trying to access the comment data, but am not getting back any value:
ok: [127.0.0.1] => {
"jenkinsStatus.json.changeSet.items.0.comment": "{{ jenkinsStatus.json.changeSet.items.0.comment }}"
}
and if I just use debug: var=jenkinsStatus.json.changeSet.items
ok: [127.0.0.1] => {
"jenkinsStatus.json.changeSet.items": "<built-in method items of dict object at 0x7fd259a89ae0>"
}
So how can I access/use the value stored in comment?
> ansible-playbook --version
ansible-playbook 1.5,