Matrix Docker Ansible eploy
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

69 lignes
2.5 KiB

  1. ---
  2. # (#1510)
  3. # - import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_openssl_installed.yml"
  4. - name: Ensure hookshot image is pulled
  5. docker_image:
  6. name: "{{ matrix_hookshot_docker_image }}"
  7. source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
  8. force_source: "{{ matrix_hookshot_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
  9. force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_hookshot_docker_image_force_pull }}"
  10. - name: Ensure hookshot paths exist
  11. file:
  12. path: "{{ item }}"
  13. state: directory
  14. mode: 0750
  15. owner: "{{ matrix_user_username }}"
  16. group: "{{ matrix_user_groupname }}"
  17. with_items:
  18. - "{{ matrix_hookshot_base_path }}"
  19. - name: Check if hookshot passkey exists
  20. stat:
  21. path: "{{ matrix_hookshot_base_path }}/passkey.pem"
  22. register: hookshot_passkey_file
  23. - name: Generate hookshot passkey if it doesn't exist
  24. shell: "{{ matrix_host_command_openssl }} genpkey -out {{ matrix_hookshot_base_path }}/passkey.pem -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:4096"
  25. become: true
  26. become_user: "{{ matrix_user_username }}"
  27. when: "not hookshot_passkey_file.stat.exists"
  28. - name: Ensure hookshot config.yaml installed if provided
  29. copy:
  30. content: "{{ matrix_hookshot_configuration|to_nice_yaml }}"
  31. dest: "{{ matrix_hookshot_base_path }}/config.yaml"
  32. mode: 0644
  33. owner: "{{ matrix_user_username }}"
  34. group: "{{ matrix_user_groupname }}"
  35. - name: Ensure hookshot registration.yaml installed if provided
  36. copy:
  37. content: "{{ matrix_hookshot_registration|to_nice_yaml }}"
  38. dest: "{{ matrix_hookshot_base_path }}/registration.yaml"
  39. mode: 0644
  40. owner: "{{ matrix_user_username }}"
  41. group: "{{ matrix_user_groupname }}"
  42. - name: Ensure hookshot github private key file installed if github is enabled
  43. copy:
  44. src: github-key.pem
  45. dest: "{{ matrix_hookshot_base_path }}/{{ matrix_hookshot_github_private_key }}"
  46. mode: 0600
  47. owner: "{{ matrix_user_username }}"
  48. group: "{{ matrix_user_groupname }}"
  49. - name: Ensure matrix-hookshot.service installed
  50. template:
  51. src: "{{ role_path }}/templates/systemd/matrix-hookshot.service.j2"
  52. dest: "{{ matrix_systemd_path }}/matrix-hookshot.service"
  53. mode: 0644
  54. register: matrix_hookshot_systemd_service_result
  55. - name: Ensure systemd reloaded after matrix-hookshot.service installation
  56. service:
  57. daemon_reload: yes
  58. when: matrix_hookshot_systemd_service_result.changed