Been banging my head against this since yesterday, hoping someone is able to shed some insight on my issues.
I have a simple role that I'm trying to install java with:
---
- name: Install JDK
yum:
name: /tmp/jdk.rpm
state: present
This works on my test servers without issue. I am trying to run this on a real server at this point and am running into issues with permissions.
My inventory file is basic:
and my playbook is as follows:
---
- name: Install JDK
hosts: servers
remote_user: myuser
become: true
become_user: myuser
become_method: sudo
become_flags: '-s /bin/sh'
roles:
- jdk
I've tried quite a few different combinations of setting the become_user to nobody, root, leaving it out, and so on, but have had no success. If I login to the server manually and run a sudo yum install /tmp/jdk as 'myuser' it works fine, and the playbook will actually run after (stating there is nothing to change). Does anyone have any suggestions?