rvm / rvm1-ansible

The official ansible RVM role to install and manage your Ruby versions.
MIT License
271 stars 136 forks source link

Unprivileged user falls back to ubuntu #147

Open fcevado opened 7 years ago

fcevado commented 7 years ago

Unprivileged user falls back to ubuntu instead of ssh user.

vyngur commented 3 years ago

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"}
pkuczynski commented 2 years ago

@thbar @sfgeorge what do you think?

sfgeorge commented 2 years ago

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.

fcevado commented 2 years ago

@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.

vyngur commented 2 years ago

Same as @fcevado, sorry.