Matrix Docker Ansible eploy
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.
 
 

41 lines
1.4 KiB

  1. ---
  2. - name: Ensure Sygnal image is pulled
  3. docker_image:
  4. name: "{{ matrix_sygnal_docker_image }}"
  5. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  6. force_source: "{{ matrix_sygnal_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  7. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_sygnal_docker_image_force_pull }}"
  8. - name: Ensure Sygnal paths exists
  9. file:
  10. path: "{{ item }}"
  11. state: directory
  12. mode: 0750
  13. owner: "{{ matrix_user_username }}"
  14. group: "{{ matrix_user_groupname }}"
  15. with_items:
  16. - "{{ matrix_sygnal_base_path }}"
  17. - "{{ matrix_sygnal_config_path }}"
  18. - "{{ matrix_sygnal_data_path }}"
  19. - name: Ensure Sygnal config installed
  20. copy:
  21. content: "{{ matrix_sygnal_configuration|to_nice_yaml }}"
  22. dest: "{{ matrix_sygnal_config_path }}/sygnal.yaml"
  23. mode: 0640
  24. owner: "{{ matrix_user_username }}"
  25. group: "{{ matrix_user_groupname }}"
  26. - name: Ensure matrix-sygnal.service installed
  27. template:
  28. src: "{{ role_path }}/templates/systemd/matrix-sygnal.service.j2"
  29. dest: "{{ matrix_systemd_path }}/matrix-sygnal.service"
  30. mode: 0644
  31. register: matrix_sygnal_systemd_service_result
  32. - name: Ensure systemd reloaded after matrix-sygnal.service installation
  33. service:
  34. daemon_reload: yes
  35. when: "matrix_sygnal_systemd_service_result.changed|bool"