ernestas-poskus/ansible-prometheus

ERROR! the role 'ansible-prometheus' was not found

garyyang6 opened this issue · 0 comments

I installed the collations with the command,

ansible-galaxy install ernestas-poskus.ansible-prometheus

ansible-galaxy list
/home/ubuntu/.ansible/roles
ernestas-poskus.ansible-prometheus, v4.18.0

I run the command as follows:
ansible-playbook -i hosts -l group1 playbook.yml --check

I got errors as follows:

ERROR! the role 'ansible-prometheus' was not found in /home/ubuntu/works/roles:/home/ubuntu/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/ubuntu/works

The error appears to be in '/home/ubuntu/works/playbook.yml': line 5, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  roles:
    - role: ansible-prometheus
      ^ here

As follows is the playbook:

- name: Installing Prometheus on hosted machine
  hosts: group1
    #sudo: yes
  roles:
    - role: ansible-prometheus
      prometheus_config_scrape_configs:
        - job_name: 'prometheus'
          honor_labels: true
          scrape_interval: '15s'
          scrape_timeout: '3s'
          metrics_path: '/metrics'
          scheme: 'http'
          static_configs:
            - targets:
                - 'localhost:9090' # Prometheus itself
                - 'localhost:9100' # Node exporter
        - job_name: 'consul-services'
          consul_sd_configs:
            - server: "localhost:8500"