Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • Switch user without root

    Posted on

    If the individual id on the target host can switch to functional id but cannot switch to root user how to switch to functional id using Ansible.

    Tried below code but it is not working:
    become: yes
    become_user: apache

    with below error

    FAILED! => {"changed": false, "module_stderr": "Shared connection to ab.c.d closed.\r\n", "module_stdout": "sudo: a password is required\r\n", "msg": "MODULE FAILURE", "rc": 1}

    but on the server individual id can switch to apache user without entering password.

    I tried without "become: yes" also it is not working.
    Tried using become_method as su also but not working.

    Please advice.

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2025 Red Hat