zzet / rbenv

Ansible role for installing rbenv.
https://galaxy.ansible.com/zzet/rbenv/
188 stars 112 forks source link

Multiuser install triggers a "sudo: password is required" #106

Closed ghost closed 7 years ago

ghost commented 7 years ago

My context is to install RBENV for the well-known user Jenkins. This account is not a sudoer. And during the run launch with the sudoer account vagrant, the become triggers an error message "sudo: a password is required".

Maybe I miss the point how to implement the role (see below).

My playbook:

- name: Jenkins Slave Mobile
  hosts: sandbox-jenkins-slave-mobile
  vars:
    rbenv:
      env: user
      version: v1.0.0
      default_ruby: 2.3.3
      rubies:
      - version: 2.3.3
  roles:
    - role: ansible-rbenv-role
      rbenv_users:
      - jenkins
TASK [ansible-rbenv-role : checkout rbenv_repo for selected users] *********************************************************************************************************************
failed: [sandbox-jenkins-slave-mobile] (item=jenkins) => {"failed": true, "item": "jenkins", "module_stderr": "Shared connection to 127.0.0.1 closed.\r\n", "module_stdout": "sudo: a password is required\r\n", "msg": "MODULE FAILURE", "rc": 1}
ghost commented 7 years ago

I beg your pardon, the trouble is on my side.

In my box the vagrant account is sudoer with these specifications:

$> cat /etc/sudoers.d/vagrant
vagrant ALL=NOPASSWD:ALL

I had to correct like this:

$> cat /etc/sudoers.d/vagrant
vagrant ALL=(ALL) NOPASSWD:ALL