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.
 
 
 

113 line
5.2 KiB

  1. # SPDX-FileCopyrightText: 2026 Slavi Pantaleev
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. ---
  5. dependency:
  6. name: galaxy
  7. options:
  8. requirements-file: requirements.yml
  9. force: true
  10. driver:
  11. name: docker
  12. platforms:
  13. - name: mautrix-meta-messenger-${MOLECULE_DISTRO:-ubuntu2604}-default
  14. image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2604}-ansible:latest"
  15. command: ${MOLECULE_DOCKER_COMMAND:-""}
  16. volumes:
  17. - /sys/fs/cgroup:/sys/fs/cgroup:rw
  18. cgroupns_mode: host
  19. privileged: true
  20. pre_build_image: true
  21. provisioner:
  22. name: ansible
  23. config_options:
  24. defaults:
  25. callback_result_format: yaml
  26. inventory:
  27. group_vars:
  28. all:
  29. matrix_bridge_mautrix_meta_messenger_container_network: mautrix-meta-messenger-molecule
  30. # The homeserver stub prepare.yml stands up. The bridge contacts it
  31. # while starting; it is not a real homeserver and nothing is asserted
  32. # about it.
  33. matrix_bridge_mautrix_meta_messenger_homeserver_address: http://matrix.molecule.local:8008
  34. matrix_bridge_mautrix_meta_messenger_homeserver_domain: molecule.local
  35. # sqlite keeps the scenario to one container. The role only requires a
  36. # database hostname when the engine is postgres, and testing which
  37. # database engine the bridge can talk to is not what this proves.
  38. matrix_bridge_mautrix_meta_messenger_database_engine: sqlite3-fk-wal
  39. # The URI the role derives for `sqlite3-fk-wal` is deliberately NOT
  40. # overridden here. It used to build `sqlite:///` + the in-container path,
  41. # which go-sqlite3 takes as a plain filename rather than parsing as a URL,
  42. # so the bridge died at startup with `unable to open database file`. This
  43. # scenario is what caught it. Leaving the role's own value in place is
  44. # what keeps it caught.
  45. # Appservice tokens. These are what the bridge and homeserver would
  46. # authenticate to each other with; here they only have to reach the
  47. # rendered configuration and the registration file.
  48. matrix_bridge_mautrix_meta_messenger_appservice_token: molecule_meta_as_token_5c81de
  49. matrix_bridge_mautrix_meta_messenger_homeserver_token: molecule_meta_hs_token_a70f24
  50. # The one variable that makes this role family unusual: a single
  51. # upstream codebase serves several Meta networks, and this variable is
  52. # what picks which one. It reaches the rendered configuration in several
  53. # places at once - the appservice id, the ghost username prefix, the bot
  54. # displayname and the bridge's `tor` switch - so a value other than the
  55. # role's default `messenger` is what tells verify.yml that the role
  56. # propagated the choice rather than everything merely agreeing by
  57. # accident. `facebook-tor` is the only one of the three modes that also
  58. # flips a boolean in the configuration, which is why it is the one used.
  59. #
  60. # Nothing logs in during the scenario, so the bridge never opens a
  61. # connection to Meta (over Tor or otherwise). See docs/molecule-testing.md
  62. # for why a scenario stops short of that.
  63. matrix_bridge_mautrix_meta_messenger_meta_mode: facebook-tor
  64. # Deliberately different from the role's defaults (`messengerbot`,
  65. # `!fb`, `(FB)`, `warn`) and from what the bridge would pick on its own,
  66. # so verify.yml can tell what the role rendered apart from a
  67. # coincidence.
  68. matrix_bridge_mautrix_meta_messenger_appservice_username: molecule-metabot
  69. matrix_bridge_mautrix_meta_messenger_bridge_command_prefix: "!molecule-meta"
  70. matrix_bridge_mautrix_meta_messenger_bridge_displayname_suffix: "(Molecule)"
  71. matrix_bridge_mautrix_meta_messenger_logging_min_level: debug
  72. # The bridge's HTTP API exposure. Traefik is not deployed here, so
  73. # nothing routes to it; what is being tested is that the role turns
  74. # these three variables into both the container's Traefik labels and the
  75. # `appservice.public_address` the bridge itself reads.
  76. matrix_bridge_mautrix_meta_messenger_exposure_enabled: true
  77. matrix_bridge_mautrix_meta_messenger_exposure_hostname: bridges.molecule.local
  78. matrix_bridge_mautrix_meta_messenger_exposure_path_prefix: /bridges/meta-messenger
  79. matrix_bridge_mautrix_meta_messenger_scheme: https
  80. # verify.yml runs as its own play, where role defaults are out of scope,
  81. # so the paths it reads are pinned here as literals matching what the
  82. # role derives from matrix_base_data_path.
  83. matrix_bridge_mautrix_meta_messenger_base_path: /matrix/mautrix-meta-messenger
  84. matrix_bridge_mautrix_meta_messenger_config_path: /matrix/mautrix-meta-messenger/config
  85. matrix_bridge_mautrix_meta_messenger_data_path: /matrix/mautrix-meta-messenger/data
  86. env:
  87. # Workaround for https://github.com/ansible/molecule/issues/4391
  88. ANSIBLE_ROLES_PATH: ${MOLECULE_PROJECT_DIRECTORY}/../..:/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:${ANSIBLE_HOME:-~/.ansible}/roles
  89. scenario:
  90. test_sequence:
  91. - dependency
  92. - cleanup
  93. - destroy
  94. - syntax
  95. - create
  96. - prepare
  97. - converge
  98. - idempotence
  99. - verify
  100. - cleanup
  101. - destroy
  102. verifier:
  103. name: ansible