On 12 September 2018 at 14:45, Madushan Chathuranga
<
mchath...@gmail.com> wrote:
>
> Hi,
>
> This is to connect to the remote host. I'm aware that we can do something similar to this,
> ansible-playbook -i hosts.yml --private-key=private_key_path ansible_script.yml
>
> also, I know we can use the private key in the inventory host_vars as ansible_ssh_private_key
> but why ansible doesn't provide a option to manage private_key's password if it allows to use a private_key.
I'm speculating here, but I think it's because providing passwords
directly to ansible on the command line is more insecure than
necessary.
All password/authentication invocations (private keys, vault
passwords, password prompts) seem to be done either through a prompt,
or by pointing to a file containing the password.
So instead of supplying a password on the command line to use an
encrypted private key, you are encouraged to use a non-encrypted
private key.
Again, this is my guess...
Dick