【发布时间】:2021-02-09 12:55:30
【问题描述】:
我的 yml 看起来像:
---
# YAML documents begin with the document separator ---
# The minus in YAML this indicates a list item. The playbook contains a list
# of plays, with each play being a dictionary
-
# Hosts: where our play will run and options it will run with
hosts: localhost
gather_facts: false
# Vars: variables that will apply to the play, on all target systems
vars:
DDVE_public_IP : 34.107.103.175
destination_port: 3009
Instance_id : 8529834022607504819
S3_bucket_name : bucket_for_ddve_6
# Tasks: the list of tasks that will be executed within the playbook
tasks:
- name: login access token
uri:
url: https://{{ DDVE_public_IP }}:{{ destination_port }}/{{ resource_path }}
method: POST
headers:
Content-Type: application/json
body_format: json
body:
username: sysadmin
password: {{ Instance_id }}
return_content: yes
ignore_errors: yes
register: rest_post
vars:
resource_path: rest/v1.0/auth
- name: DEBUG / GOT INFO
debug:
msg: "{{ rest_post.json }}"
when: rest_post.status == 201
# Handlers: the list of handlers that are executed as a notify key from a task
# Roles: list of roles to be imported into the play
# Three dots indicate the end of a YAML document
...
ansible-playbook ddve6-post-deploy-object-store.yml
[警告]:未解析任何清单,只有隐式本地主机可用。 [警告]:提供的主机列表为空,只有 localhost 可用。注意 隐式本地主机不匹配“全部”。 错误!我们无法读取 JSON 或 YAML,以下是我们从每个错误中得到的错误: JSON:预期值:第 1 行第 1 列(字符 0)
加载 YAML 时出现语法错误。 没有找到预期的密钥
错误似乎在“/Users/juergen/Documents/DPSCodeAcademy/Ansible/#dev/ddve/ddve6-post-deploy-object-store.yml”中:第 30 行,第 9 列,但可能 根据确切的语法问题,位于文件中的其他位置。
违规行似乎是:
password: {{ Instance_id }} return_content: yes ^ here
我不知道错误出现在哪里,因为我在这里找不到响应问题。
【问题讨论】:
标签: ansible