npm / npme-trusty

Ubuntu Trusty specific npm Enterprise install module.
0 stars 5 forks source link

Ansible fails if sudo requires a password #7

Closed mmalecki closed 9 years ago

mmalecki commented 10 years ago

I didn't find the requirement for paswordless sudo in our docs, yet installing without it fails:

ubuntu@npm:~/node_modules/npme$ ./bin/npme.js install < answers
[?] this will install npmE on this server (you should only run this on a dedicated machine), continue? Yes
[?] enter your billing email: ***
[?] enter your license key: ***
[?] what user should npmE run as: ubuntu
[?] what group should npmE run as: ubuntu
[?] should privileged commands be run using sudo (usually the answer is yes) Yes
[sudo] password for ubuntu: 
installing ansible
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ansible is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Installing OS dependencies with Ansible:

PLAY [npme] ******************************************************************* 

GATHERING FACTS *************************************************************** 
<127.0.0.1> REMOTE_MODULE setup
<127.0.0.1> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1410000770.82-239790238121183 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1410000770.82-239790238121183 && echo $HOME/.ansible/tmp/ansible-tmp-1410000770.82-239790238121183']
<127.0.0.1> PUT /tmp/tmpernKu1 TO /home/ubuntu/.ansible/tmp/ansible-tmp-1410000770.82-239790238121183/setup
<127.0.0.1> EXEC ['/bin/sh', '-c', '/usr/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1410000770.82-239790238121183/setup; rm -rf /home/ubuntu/.ansible/tmp/ansible-tmp-1410000770.82-239790238121183/ >/dev/null 2>&1']
ok: [127.0.0.1]

TASK: [Ansibles.build-essential | build-essential | Read the family variables] *** 
ok: [127.0.0.1] => {"ansible_facts": {"buildessential_packages": ["autoconf", "binutils-doc", "bison", "build-essential", "flex", "gettext", "ncurses-dev"]}, "item": ""}

TASK: [Ansibles.build-essential | build-essential | Make sure the packages are installed (Debian)] *** 
<127.0.0.1> REMOTE_MODULE apt pkg=autoconf,binutils-doc,bison,build-essential,flex,gettext,ncurses-dev state=present
<127.0.0.1> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1410000771.28-211894272777936 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1410000771.28-211894272777936 && echo $HOME/.ansible/tmp/ansible-tmp-1410000771.28-211894272777936']
<127.0.0.1> PUT /tmp/tmpuj5Rpy TO /home/ubuntu/.ansible/tmp/ansible-tmp-1410000771.28-211894272777936/apt
<127.0.0.1> EXEC /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=srtddwlkuudltctunhfqiilgvjammuxp] password: " -u root /bin/sh -c '"'"'echo SUDO-SUCCESS-srtddwlkuudltctunhfqiilgvjammuxp; /usr/bin/python /home/ubuntu/.ansible/tmp/ansible-tmp-1410000771.28-211894272777936/apt; rm -rf /home/ubuntu/.ansible/tmp/ansible-tmp-1410000771.28-211894272777936/ >/dev/null 2>&1'"'"''
failed: [127.0.0.1] => (item=autoconf,binutils-doc,bison,build-essential,flex,gettext,ncurses-dev) => {"failed": true, "item": "autoconf,binutils-doc,bison,build-essential,flex,gettext,ncurses-dev", "parsed": false}
invalid output was: [sudo via ansible, key=srtddwlkuudltctunhfqiilgvjammuxp] password: 

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/home/ubuntu/install-npme-play.retry

127.0.0.1                  : ok=2    changed=0    unreachable=0    failed=1   

install complete!
ENOENT, no such file or directory '/etc/npme/.license.json'
bcoe commented 9 years ago

This issue is solved with the new installer.