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.
 
 

64 lines
2.5 KiB

  1. ---
  2. - name: Ensure matrix_ldap_registration_proxy 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_ldap_registration_proxy_config_path }}", when: true}
  11. - {path: "{{ matrix_ldap_registration_proxy_docker_src_files_path }}", when: true}
  12. when: "item.when | bool"
  13. - ansible.builtin.set_fact:
  14. matrix_ldap_registration_proxy_requires_restart: false
  15. - name: Ensure matrix_ldap_registration_proxy repository is present on self-build
  16. ansible.builtin.git:
  17. repo: "{{ matrix_ldap_registration_proxy_container_image_self_build_repo }}"
  18. dest: "{{ matrix_ldap_registration_proxy_docker_src_files_path }}"
  19. version: "{{ matrix_ldap_registration_proxy_container_image_self_build_branch }}"
  20. force: "yes"
  21. become: true
  22. become_user: "{{ matrix_user_username }}"
  23. register: matrix_ldap_registration_proxy_git_pull_results
  24. - name: Ensure matrix_ldap_registration_proxy Docker image is built
  25. docker_image:
  26. name: "{{ matrix_ldap_registration_proxy_docker_image }}"
  27. source: build
  28. force_source: "{{ matrix_ldap_registration_proxy_git_pull_results.changed }}"
  29. build:
  30. dockerfile: Dockerfile
  31. path: "{{ matrix_ldap_registration_proxy_docker_src_files_path }}"
  32. pull: true
  33. when: true
  34. - name: Ensure matrix_ldap_registration_proxy config installed
  35. ansible.builtin.template:
  36. src: "{{ role_path }}/templates/ldap-registration-proxy.env.j2"
  37. dest: "{{ matrix_ldap_registration_proxy_config_path }}/ldap-registration-proxy.env"
  38. mode: 0644
  39. owner: "{{ matrix_user_username }}"
  40. group: "{{ matrix_user_groupname }}"
  41. - name: Ensure matrix-ldap-registration-proxy.service installed
  42. ansible.builtin.template:
  43. src: "{{ role_path }}/templates/systemd/matrix-ldap-registration-proxy.service.j2"
  44. dest: "{{ matrix_systemd_path }}/matrix-ldap-registration-proxy.service"
  45. mode: 0644
  46. register: matrix_ldap_registration_proxy_systemd_service_result
  47. - name: Ensure systemd reloaded after matrix-ldap-registration-proxy.service installation
  48. ansible.builtin.service:
  49. daemon_reload: true
  50. when: "matrix_ldap_registration_proxy_systemd_service_result.changed | bool"
  51. - name: Ensure matrix-ldap-registration-proxy.service restarted, if necessary
  52. ansible.builtin.service:
  53. name: "matrix-ldap-registration-proxy.service"
  54. state: restarted
  55. when: "matrix_ldap_registration_proxy_requires_restart | bool"