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.
 
 
 

57 lines
1.7 KiB

  1. # SPDX-FileCopyrightText: 2026 Slavi Pantaleev
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. ---
  5. - name: Prepare matrix-client-element Molecule tests
  6. hosts: all
  7. become: true
  8. vars_files:
  9. - "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') }}/../../../molecule-shared/playbook-context.yml"
  10. gather_facts: true
  11. tasks:
  12. - name: Ensure apt cache is updated
  13. ansible.builtin.apt:
  14. update_cache: true
  15. cache_valid_time: 600
  16. when: ansible_facts['os_family'] == 'Debian'
  17. - name: Ensure required packages are installed
  18. ansible.builtin.package:
  19. name:
  20. - python3-requests
  21. - fuse-overlayfs
  22. state: present
  23. - name: Ensure Docker is installed
  24. ansible.builtin.include_role:
  25. name: ansible-role-docker
  26. vars:
  27. docker_daemon_options:
  28. storage-driver: fuse-overlayfs
  29. # The role's file tasks resolve owner and group by name. matrix-base creates
  30. # these during a real deployment, so the scenario supplies that prerequisite.
  31. - name: Ensure the matrix group exists
  32. ansible.builtin.group:
  33. name: "{{ matrix_group_name }}"
  34. gid: "{{ matrix_user_gid }}"
  35. state: present
  36. - name: Ensure the matrix user exists
  37. ansible.builtin.user:
  38. name: "{{ matrix_user_name }}"
  39. uid: "{{ matrix_user_uid }}"
  40. group: "{{ matrix_group_name }}"
  41. create_home: false
  42. system: true
  43. state: present
  44. - name: Ensure the base data path exists
  45. ansible.builtin.file:
  46. path: "{{ matrix_base_data_path }}"
  47. state: directory
  48. owner: "{{ matrix_user_name }}"
  49. group: "{{ matrix_group_name }}"
  50. mode: "0750"