ansible-sshd
ansible-sshd copied to clipboard
Hangs on RHEL based systems when there is no internet connection
The task Install ssh packages
hangs on RHEL based systems
The packages in the list sshd_packages
were present on the system(s)
I think This is because it's trying to update the package cache
Tested on:
- AlmaLinux 8
- Fedora server 36
- Ubuntu 20.04
What would be the preferred way to fix this?
- Adding
when: sshd_packages|length>0
so that users can just set it to [] - Adding an extra option
- ...
I don't mind doing it myself once I know what is prefered
Thank you for the report. The task "Install ssh packages" invokes ansible.builtin.package
so I assume this hang happens inside of the standard module and there should be some timeout so I would consider reporting it to ansible.
For this role, we should probably have some way around this. Adding when: sshd_packages | length>0
sounds to me like a good solution, but I would like to wait for feedback from others before settling on some definite solution.
IMO this should not be handled by the sshd role - it is something that should be configured when doing general system provisioning or configuration, or perhaps by using a special role/module to manage the packaging system on the remote system e.g. https://www.golinuxhub.com/2014/11/how-to-use-yum-locally-without-internet/
I agree with @richm - this is a system wide setting that will impact other software installations too. If the host system cannot connect to the Internet it should not try.