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.
 
 

58 regels
2.3 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 image is pulled
  32. community.docker.docker_image:
  33. name: "{{ matrix_bot_go_neb_container_image }}"
  34. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  35. force_source: "{{ matrix_bot_go_neb_container_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  36. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_go_neb_container_image_force_pull }}"
  37. register: result
  38. retries: "{{ devture_playbook_help_container_retries_count }}"
  39. delay: "{{ devture_playbook_help_container_retries_delay }}"
  40. until: result is not failed
  41. - name: Ensure go-neb container network is created
  42. community.general.docker_network:
  43. enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
  44. name: "{{ matrix_bot_go_neb_container_network }}"
  45. driver: bridge
  46. driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
  47. - name: Ensure matrix-bot-go-neb.service installed
  48. ansible.builtin.template:
  49. src: "{{ role_path }}/templates/systemd/matrix-bot-go-neb.service.j2"
  50. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-go-neb.service"
  51. mode: 0644