Ansible Playbook角色要安装Promtail

发布于 2025-02-09 05:56:35 字数 881 浏览 3 评论 0原文

当我想运行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

[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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡看悲欢离合 2025-02-16 05:56:35

我重新创建了您的问题。您需要安装 roun 使用以下命令使用以下命令,然后才能运行剧本。

Ansible-Galaxy安装Patrickjahns.promtail

测试

安装之前(相同错误):

The error appears to be in 'test.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

安装后(它可以使用!):

 ____________ 
< PLAY [all] >
 ------------ 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

skipping: no hosts matched
 ____________ 
< PLAY RECAP >
 ------------ 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

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):

The error appears to be in 'test.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

After installing (it works!):

 ____________ 
< PLAY [all] >
 ------------ 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

skipping: no hosts matched
 ____________ 
< PLAY RECAP >
 ------------ 
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文