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.
 
 

56 lines
2.1 KiB

  1. ---
  2. - name: Ensure go-neb paths exist
  3. ansible.builtin.file:
  4. path: "{{ item.path }}"
  5. state: directory
  6. mode: 0750
  7. owner: "{{ matrix_user_username }}"
  8. group: "{{ matrix_user_groupname }}"
  9. with_items:
  10. - {path: "{{ matrix_bot_go_neb_config_path }}", when: true}
  11. - {path: "{{ matrix_bot_go_neb_data_path }}", when: true}
  12. - {path: "{{ matrix_bot_go_neb_data_store_path }}", when: true}
  13. when: "item.when | bool"
  14. - name: Ensure go-neb config installed
  15. ansible.builtin.copy:
  16. content: "{{ matrix_bot_go_neb_configuration | to_nice_yaml(indent=2, width=999999) }}"
  17. dest: "{{ matrix_bot_go_neb_config_path }}/config.yaml"
  18. mode: 0644
  19. owner: "{{ matrix_user_username }}"
  20. group: "{{ matrix_user_groupname }}"
  21. - name: Ensure go-neb support files installed
  22. ansible.builtin.template:
  23. src: "{{ role_path }}/templates/{{ item }}.j2"
  24. dest: "{{ matrix_bot_go_neb_base_path }}/{{ item }}"
  25. mode: 0640
  26. owner: "{{ matrix_user_username }}"
  27. group: "{{ matrix_user_groupname }}"
  28. with_items:
  29. - env
  30. - labels
  31. - name: Ensure go-neb container network is created
  32. community.general.docker_network:
  33. name: "{{ matrix_bot_go_neb_container_network }}"
  34. driver: bridge
  35. - name: Ensure go-neb container image is pulled
  36. community.docker.docker_image:
  37. name: "{{ matrix_bot_go_neb_container_image }}"
  38. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  39. force_source: "{{ matrix_bot_go_neb_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  40. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_go_neb_container_image_force_pull }}"
  41. register: result
  42. retries: "{{ devture_playbook_help_container_retries_count }}"
  43. delay: "{{ devture_playbook_help_container_retries_delay }}"
  44. until: result is not failed
  45. - name: Ensure matrix-bot-go-neb.service installed
  46. ansible.builtin.template:
  47. src: "{{ role_path }}/templates/systemd/matrix-bot-go-neb.service.j2"
  48. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-go-neb.service"
  49. mode: 0644