Ansible行动手册代码:
- name: Fetching Blueprint ID from VRA
ansible.builtin.uri:
url: https://myvrahost/catalog-service/api/consumer/entitledCatalogItemViews?%24filter=name+eq+%27myblueprinttest%27
method: GET
validate_certs: no
return_content: yes
headers:
Content-Type: application/json
Authorization: Bearer {{ token.json['id'] }}
register: bpid
- name: Print BP_ID
debug:
msg: "{{ bpid.json }}"
错误:{"消息":"该任务包含一个带有未定义变量的选项。错误为:"dict对象"没有属性"json"\n\n错误可能位于"/home/user/vra_testing/vm_deploy_test1.yaml "中:第48行,第5列,但可能\n在文件的其他位置,具体取决于语法问题。\n\n出错的行可能是:\n\n\n-name:在\n ^此处打印BP_ID\n "}
消息:"{{bpid.json}}"
1条答案
按热度按时间2w3kk1z51#
从bpid中删除了循环。结果工作起来很有魅力!
谢谢你!