main.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ---
  2. # tasks file for ansible-gluon-collector
  3. - when: ansible_machine != "x86_64"
  4. set_fact: gluon_collector_download_url="{{gluon_collector_download_url}}-386"
  5. - name: Create Group for gluon-collector
  6. group:
  7. name: "{{gluon_collector_group}}"
  8. state: present
  9. system: yes
  10. - name: Create user for gluon-collector
  11. user:
  12. name: "{{gluon_collector_user}}"
  13. createhome: no
  14. home: "{{gluon_collector_base_path}}"
  15. system: yes
  16. state: present
  17. groups: "{{gluon_collector_group}}"
  18. - name: Create install directory for gluon-collector
  19. file:
  20. dest: "{{gluon_collector_base_path}}"
  21. state: directory
  22. owner: "{{gluon_collector_user}}"
  23. group: "{{gluon_collector_group}}"
  24. - name: Create gluon-collector configuration
  25. template:
  26. src: config.j2
  27. dest: "{{gluon_collector_base_path}}/gluon-collector.yml"
  28. owner: "{{gluon_collector_user}}"
  29. group: "{{gluon_collector_group}}"
  30. mode: "u=rw,g=rw,o=r"
  31. notify: Restart gluon-collector
  32. - name: Download gluon-collector
  33. get_url:
  34. dest: "{{gluon_collector_base_path}}/gluon-collector"
  35. url: "{{gluon_collector_download_url}}"
  36. - name: Set permission on gluon-collector executable
  37. file:
  38. dest: "{{gluon_collector_base_path}}/gluon-collector"
  39. owner: "{{gluon_collector_user}}"
  40. group: "{{gluon_collector_group}}"
  41. mode: "u=rwx,g=rw,o=r"
  42. - when: gluon_collector_use_supervisor
  43. include: supervisor.yml
  44. - when: not gluon_collector_use_supervisor
  45. include: systemd.yml