gluon-collector.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ---
  2. # tasks file for ffdo.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: "/etc/gluon-collector.yaml"
  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. - name: Generate systemd service
  43. register: gluon_collector_systemd
  44. template:
  45. src: systemd.j2
  46. dest: /etc/systemd/system/gluon-collector.service
  47. - name: Systemd deamon-reload
  48. when: gluon_collector_systemd|changed
  49. shell: systemctl daemon-reload
  50. - name: Ensure gluon-collector is started and enabled via systemd
  51. service:
  52. name: gluon-collector
  53. state: started
  54. enabled: yes