Ansible can';t寄存器输出

Ansible can';t寄存器输出,ansible,Ansible,这里是http响应主体: TASK [teamcity_backup : Create TeamCity backup via API] ***************************************************************************************************************************** ok: [138.201.152.166] => {"cache_control": "no-store

这里是http响应主体:

TASK [teamcity_backup : Create TeamCity backup via API] *****************************************************************************************************************************
ok: [138.201.152.166] => {"cache_control": "no-store", "changed": false, "connection": "close", "content": "ScheduledBackup_20170929_015922.zip", "content_type": "text/plain", "cookies": {"TCSESSIONID": "99E068D2587365EA57823B81D8A2FE0A"}, "date": "Thu, 28 Sep 2017 23:59:22 GMT", "failed": false, "msg": "OK (unknown bytes)", "redirected": false, "server": "Apache-Coyote/1.1", "set_cookie": "TCSESSIONID=99E068D2587365EA57823B81D8A2FE0A; Path=/; HttpOnly, RememberMe=\"\"; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly", "status": 200, "transfer_encoding": "chunked", "url": "http://teamcity:8111/httpAuth/app/rest/server/backup?includeConfigs=true&includeDatabase=true&includeBuildLogs=false&fileName=ScheduledBackup"}

TASK [teamcity_backup : debug] ******************************************************************************************************************************************************
ok: [138.201.152.166] => {
    "data_c": "VARIABLE IS NOT DEFINED!"
}
数据没有定义,但我不明白为什么。。。你能帮我吗

role/name/task/main.yml:

"content": "ScheduledBackup_20170929_015922.zip"

缩进有问题,请尝试以下操作:

- name: Create TeamCity backup via API
  uri:
    url: 'http://teamcity:8111/httpAuth/app/rest/server/backup?includeConfigs=true&includeDatabase=true&includeBuildLogs=false&fileName=ScheduledBackup'
    method: POST
    user: "{{ teamcity_backup_user }}"
    password: "{{ teamcity_backup_user_password }}"
    force_basic_auth: yes
    return_content: yes
    register: data_c

- debug: var=data_c

寄存器
需要不包含两个空格。它是任务的参数,而不是
uri
模块的参数。
- name: Create TeamCity backup via API
  uri:
    url: 'http://teamcity:8111/httpAuth/app/rest/server/backup?includeConfigs=true&includeDatabase=true&includeBuildLogs=false&fileName=ScheduledBackup'
    method: POST
    user: "{{ teamcity_backup_user }}"
    password: "{{ teamcity_backup_user_password }}"
    force_basic_auth: yes
    return_content: yes
  register: data_c

- debug: var=data_c