Matrix Docker Ansible eploy
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

71 satır
3.5 KiB

  1. ---
  2. - name: Ensure matrix-registration-bot 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_matrix_registration_bot_config_path }}", when: true}
  11. - {path: "{{ matrix_bot_matrix_registration_bot_data_path }}", when: true}
  12. - {path: "{{ matrix_bot_matrix_registration_bot_docker_src_files_path }}", when: "{{ matrix_bot_matrix_registration_bot_container_image_self_build }}"}
  13. when: "item.when | bool"
  14. - name: Ensure matrix-registration-bot configuration file created
  15. ansible.builtin.template:
  16. src: "{{ role_path }}/templates/config.yaml.j2"
  17. dest: "{{ matrix_bot_matrix_registration_bot_config_path }}/config.yaml"
  18. owner: "{{ matrix_user_username }}"
  19. group: "{{ matrix_user_groupname }}"
  20. mode: 0640
  21. - name: Ensure matrix-registration-bot image is pulled
  22. community.docker.docker_image:
  23. name: "{{ matrix_bot_matrix_registration_bot_docker_image }}"
  24. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  25. force_source: "{{ matrix_bot_matrix_registration_bot_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  26. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_matrix_registration_bot_docker_image_force_pull }}"
  27. when: "not matrix_bot_matrix_registration_bot_container_image_self_build | bool"
  28. register: result
  29. retries: "{{ devture_playbook_help_container_retries_count }}"
  30. delay: "{{ devture_playbook_help_container_retries_delay }}"
  31. until: result is not failed
  32. - when: matrix_bot_matrix_registration_bot_container_image_self_build | bool
  33. block:
  34. - name: Ensure matrix-registration-bot repository is present on self-build
  35. ansible.builtin.git:
  36. repo: "{{ matrix_bot_matrix_registration_bot_docker_repo }}"
  37. version: "{{ matrix_bot_matrix_registration_bot_docker_repo_version }}"
  38. dest: "{{ matrix_bot_matrix_registration_bot_docker_src_files_path }}"
  39. force: "yes"
  40. become: true
  41. become_user: "{{ matrix_user_username }}"
  42. register: matrix_bot_matrix_registration_bot_git_pull_results
  43. - name: Ensure matrix-registration-bot image is built
  44. community.docker.docker_image:
  45. name: "{{ matrix_bot_matrix_registration_bot_docker_image }}"
  46. source: build
  47. force_source: "{{ matrix_bot_matrix_registration_bot_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  48. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_matrix_registration_bot_git_pull_results.changed }}"
  49. build:
  50. dockerfile: Dockerfile
  51. path: "{{ matrix_bot_matrix_registration_bot_docker_src_files_path }}"
  52. pull: true
  53. - name: Ensure matrix-registration-bot container network is created
  54. community.general.docker_network:
  55. enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
  56. name: "{{ matrix_bot_matrix_registration_bot_container_network }}"
  57. driver: bridge
  58. driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
  59. - name: Ensure matrix-bot-matrix-registration-bot.service installed
  60. ansible.builtin.template:
  61. src: "{{ role_path }}/templates/systemd/matrix-bot-matrix-registration-bot.service.j2"
  62. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-matrix-registration-bot.service"
  63. mode: 0644