Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • Ansible sudo with multifactor authentication

    Posted on

    Hi,

    We use multifactor authenticaton provided by IPA. So for every login/sudo promt we have this kind of prompt (also on machines that doesn't require the second factor):

    First Factor:
    Second Factor (optional):
    

    I would like to run the following Ansible playbook on several computers:

    - hosts: all
      vars_files:
        - secret
      tasks:
        - name: Do something as sudo
          command: whoami
          become_user: root
    

    But it fails to sudo. Even on machines where the second factor is really optional, not needed.

    Can I somehow use Ansible sudo with MFA authentication, where the server doesn't require the second factor?

    Regards,
    Stone

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat