Ansible:使用 Ansible 调试模块为使用寄存器保存的 xml 页面打印漂亮的 xml
Ansible: print pretty xml with Ansible debug module for the xml page saved using register
如何打印 xml 使用带有调试的寄存器以漂亮的 xml 格式保存
- name: Create a JIRA issue
uri:
url: https://your.jira.example.com/rest/api/2/issue/
method: GET
user: your_username
password: your_pass
body: "{{ lookup('file','issue.json') }}"
force_basic_auth: yes
status_code: 201
body_format: json
register: test
- debug: {{ test.content }}
如果 test.content
仅包含 xml 您可以使用 xml
module
打印数据
- xml:
xmlstring: {{ test.content }}
pretty_print : yes
如何打印 xml 使用带有调试的寄存器以漂亮的 xml 格式保存
- name: Create a JIRA issue
uri:
url: https://your.jira.example.com/rest/api/2/issue/
method: GET
user: your_username
password: your_pass
body: "{{ lookup('file','issue.json') }}"
force_basic_auth: yes
status_code: 201
body_format: json
register: test
- debug: {{ test.content }}
如果 test.content
仅包含 xml 您可以使用 xml
module
- xml:
xmlstring: {{ test.content }}
pretty_print : yes