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.
 
 
 

124 lines
5.4 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: hookshot-${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. options:
  27. # The role's `tasks/main.yml` opens with a block tagged
  28. # `reset-hookshot-encryption`, and Ansible runs tagged tasks unless tags are
  29. # actually selected - so a tagless play (which is what Molecule runs) hits
  30. # it. It stops `matrix-hookshot.service` before that service exists, which
  31. # fails on a fresh host. Skipping the tag is what the playbook effectively
  32. # does by always running with `--tags=setup-all,start`.
  33. #
  34. # `molecule-notest,notest` are Molecule's own defaults, repeated here
  35. # because this key replaces them rather than adding to them.
  36. skip-tags: molecule-notest,notest,reset-hookshot-encryption
  37. inventory:
  38. group_vars:
  39. all:
  40. matrix_bridge_hookshot_container_network: hookshot-molecule
  41. # The stub prepare.yml stands up. Hookshot contacts it while starting;
  42. # it is not a real homeserver and nothing is asserted about it.
  43. matrix_bridge_hookshot_homeserver_address: http://matrix.molecule.local:8008
  44. # Appservice tokens. These are what Hookshot and the homeserver would
  45. # authenticate to each other with; here they only have to reach the
  46. # rendered configuration and the registration file.
  47. matrix_bridge_hookshot_appservice_token: molecule_as_token_4f2a91
  48. matrix_bridge_hookshot_homeserver_token: molecule_hs_token_9b3e77
  49. # Deliberately different from the role's default (`hookshot`), so the
  50. # registration's sender_localpart can only have come from the role.
  51. # prepare.yml tells the homeserver stub to claim this same user id.
  52. matrix_bridge_hookshot_bot_localpart: molecule-hookshot
  53. # Hookshot's HTTP surface is the point of this scenario. Every port
  54. # below differs from BOTH the role's default and Hookshot's own, so an
  55. # answer on one of them can only mean the role's configuration reached
  56. # the process. verify.yml also asserts that nothing answers on the
  57. # defaults these replace (9993 appservice, 9000 webhooks, 9001 metrics).
  58. matrix_bridge_hookshot_appservice_port: 9772
  59. matrix_bridge_hookshot_webhook_port: 9741
  60. # Off in the role's defaults. Enabling it makes the role render a second
  61. # entry in Hookshot's `listeners` list, which is the cheapest listener to
  62. # assert *content* on: /metrics answers in a format nothing else would.
  63. matrix_bridge_hookshot_metrics_enabled: true
  64. matrix_bridge_hookshot_metrics_port: 9752
  65. # On in the role's defaults. Turned off here so that the absence of a
  66. # listener can be asserted too - the widgets port staying closed is what
  67. # tells "the role rendered the listener list" apart from "Hookshot binds
  68. # everything anyway".
  69. matrix_bridge_hookshot_widgets_enabled: false
  70. # No third-party service is configured in this scenario - see the header
  71. # of verify.yml. GitLab is the one the role enables by default, so it is
  72. # explicitly switched off and its absence from the rendered config and
  73. # registration is asserted.
  74. matrix_bridge_hookshot_gitlab_enabled: false
  75. # The generic webhooks listener is the only part of Hookshot that needs
  76. # no account anywhere, so it is what this scenario exercises live. The
  77. # prefix differs from the role's default (`_webhooks_`).
  78. matrix_bridge_hookshot_generic_userIdPrefix: _molecule_hook_ # noqa var-naming
  79. # Neither the role's default (600) nor Hookshot's own (600).
  80. matrix_bridge_hookshot_feeds_pollIntervalSeconds: 907 # noqa var-naming
  81. # The role defaults to `warn`; Hookshot itself defaults to `info`. This
  82. # is a third value, so finding it in config.yml cannot be a coincidence.
  83. matrix_bridge_hookshot_logging_level: debug
  84. # Traefik is not deployed here, so the labels the role would render for
  85. # it are switched off and their absence is asserted instead.
  86. matrix_bridge_hookshot_container_labels_traefik_enabled: false
  87. # verify.yml runs as its own play, where role defaults are out of scope,
  88. # so what it reads is pinned here. These two match the role's own
  89. # defaults on purpose - they name things (a path, a container) rather
  90. # than configure them, and nothing is asserted *about* them.
  91. matrix_bridge_hookshot_base_path: /matrix/hookshot
  92. matrix_bridge_hookshot_identifier: matrix-hookshot
  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