Matrix Docker Ansible eploy
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

51 rinda
1.8 KiB

  1. ---
  2. - set_fact:
  3. matrix_bot_go_neb_requires_restart: false
  4. - name: Ensure go-neb paths exist
  5. file:
  6. path: "{{ item.path }}"
  7. state: directory
  8. mode: 0750
  9. owner: "{{ matrix_user_username }}"
  10. group: "{{ matrix_user_groupname }}"
  11. with_items:
  12. - {path: "{{ matrix_bot_go_neb_config_path }}", when: true}
  13. - {path: "{{ matrix_bot_go_neb_data_path }}", when: true}
  14. - {path: "{{ matrix_bot_go_neb_data_store_path }}", when: true}
  15. when: "item.when|bool"
  16. - name: Ensure go-neb image is pulled
  17. docker_image:
  18. name: "{{ matrix_bot_go_neb_docker_image }}"
  19. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  20. force_source: "{{ matrix_bot_go_neb_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  21. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_go_neb_docker_image_force_pull }}"
  22. - name: Ensure go-neb config installed
  23. copy:
  24. content: "{{ matrix_bot_go_neb_configuration|to_nice_yaml }}"
  25. dest: "{{ matrix_bot_go_neb_config_path }}/config.yaml"
  26. mode: 0644
  27. owner: "{{ matrix_user_username }}"
  28. group: "{{ matrix_user_groupname }}"
  29. - name: Ensure matrix-bot-go-neb.service installed
  30. template:
  31. src: "{{ role_path }}/templates/systemd/matrix-bot-go-neb.service.j2"
  32. dest: "{{ matrix_systemd_path }}/matrix-bot-go-neb.service"
  33. mode: 0644
  34. register: matrix_bot_go_neb_systemd_service_result
  35. - name: Ensure systemd reloaded after matrix-bot-go-neb.service installation
  36. service:
  37. daemon_reload: true
  38. when: "matrix_bot_go_neb_systemd_service_result.changed|bool"
  39. - name: Ensure matrix-bot-go-neb.service restarted, if necessary
  40. service:
  41. name: "matrix-bot-go-neb.service"
  42. state: restarted
  43. when: "matrix_bot_go_neb_requires_restart|bool"