Matrix Docker Ansible eploy
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

86 linhas
3.5 KiB

  1. # SPDX-FileCopyrightText: 2022 - 2024 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2022 Julian-Samuel Gebühr
  3. # SPDX-FileCopyrightText: 2022 MDAD project contributors
  4. # SPDX-FileCopyrightText: 2022 Sebastian Gumprich
  5. # SPDX-FileCopyrightText: 2024 David Mehren
  6. #
  7. # SPDX-License-Identifier: AGPL-3.0-or-later
  8. ---
  9. - name: Ensure matrix_ldap_registration_proxy paths exist
  10. ansible.builtin.file:
  11. path: "{{ item.path }}"
  12. state: directory
  13. mode: '0750'
  14. owner: "{{ matrix_user_name }}"
  15. group: "{{ matrix_group_name }}"
  16. with_items:
  17. - {path: "{{ matrix_ldap_registration_proxy_config_path }}", when: true}
  18. - {path: "{{ matrix_ldap_registration_proxy_docker_src_files_path }}", when: true}
  19. when: "item.when | bool"
  20. - name: Ensure matrix_ldap_registration_proxy repository is present on self-build
  21. ansible.builtin.git:
  22. repo: "{{ matrix_ldap_registration_proxy_container_image_self_build_repo }}"
  23. dest: "{{ matrix_ldap_registration_proxy_docker_src_files_path }}"
  24. version: "{{ matrix_ldap_registration_proxy_container_image_self_build_branch }}"
  25. force: "yes"
  26. become: true
  27. become_user: "{{ matrix_user_name }}"
  28. register: matrix_ldap_registration_proxy_git_pull_results
  29. - name: Ensure matrix_ldap_registration_proxy Docker image is built
  30. community.docker.docker_image:
  31. name: "{{ matrix_ldap_registration_proxy_docker_image }}"
  32. source: build
  33. force_source: "{{ matrix_ldap_registration_proxy_git_pull_results.changed }}"
  34. build:
  35. dockerfile: Dockerfile
  36. path: "{{ matrix_ldap_registration_proxy_docker_src_files_path }}"
  37. pull: true
  38. when: true
  39. - name: Ensure matrix_ldap_registration_proxy config installed
  40. ansible.builtin.template:
  41. src: "{{ role_path }}/templates/ldap-registration-proxy.env.j2"
  42. dest: "{{ matrix_ldap_registration_proxy_config_path }}/ldap-registration-proxy.env"
  43. mode: '0644'
  44. owner: "{{ matrix_user_name }}"
  45. group: "{{ matrix_group_name }}"
  46. register: matrix_ldap_registration_proxy_config_result
  47. - name: Ensure matrix-ldap-registration-proxy support files installed
  48. ansible.builtin.template:
  49. src: "{{ role_path }}/templates/{{ item }}.j2"
  50. dest: "{{ matrix_ldap_registration_proxy_base_path }}/{{ item }}"
  51. mode: '0640'
  52. owner: "{{ matrix_user_name }}"
  53. group: "{{ matrix_group_name }}"
  54. with_items:
  55. - labels
  56. register: matrix_ldap_registration_proxy_support_files_result
  57. - name: Ensure matrix-ldap-registration-proxy container network is created
  58. community.general.docker_network:
  59. enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
  60. name: "{{ matrix_ldap_registration_proxy_container_network }}"
  61. driver: bridge
  62. driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
  63. - name: Ensure matrix-ldap-registration-proxy.service installed
  64. ansible.builtin.template:
  65. src: "{{ role_path }}/templates/systemd/matrix-ldap-registration-proxy.service.j2"
  66. dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-ldap-registration-proxy.service"
  67. mode: '0644'
  68. register: matrix_ldap_registration_proxy_systemd_service_result
  69. - name: Determine whether matrix-ldap-registration-proxy needs a restart
  70. ansible.builtin.set_fact:
  71. matrix_ldap_registration_proxy_restart_necessary: >-
  72. {{
  73. matrix_ldap_registration_proxy_config_result.changed | default(false)
  74. or matrix_ldap_registration_proxy_support_files_result.changed | default(false)
  75. or matrix_ldap_registration_proxy_systemd_service_result.changed | default(false)
  76. }}