rvm1-ansible icon indicating copy to clipboard operation
rvm1-ansible copied to clipboard

Unprivileged user falls back to ubuntu

Open fcevado opened this issue 7 years ago • 5 comments

Unprivileged user falls back to ubuntu instead of ssh user.

fcevado avatar Mar 29 '17 14:03 fcevado

Having the same issue. It appears so that the playbook user var is being ignored?

./main.yml:

...
    - block:
      - name: install rvm
        include_role:
          name: rvm.ruby
      become: yes
      become_user: user #<---
...

./roles/main.yml:

---
- hosts: all
  - name: Configure servers with ruby support for single user
    roles:
      - { role: rvm.ruby,
          tags: ruby,
          rvm1_rubies: "ruby-2.6.6",
          rvm1_user: "user", #<---
          rvm1_bundler_install: yes,
          rvm1_install_path: '~/.rvm',
          rvm1_rvm_latest_installer: 'https://raw.githubusercontent.com/rvm/rvm/master/binscripts/rvm-installer',
          rvm1_rvm_version: 'stable',
          rvm1_rvm_check_for_updates: yes,
          rvm1_gpg_keys: '409B6B1796C275462A1703113804BB82D39DC0E3',
          rvm1_gpg_key_server: 'hkps://keys.openpgp.org',
          rvm1_autolib_mode: 3
        }
TASK [install rvm] *************************************************************

TASK [rvm.ruby : Detect rvm binary] ********************************************
fatal: [hostname]: FAILED! => {"msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: chmod: invalid mode: 'A+user:ubuntu:rx:allow'\nTry 'chmod --help' for more information.\n}). For information on working around this, see https://docs.ansible.com/ansible/2.11/user_guide/become.html#becoming-an-unprivileged-user"}

vyngur avatar Sep 03 '21 17:09 vyngur

@thbar @sfgeorge what do you think?

pkuczynski avatar Mar 28 '22 20:03 pkuczynski

This is worth investigating.

@fcevado, @vyngur Could you provide more info so we can reproduce this?

This project currently tests successfully against Ubuntu 14.04, 16.04, 18.04 and 20.04. Clearly, whatever issue you're hitting the current tests do not uncover. It'll be key if you provide a minimum reproducible case, in addition to the Ubuntu and rvm1-ansible versions, so we can understand the factors at play here. It would also be helpful to see a representation of the /etc/sudoers file as well.

sfgeorge avatar Mar 28 '22 22:03 sfgeorge

@sfgeorge sorry, I can't help with that. I don't have access to the environment that had that issue. I'd wait on @vyngur for any feedback, but on my side I'm ok with closing this issue.

fcevado avatar Apr 02 '22 21:04 fcevado

Same as @fcevado, sorry.

vyngur avatar Aug 16 '22 13:08 vyngur