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.
 
 

48 lines
1.8 KiB

  1. ---
  2. - name: Ensure Conduit Docker image is pulled
  3. docker_image:
  4. name: "{{ matrix_conduit_docker_image }}"
  5. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  6. force_source: "{{ matrix_conduit_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_conduit_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 Conduit config path exists
  13. ansible.builtin.file:
  14. path: "{{ matrix_conduit_config_path }}"
  15. state: directory
  16. mode: 0750
  17. owner: "{{ matrix_user_username }}"
  18. group: "{{ matrix_user_groupname }}"
  19. - name: Ensure Conduit data path exists
  20. ansible.builtin.file:
  21. path: "{{ matrix_conduit_data_path }}"
  22. state: directory
  23. mode: 0770
  24. owner: "{{ matrix_user_username }}"
  25. group: "{{ matrix_user_groupname }}"
  26. - name: Ensure Conduit configuration installed
  27. ansible.builtin.template:
  28. src: "{{ role_path }}/templates/conduit/conduit.toml.j2"
  29. dest: "{{ matrix_conduit_config_path }}/conduit.toml"
  30. mode: 0644
  31. owner: "{{ matrix_user_username }}"
  32. group: "{{ matrix_user_groupname }}"
  33. - name: Ensure matrix-conduit.service installed
  34. ansible.builtin.template:
  35. src: "{{ role_path }}/templates/conduit/systemd/matrix-conduit.service.j2"
  36. dest: "{{ matrix_systemd_path }}/matrix-conduit.service"
  37. mode: 0644
  38. register: matrix_conduit_systemd_service_result
  39. - name: Ensure systemd reloaded after matrix-conduit.service installation
  40. ansible.builtin.systemd:
  41. daemon_reload: true
  42. when: "matrix_conduit_systemd_service_result.changed | bool"