Ansible Playbook角色要安装Promtail
当我想运行Ansible Playbook以在实例上安装Promtail时,我会遇到此错误。
#这是我的剧本
- 主持人: 角色:
- 角色:patrickjahns.promtail vars: promtail_config_scrape_configs: -Job_name:系统 static_configs: - 目标: - 地方主机 标签: 工作:varlogs 路径:/var/log/*log
[警告]:无法解析/home/emediong/dynamic-inventory/roles/inventory.txt作为库存 来源 [警告]:没有解析库存,只有隐式本地主机可用 [警告]:提供的主机列表为空,只有Localhost可用。请注意隐式 Localhost与“全部”不匹配 错误!在/home/emediong/emediong/dynamic-inventory/roles/roles/roles:/home/emediong/.ansible/Roles/Roles/Roles/Roles/Roles/Share/Share/Share/Share/Roles/Roles/Roles/Roles/Roles/Roles/Roles/Roles/Roles/Roles/Roles/Roles/Roles/Roles/Roles/Roles/Roles: /home/emeDiong/dynamic-inventory/warm
误差似乎在'/home/emediong/dynamic-inventory/roles/roles/promtail.yml':第4行,第7列,但可以 根据确切的语法问题,请参见文件中的其他地方。
有问题的线似乎是:
角色: - 角色:patrickjahns.promtail ^这里
I keep getting this error when i want to run my ansible playbook to install promtail on my instances.
#This is my playbook
- hosts: all
roles:- role: patrickjahns.promtail
vars:
promtail_config_scrape_configs:
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: varlogs
path: /var/log/*log
- role: patrickjahns.promtail
[WARNING]: Unable to parse /home/emediong/dynamic-inventory/roles/inventory.txt as an inventory
source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
localhost does not match 'all'
ERROR! the role 'patrickjahns.promtail' was not found in /home/emediong/dynamic-inventory/roles/roles:/home/emediong/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/emediong/dynamic-inventory/roles
The error appears to be in '/home/emediong/dynamic-inventory/roles/promtail.yml': line 4, column 7, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
roles:
- role: patrickjahns.promtail
^ here
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我重新创建了您的问题。您需要安装 roun 使用以下命令使用以下命令,然后才能运行剧本。
Ansible-Galaxy安装Patrickjahns.promtail
测试
安装之前(相同错误):
安装后(它可以使用!):
I recreated your issue. You need to install the role with ansible-galaxy using the below command before you can run the playbook.
ansible-galaxy install patrickjahns.promtail
Testing
Before installing (same error):
After installing (it works!):