Ansible, when driven by a user with MFA, needs to give the verification code asked by sshd from the target host. I can type it in, but when a playbooks runs for many hosts, I would need to type as many times as my hosts.
I am looking for something like:
yes 101010 | ansible-playbooks playbook.yaml
where 101010
is the verification code (which is the same for all the hosts).
The ansible commands can handle variable arguments with the
-e
switch.By example :
The variable
verif
will be accessible in ansible code