nodesource / ansible-nodejs-role

Ansible Role for Node.js Binary Install
MIT License
131 stars 47 forks source link

Install Node.js fails, "Could not fetch updated apt files" #37

Open tyleha opened 7 years ago

tyleha commented 7 years ago

Installing on Ubuntu 14.04, I get

TASK [nodesource.node : Install Node.js] ***************************************
fatal: [CCAP4]: FAILED! => {"changed": false, "failed": true, "msg": "Could not fetch updated apt files"}

on the last task. I can install node via the command line fine at this stage using apt-get install nodejs. Using -vvv produces

fatal: [CCAP4]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"allow_unauthenticated": false, "autoremove": false, "cache_valid_time": null, "deb": null, "default_release": null, "dpkg_options": "force-confdef,force-confold", "force": false, "install_recommends": null, "only_upgrade": false, "package": ["nodejs"], "pkg": ["nodejs"], "purge": false, "state": "present", "update_cache": true, "upgrade": null}, "module_name": "apt"}, "msg": "Could not fetch updated apt files"}
chrislea commented 7 years ago

Can you please be more specific? We'd need to know the exact command you entered that created the error message, and any other pertinent info about your setup. Thanks.

chrislea commented 7 years ago

Oh!, wait, sorry. Please disregard the above comment. I'm looking at the wrong repository (thought I was looking at distributions). It may still be helpful if you can provide more detail though. :)

tyleha commented 7 years ago

Sure - what additional detail would be most helpful?

The command I ran was simply to execute this galaxy role, as defined by a playbook below:

---
  - hosts: servers
    roles:
      - nodesource.node
    become: true
    vars:
      - nodejs_version: '4.6'

I did have to add become: true as the user who's running this playbook isn't root, it's an admin user with sudo perms.

hyperatom commented 7 years ago

I'm having the same issue upon updating my OS to Ubuntu Trusty from Precise.

zhiyelee commented 7 years ago

same issue here

sultangillani3 commented 5 years ago

either become: true should be added here or this should be updated on the README to note this should be run as root.