When you install ubuntu it will create a user in the sudoers group for you. If you are using that user to ssh in then elevating to root with sudo you enter the password for that user.
Same with ansible, if you are using the user you created you’d use that users password to authenticate with become. You can also set up ssh keys so you can ssh without a password and set up passwordless sudo for your ansible user. From: ansible-project@googlegroups.com <ansible-project@googlegroups.com> On Behalf Of Lomic Legone Sent: 07 May 2021 10:40 To: Ansible Project <ansible-project@googlegroups.com> Subject: [ansible-project] Is it possible to use ansible without root password ? Hi all, I'm a newbee on ansible and I follow online tutos. I installed 2 ubuntu VM (named ubunt1 and ubunt2), one as node manager (ubuntu1) and the second one as simple node (ubuntu2). The ssh connection is tested and ok. When I installed ubuntu, I've never been asked for a root password, but only for the name/password for a simple user. But this user belongs to sudoers group so it can make admin tasks. So all is ok. The pb is that as I try to execute root tasks from ubuntu1 to ubuntu2 with ansible, even if ubuntu2 user belongs to sudoers groups, ansible fails. And if I use the "-become" option, ansible asks me the ubuntu2 root password that I don't know of course. In fact I feel that the fact that ubuntu2 user has sudo privilege is useless. So how to do ? Thanks for your responses. -- 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 ansible-project+unsubscr...@googlegroups.com<mailto:ansible-project+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/bcf355f1-73a0-4228-ab02-75105617672bn%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/bcf355f1-73a0-4228-ab02-75105617672bn%40googlegroups.com?utm_medium=email&utm_source=footer>. -- Stuart Lowe Cloud and Hosting Support Engineer Zen Internet Team: 01706 902009 Web: zen.co.uk Proud to be a certified B Corporation This message is private and confidential. If you have received this message in error, please notify us and remove it from your system. Zen Internet Limited may monitor email traffic data to manage billing, to handle customer enquiries and for the prevention and detection of fraud. We may also monitor the content of emails sent to and/or from Zen Internet Limited for the purposes of security, staff training and to monitor quality of service. Zen Internet Limited is registered in England and Wales, Sandbrook Park, Sandbrook Way, Rochdale, OL11 1RY Company No. 03101568 VAT Reg No. 686 0495 01 -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/VI1PR01MB4317BA54E504B3EADAB78D3CA8579%40VI1PR01MB4317.eurprd01.prod.exchangelabs.com.