Matrix Docker Ansible eploy
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

120 righe
5.7 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 is overridden because the one the role derives for
  40. # `sqlite3-fk-wal` does not work: it builds `sqlite:///` + the
  41. # in-container path, and the bridge hands that to go-sqlite3 as a plain
  42. # filename rather than parsing it as a URL, so it dies at startup with
  43. # `unable to open database file: no such file or directory`. The value
  44. # below is the shape the other mautrix roles here use (a bare path;
  45. # compare matrix-bridge-mautrix-signal, which adds the same _txlock the
  46. # bridge warns about when it is missing).
  47. #
  48. # The playbook picks postgres whenever postgres is enabled, which is the
  49. # default, so nothing normally reaches this code path. Left as an
  50. # override rather than a fix: that is a consumer-visible default.
  51. matrix_bridge_mautrix_meta_messenger_appservice_database_uri: "/data/mautrix-meta.db?_txlock=immediate"
  52. # Appservice tokens. These are what the bridge and homeserver would
  53. # authenticate to each other with; here they only have to reach the
  54. # rendered configuration and the registration file.
  55. matrix_bridge_mautrix_meta_messenger_appservice_token: molecule_meta_as_token_5c81de
  56. matrix_bridge_mautrix_meta_messenger_homeserver_token: molecule_meta_hs_token_a70f24
  57. # The one variable that makes this role family unusual: a single
  58. # upstream codebase serves several Meta networks, and this variable is
  59. # what picks which one. It reaches the rendered configuration in several
  60. # places at once - the appservice id, the ghost username prefix, the bot
  61. # displayname and the bridge's `tor` switch - so a value other than the
  62. # role's default `messenger` is what tells verify.yml that the role
  63. # propagated the choice rather than everything merely agreeing by
  64. # accident. `facebook-tor` is the only one of the three modes that also
  65. # flips a boolean in the configuration, which is why it is the one used.
  66. #
  67. # Nothing logs in during the scenario, so the bridge never opens a
  68. # connection to Meta (over Tor or otherwise). See docs/molecule-testing.md
  69. # for why a scenario stops short of that.
  70. matrix_bridge_mautrix_meta_messenger_meta_mode: facebook-tor
  71. # Deliberately different from the role's defaults (`messengerbot`,
  72. # `!fb`, `(FB)`, `warn`) and from what the bridge would pick on its own,
  73. # so verify.yml can tell what the role rendered apart from a
  74. # coincidence.
  75. matrix_bridge_mautrix_meta_messenger_appservice_username: molecule-metabot
  76. matrix_bridge_mautrix_meta_messenger_bridge_command_prefix: "!molecule-meta"
  77. matrix_bridge_mautrix_meta_messenger_bridge_displayname_suffix: "(Molecule)"
  78. matrix_bridge_mautrix_meta_messenger_logging_min_level: debug
  79. # The bridge's HTTP API exposure. Traefik is not deployed here, so
  80. # nothing routes to it; what is being tested is that the role turns
  81. # these three variables into both the container's Traefik labels and the
  82. # `appservice.public_address` the bridge itself reads.
  83. matrix_bridge_mautrix_meta_messenger_exposure_enabled: true
  84. matrix_bridge_mautrix_meta_messenger_exposure_hostname: bridges.molecule.local
  85. matrix_bridge_mautrix_meta_messenger_exposure_path_prefix: /bridges/meta-messenger
  86. matrix_bridge_mautrix_meta_messenger_scheme: https
  87. # verify.yml runs as its own play, where role defaults are out of scope,
  88. # so the paths it reads are pinned here as literals matching what the
  89. # role derives from matrix_base_data_path.
  90. matrix_bridge_mautrix_meta_messenger_base_path: /matrix/mautrix-meta-messenger
  91. matrix_bridge_mautrix_meta_messenger_config_path: /matrix/mautrix-meta-messenger/config
  92. matrix_bridge_mautrix_meta_messenger_data_path: /matrix/mautrix-meta-messenger/data
  93. env:
  94. # Workaround for https://github.com/ansible/molecule/issues/4391
  95. ANSIBLE_ROLES_PATH: ${MOLECULE_PROJECT_DIRECTORY}/../..:/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:${ANSIBLE_HOME:-~/.ansible}/roles
  96. scenario:
  97. test_sequence:
  98. - dependency
  99. - cleanup
  100. - destroy
  101. - syntax
  102. - create
  103. - prepare
  104. - converge
  105. - idempotence
  106. - verify
  107. - cleanup
  108. - destroy
  109. verifier:
  110. name: ansible