Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

45 строки
1.6 KiB

  1. ---
  2. - name: Ensure matrix-ntfy image is pulled
  3. docker_image:
  4. name: "{{ matrix_ntfy_docker_image }}"
  5. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  6. force_source: "{{ matrix_ntfy_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_ntfy_docker_image_force_pull }}"
  8. register: result
  9. retries: "{{ matrix_container_retries_count }}"
  10. delay: "{{ matrix_container_retries_delay }}"
  11. until: result is not failed
  12. - name: Ensure matrix-ntfy paths exists
  13. ansible.builtin.file:
  14. path: "{{ item }}"
  15. state: directory
  16. mode: 0750
  17. owner: "{{ matrix_user_username }}"
  18. group: "{{ matrix_user_groupname }}"
  19. with_items:
  20. - "{{ matrix_ntfy_base_path }}"
  21. - "{{ matrix_ntfy_config_dir_path }}"
  22. - "{{ matrix_ntfy_data_path }}"
  23. - name: Ensure matrix-ntfy config installed
  24. ansible.builtin.copy:
  25. content: "{{ matrix_ntfy_configuration | to_nice_yaml(indent=2, width=999999) }}"
  26. dest: "{{ matrix_ntfy_config_dir_path }}/server.yml"
  27. mode: 0644
  28. owner: "{{ matrix_user_username }}"
  29. group: "{{ matrix_user_groupname }}"
  30. - name: Ensure matrix-ntfy.service installed
  31. ansible.builtin.template:
  32. src: "{{ role_path }}/templates/systemd/matrix-ntfy.service.j2"
  33. dest: "{{ matrix_systemd_path }}/matrix-ntfy.service"
  34. mode: 0644
  35. register: matrix_ntfy_systemd_service_result
  36. - name: Ensure systemd reloaded after matrix-ntfy.service installation
  37. ansible.builtin.service:
  38. daemon_reload: true
  39. when: "matrix_ntfy_systemd_service_result.changed"