geerlingguy / ansible-role-nodejs

Ansible Role - Node.js
https://galaxy.ansible.com/geerlingguy/nodejs/
MIT License
410 stars 252 forks source link

RFE: Support custom URLs for mirrors #139

Closed b00ga closed 1 year ago

b00ga commented 2 years ago

We mirror a lot of repos inside our organization to save bandwidth. It would be nice to have an option with this role to override the default nodesource repos.

I've looked at the code and started implementing something, so far just on the RPM side. The way to do the platform specific variables is significantly more brain twisting than I was expecting, so feedback on my approach so far is greatly appreciated. I'm working in this branch of a fork of this repo: https://github.com/b00ga/ansible-role-nodejs/tree/mirrorsupport

The following vagrant config can be used to create an AlmaLinux 8 mirror server with EL/Fedora/Debian/Ubuntu nodesource 16.x packages: https://github.com/b00ga/vagrant-mirror

Starting out by just testing against the vagrant box itself, before creating a more complex vagrant multimachine config to test different distros/versions. Currently testing by cloning fork/branch into a roles dir, symlinking it as geerlinguy.nodejs and then using a playbook like:

---
- hosts: all
  become: yes

  tasks:
  - name: install nodejs
    import_role:
      name: geerlinguy.nodejs
    vars:
      - nodejs_version: '16.x'
        nodejs_nodesource_custom_baseurl: http://localhost/reposync/nodesource-16-el8-x86_64/

Hopefully that makes sense. Feedback about this enhancement and current approach greatly appreciated.

stale[bot] commented 1 year ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 1 year ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.