gitea_container_additional_networks_custom variable is not used/working
Closed this issue · 2 comments
Hi,
I'm trying to use the mash-exim-relay in Gitea. After realizing that they are not in the same network, I tried to add Gitea to the mash-exim-relay
-network with the gitea_container_additional_networks_custom
variable. => this is not working.
Somehow the custom variable is not used in the run of the playbook. I tested it by adding
- name: Debug custom network configuration
debug:
msg: "Error: custom: {{ gitea_container_additional_networks_custom }} all: {{ gitea_container_additional_networks }}"
at the end of roles/gitea/tasks/install.yml
.
The custom networks is not added to gitea_container_additional_networks
, like it is configured here (ansible-role-gitea/defaults/main.yml
):
# A list of additional container networks that the container would be connected to.
# The playbook does not create these networks, so make sure they already exist.
gitea_container_additional_networks: "{{ gitea_container_additional_networks_auto + gitea_container_additional_networks_custom }}"
# gitea_container_additional_networks_auto is reserved for usage by the playbook.
# Your custom networks should go into gitea_container_additional_networks_custom.
gitea_container_additional_networks_auto: []
gitea_container_additional_networks_custom: []
Sadly I couldn't get further with my debugging, because I don't understand how you are managing the variables in this playbook. (Maybe a developer documentation would help 😀)
Btw: I also tried it the other way round to add exim-relay to the gitea network, which also didn't work, see this PR.
I've merged that PR. It's good to have exim_relay_container_additional_networks
actually working as expected.
As for integrating Gitea with exim-mailer: for other services, we usually connect the service to exim's network, not the other way around. You can see how it's done for GoToSocial here:
mash-playbook/templates/group_vars_mash_servers
Lines 2025 to 2032 in 7ad6712
and here:
mash-playbook/templates/group_vars_mash_servers
Lines 2044 to 2048 in 7ad6712
This hasn't been done for the Gitea (and Forgejo) components.
We should refer to the Using SMTP configuration documentation for Gitea and introduce new Ansible variables (e.g. gitea_config_mailer_enabled
, gitea_config_mailer_from
, etc.) which confgure their equivalent environment variables (GITEA__mailer__ENABLED
, GITEA__mailer__FROM
, etc.) in Gitea's env.j2
file.
With these variables in place and working, we can update templates/group_vars_mash_servers
in a similar way and wire Gitea to use exim-relay
automatically.