https://github.com/koonix/ansible-sshjuggle
Ansible role for finding a working set of ssh connection parameters amongst multiple.
https://github.com/koonix/ansible-sshjuggle
ansible ansible-collection
Last synced: over 1 year ago
JSON representation
Ansible role for finding a working set of ssh connection parameters amongst multiple.
- Host: GitHub
- URL: https://github.com/koonix/ansible-sshjuggle
- Owner: koonix
- License: mit
- Created: 2024-01-14T14:12:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-29T22:57:54.000Z (over 2 years ago)
- Last Synced: 2024-01-30T00:41:16.714Z (over 2 years ago)
- Topics: ansible, ansible-collection
- Language: Shell
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ansible-sshjuggle
[](https://github.com/koonix/ansible-sshjuggle/tags)
Ansible collection that comes with a role
for finding a working set of ssh connection parameters
amongst multiple specified parameters.
## Roles
### sshjuggle
This role finds a working set of ssh parameters
by trying out Ansible's [regular ssh parameters](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ssh_connection.html)
*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](https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-gathering)
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](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ssh_connection.html#parameter-port). |
| `sshjuggle_hosts` | `[]` | Hosts to try in addition to the [default host parameter](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ssh_connection.html#parameter-host). |
| `sshjuggle_users` | `[]` | Users to try in addition to the [default user parameter](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ssh_connection.html#parameter-remote_user). |
| `sshjuggle_passwords` | `[]` | Passwords to try in addition to the [default password parameter](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ssh_connection.html#parameter-password). |
| `sshjuggle_private_key_files` | `[]` | Private key files to try in addition to the [default private key file parameter](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ssh_connection.html#parameter-private_key_file). |
| `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. |
#### Usage
Example [requirements.yml](https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#installing-roles-and-collections-from-the-same-requirements-yml-file]) file:
```yaml
collections:
- name: https://github.com/koonix/ansible-sshjuggle
type: git
version: 0.1.7
```
Example usage in a playbook:
```yaml
- name: Roles
hosts: all
roles:
- { role: koonix.sshjuggle.sshjuggle, tags: always }
- ...
```