- Ansible installed:
sudo apt install python3
python3 -m ensurepip --upgrade
pip3 install ansible
Review the variables as shown in defaults.
ssh_keygen_storagedir: "~/.ssh" # where to save generated key
ssh_keygen_keyname: "ed25519" # filename of key
ssh_keygen_cipher: "ed25519" # passed to -t, values are dsa | ecdsa | ecdsa-sk | ed25519 | ed25519-sk | rsa
ssh_keygen_cipher_options: "" # cipher options addtional args to pass when generating keys
ssh_keygen_comment: "" # Comment to set in the key
ssh_keygen_passphrase: "" # Optionally pass a passphrase to generated key (to not prompt for one)
hosts:
- foo
roles:
- pimvh.ssh_keygen
- Generate ssh key
- Add public key as fact
- Add variable assertions
- Use community library instead for key generation