Ansible collection that comes with a role for finding a working set of ssh connection parameters amongst multiple specified parameters.
This role finds a working set of ssh parameters by trying out Ansible's regular ssh parameters and the parameters specified in this role's variables.
sshjuggle tests all possible combinations of the connection parameters in parallel, and the role proceeds with updating the connection parameters to the working ones as soon as a working set of parameters are found.
Since Ansible tries to connect to the host
and gather facts before any roles are applied,
Ansible's gathering option
should be set to explicit
.
This role will trigger fact gathering after setting the connection parameters,
a behaviour that can be controlled by the sshjuggle_gather_facts
variable.
Variable | Default | Description |
---|---|---|
sshjuggle_ports |
[ 22 ] |
Ports to try in addition to the default port parameter. |
sshjuggle_hosts |
[] |
Hosts to try in addition to the default host parameter. |
sshjuggle_users |
[] |
Users to try in addition to the default user parameter. |
sshjuggle_passwords |
[] |
Passwords to try in addition to the default password parameter. |
sshjuggle_private_key_files |
[] |
Private key files to try in addition to the default private key file parameter. |
sshjuggle_gather_facts |
true |
Whether to trigger Ansible's fact gathering at the end of the role. |
sshjuggle_fail |
true |
Whether to fail if sshjuggle fails to connect to the host. |
sshjuggle_max_jobs |
100 |
Maximum number of simultaneous jobs to use for testing out parameters. Set to a lower number if your system is hitting the process count limit. |
Example requirements.yml file:
collections:
- name: https://github.com/koonix/ansible-sshjuggle
type: git
version: 0.1.7
Example usage in a playbook:
- name: Roles
hosts: all
roles:
- { role: koonix.sshjuggle.sshjuggle, tags: always }
- ...