ansible - 使用角色和任务执行角色
问题描述
我有下一本剧本
---
- hosts:grupo1
tasks:
- name: Print a message
ansible.builtin.debug:
msg: "this task runs before the example role"
- name: Include the example role
include_role:
name: inicializar
- name: Print a message
ansible.builtin.debug:
msg: "this task runs after the example role"
...
每次我启动它(ansible-playbook UUAA/ECDY/playbooks/CIR_TIBCO_EI_PP_PR_MASTER.yml --extra-var "entorno=DESARROLLO build=1.2.3.4"
)时,我都会收到以下错误:
ERROR! We were unable to read either as JSON nor YAML, these are the errors we got from each: JSON: Expecting value: line 1 column 1 (char 0)
Syntax Error while loading YAML. mapping values are not allowed in this context
该错误似乎在“/home/javi/UUAA/ECDY/playbooks/CIR_TIBCO_EI_PP_PR_MASTER.yml”中:第 3 行,第 8 列,但可能在文件中的其他位置,具体取决于确切的语法问题。
违规行似乎是:
主机:grupo1 任务:^ 这里
知道什么是错误的吗?
解决方案
键和值之间缺少空格。修理它
- hosts: grupo1
推荐阅读
- amazon-dynamodb - 通过管道将 DynamoDB 流传输到 Webhook
- c# - 在 Asp.net Mvc 中存储菜单列表的最佳方式
- unity3d - unity 2018 像素完美相机,我可以放大和缩小吗?
- python - 使用 texttospeech google api 的奇怪行为
- html - 使用 Bootstrap 4 的带有图标的 CSS 三角形按钮
- c++ - 在两个 .cpp 文件之间定义全局类/结构指针
- flutter - 如何在flutter中读取具有类返回类型的HTTP POST请求?
- mysql - mysql:用于全文搜索的 NOT MATCH 与 NOT IN 子查询
- ios - Here Maps - iOS - MSDKUI 根据本地语言更改 ui 元素
- assembly - 如何将操作码转换为十六进制码