Scenario:
Trying to execute a yum command on a server.
Yum command looks like:
---
- name: upgrade all packages
yum:
name: '*'
state: latest
become: true
This task fails with the return code: you must be root to perform this
action.
This error code is generally associated with not sudoing properly.
If I manually log into the server, I can sudo yum <command> just fine.
Passwordless sudo is setup so that a password isn't needed.
if I specify the user and method, like so:
---
- name: upgrade all packages
yum:
name: '*'
state: latest
become: true
become_method: sudo
become_user: root
It still fails. What am I missing?
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/e9182c72-b206-40bf-8152-6ac0651e5c14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.