You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

  1. ---
  2. - name: Create prometheus user and group
  3. import_tasks: prometheus_user.yml
  4. - name: Download redis_exporter from GitHub
  5. get_url:
  6. dest: /tmp/prometheus_redis_exporter.tar.gz
  7. url: https://github.com/oliver006/redis_exporter/releases/download/v0.26.0/redis_exporter-v0.26.0.linux-amd64.tar.gz
  8. checksum: sha256:39354c57b9d02b455c584baf46a2df6ed3d1ac190c88e3ec0fa0c23b49ccc2bb
  9. - name: Create redis_exporter directory
  10. file:
  11. path: /opt/prometheus_redis_exporter
  12. state: directory
  13. owner: prometheus
  14. group: prometheus
  15. mode: 0755
  16. - name: Extract redis_exporter
  17. unarchive:
  18. remote_src: true
  19. src: /tmp/prometheus_redis_exporter.tar.gz
  20. dest: /opt/prometheus_redis_exporter
  21. owner: prometheus
  22. group: prometheus
  23. creates: /opt/prometheus_redis_exporter/redis_exporter
  24. - name: Create redis_exporter service file
  25. copy:
  26. src: prometheus_redis_exporter.service
  27. dest: /etc/systemd/system/prometheus_redis_exporter.service
  28. owner: root
  29. group: root
  30. mode: 0644
  31. - name: Start and enable redis_exporter service
  32. service:
  33. name: prometheus_redis_exporter
  34. state: started
  35. enabled: true