Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if multiple tunnels then only last is enabled/restarted #78

Open
hmoffatt opened this issue Oct 24, 2024 · 1 comment
Open

if multiple tunnels then only last is enabled/restarted #78

hmoffatt opened this issue Oct 24, 2024 · 1 comment

Comments

@hmoffatt
Copy link
Contributor

I've defined two tunnels in my configuration (due to #73). The role configures both, but the systemd service for the first one is never enabled or restarted.

I believe this is because the handler is not looping over the tunnels, but just using the tunnel_name fact set here: https://github.com/papanito/ansible-role-cloudflared/blob/main/tasks/configure_tunnels.yml#L2 . That fact is overwritten by the last tunnel through the loop.

@hmoffatt
Copy link
Contributor Author

I've fixed this for the systemd case here, risingsoftware@e3cd499 , but the sysv-init case is more complicated because there are already loops in there for multiple runlevels.

As I can't test that myself I haven't tried to fix it. You'd have to use a nested loop of some form as in https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html#nested-loops

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant