Funny this came up, as I just finished a playbook that bounces keys several
times. There are 2 variables you can use in the playbook itself and can be
changed using set_fact:ansible_private_key_file, and
ansible_ssh_private_key_file. Used with the ansible_user or
ansible_ssh_user variables it can be quite handy cycling users or updating
authorized keys mid play.

On Wed, Jan 26, 2022 at 1:07 PM Brian Coca <[email protected]> wrote:

> several ways:
>
> In ssh_config you can:
> Host *
>
> ^ will match all hosts, you can be more/less restrictive than that.
>
> Within ansible there are many ways to supply the key :
>
> [defaults]
> private_key_file = ~/mykeyfile.pem
>
> for a full list see
>
> https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ssh_connection.html#parameters
>
>
>
> --
> ----------
> Brian Coca
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CACVha7fUtaV_O20o6aBvTqNYxHJA1o%2BBQbO_Wq%2BiJcrjwwT5Tg%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAEcFzYwWEy5JaQaAZupCy_wRaq_S5uR7Euc7gkW1%2BFkeFqD%3DyQ%40mail.gmail.com.

Reply via email to