sap.sap_operations.ssh_keys_distribute role – Generate and distribute ssh keys for host to host communication
Note
This role is part of the sap.sap_operations collection.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it use: ansible-galaxy collection install sap.sap_operations
.
To use it in a playbook, specify: sap.sap_operations.ssh_keys_distribute
.
Entry point __dependencies__
– Dependencies
Synopsis
Role depend on collection community.crypto
Entry point __examples__
– Example Playbooks
Synopsis
name: Run role ssh_keys_distribute
ansible.builtin.include_role:
name: sap.sap_operations.ssh_keys_distribute
Entry point __license__
– License
Synopsis
GPL-3.0-only
Entry point __limitations__
– Limitations
Synopsis
Entry point main
– Generate and distribute ssh keys for host to host communication
Synopsis
Generate and distribute ssh keys for host to host communication
Role has two modes of operation - present and absent, see variable ssh_keys_distribute_state
If state=present role will ensure that ssh key (see below about key name) is present, key will be generated if absent, key will never be regenerated. After that role will distribute this key to other hosts, see how list of hosts defined below.
If state=absent, role will make sure that key authorization on all hosts is removed. ssh key, even if it was generated will not be removed by the role.
Parameters
Parameter |
Comments |
---|---|
Lists of hosts, where key will be distributed, default value is ansible magic variable ansible_play_hosts |
|
Name of the key to distribute, should not contain ‘*.pub’ Default: |
|
State=present - role will ensure that ssh keys are present (generated) State=absent - role will ensure that ssh key with name defined in variable ssh_keys_distribute_key cannot be used to login to hosts (using user defined in ssh_keys_distribute_user) Choices:
|
|
User for which key if be generated (if required) and distributed to all the hosts ansible_user should be able to sudo to this user Default: |