Code Monkey home page Code Monkey logo

node-formula's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-formula's Issues

Support debian with ppa install

Installing from ppa is currently done through nodesource.

According to their readme file, nodesource supports installing on debian.

This formula should support installing node on debian through nodesource.

Don't use --silent flag

Using the --silent flag for bootstrapping with npm install might be useful to hide verbose output when successful, however when an issue occurs (for instance, permissions to ~/.npm) it's rather annoying as there is no output, simply just an error code - which is rather unhelpful.

Is there another reason I'm unaware of that requires the setting of the --silent flag?

Cant't force the version of node.js to 5.1 in Ubuntu 14.04

Sorry if this is not a real "Issue/Bug" but most likely a misunderstanding by me:

I would like to install node.js and npm in a specific version e.g. 5.1 on an Ubuntu 14.04 Server:

What i did:

I added your github repository to gitfs_remotes in the salt-master etc config file and applied a pillar file with

node:
  version: 5.1.0
  checksum: 25b2d3b7dd57fe47a483539fea240a3c6bbbdab4d89a45a812134cf1380ecb94

to the virtual box machine minion1

If i run salt minion1 pillar.items everything looks alright and the pillar data was correctly received by minion1.

I then apply a state to minion1 with

include:
  - node 

npm packages:
  npm.installed:
    - pkgs:
      - less
      - less-plugin-clean-css
      - push-to-deploy
    - require:
      - pkg: nodejs

This will install the package node(js) and npm but will not install the desired version?!
I also tried with

...
    - require:
      - pkg: node

instead of package nodejs but this throws error?!

The Problem

If i run nodejs --version on minion1 i get v0.12.9 but i expected Version 5.1 as defined in the pillar?

What i want to do:

  • Force in a state file that a specific version (5.1) of node.js is/gets installed on Ubuntu 14.04.
  • Would be even nicer if i could specify the version of node.js without a pillar file

Any help would be very much appreciated.

Binary installation fails form improperly used `archive.extracted` state

pillar:

node:
  version: 5.7.1
  checksum: fcded78b45549e2195eecb36138ba29b6f353d0d136d4e8b80648770418f1e5b
  install_from_binary: True

salt-call -l debug state.sls node

[DEBUG   ] Rendered data from file: /var/cache/salt/minion/files/base/node/binary.sls:
Get binary package:
  file.managed:
    - name: /usr/local/src/node-v5.7.1-linux-x64.tar.gz
    - source: https://nodejs.org/dist/v5.7.1/node-v5.7.1-linux-x64.tar.gz
    - source_hash: sha256=fcded78b45549e2195eecb36138ba29b6f353d0d136d4e8b80648770418f1e5b

Extract binary package:
  archive.extracted:
    - name: /usr/local/src/
    - source: /usr/local/src/node-v5.7.1-linux-x64.tar.gz
    - archive_format: tar
    - if_missing: /usr/local/src/node-v5.7.1-linux-x64

Copy lib:
  cmd.run:
    - cwd: /usr/local/src/node-v5.7.1-linux-x64/
    - name: cp -r bin/ include/ lib/ share/ /usr/local/
    - unless: cmp /usr/local/bin/node /usr/local/src/node-v5.7.1-linux-x64/bin/node

failure:

[DEBUG   ] LazyLoaded archive.extracted
[INFO    ] Running state [/usr/local/src/] at time 16:50:58.087685
[INFO    ] Executing state archive.extracted for /usr/local/src/
[DEBUG   ] Input seem valid so far
[DEBUG   ] Archive file /usr/local/src/node-v5.7.1-linux-x64.tar.gz is not in cache, download it
[DEBUG   ] Missing configuration file: /etc/salt/minion
[DEBUG   ] Including configuration from '/etc/salt/minion.d/10-logging.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/10-logging.conf
[DEBUG   ] Including configuration from '/etc/salt/minion.d/10-master.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/10-master.conf
[DEBUG   ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG   ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG   ] Re-using SAuth for ('/etc/salt/pki/minion', 'vm-999-99', 'tcp://127.0.0.1:4506')
[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[INFO    ] Loading fresh modules for state activity
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] LazyLoaded file.managed
[INFO    ] Running state [/var/cache/salt/minion/files/base/_usr_local_src_node-v5.7.1-linux-x64.tar] at time 16:51:00.454935
[INFO    ] Executing state file.managed for /var/cache/salt/minion/files/base/_usr_local_src_node-v5.7.1-linux-x64.tar
[DEBUG   ] LazyLoaded config.manage_mode
[DEBUG   ] LazyLoaded file.source_list
[DEBUG   ] LazyLoaded cp.cache_file
[DEBUG   ] Re-using SAuth for ('/etc/salt/pki/minion', 'vm-999-99', 'tcp://127.0.0.1:4506')
[DEBUG   ] Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/states/file.py", line 1545, in managed
    follow_symlinks)
  File "/usr/lib/python2.7/dist-packages/salt/modules/file.py", line 3556, in manage_file
    dl_sum = get_hash(sfn, source_sum['hash_type'])
TypeError: string indices must be integers, not str

[ERROR   ] Unable to manage file: string indices must be integers, not str

archive.extracted expects "same syntax as file.managed source argument"

file.managed expects "source file can be hosted on either the salt master server, or on an HTTP or FTP server".

The source value as implemented in this formula today forces the states to fetch a non-existing file from the salt master

RHEL/CentOS support is needed

The os_family = redhat support seems to be missing - might be related to #43 - but I think this formula only implements Debian family.

[ERROR   ] Command '[u'yum', u'-y', u'install', u'nodejs']' failed with return code: 1
[ERROR   ] stdout: Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
 * base: mirror.us.oneandone.net
 * extras: repos-va.psychz.net
 * updates: repos-va.psychz.net
No package nodejs available.
Error: Nothing to do
[ERROR   ] retcode: 1
[ERROR   ] Error occurred installing package(s). Additional info follows:
errors:
    - Loaded plugins: fastestmirror, ovl
      Loading mirror speeds from cached hostfile
       * base: mirror.us.oneandone.net
       * extras: repos-va.psychz.net
       * updates: repos-va.psychz.net
      No package nodejs available.
      Error: Nothing to do
--------------------------------------------------
state_apply_response:
local:
----------
          ID: nodejs
    Function: pkg.installed
      Result: False
     Comment: Error occurred installing package(s). Additional info follows:
              
              errors:
                  - Loaded plugins: fastestmirror, ovl
                    Loading mirror speeds from cached hostfile
                     * base: mirror.us.oneandone.net
                     * extras: repos-va.psychz.net
                     * updates: repos-va.psychz.net
                    No package nodejs available.
                    Error: Nothing to do
     Started: 22:55:44.616122
    Duration: 5405.466 ms
     Changes:   
Summary for local
------------
Succeeded: 0
Failed:    1

Test harness needs more scenarios.

Only node.pkg state is tested today.

To trigger node.source and node.binary the tests could define node:install_from_source: True pillar, or whatever works best.

[FEATURE] Ability to set exact major version in pkg repository

Is your feature request related to a problem?

I need to have the 10 version of node on Debian/Ubuntu systems, I fill this pillar:

node:
  version: 10
  pkg:
    version: 10
    use_upstream_repo: true

It installs successfully without warnings, but, as result, I have 12 version of node:

$ node -v
v12.20.1

and in the /etc/apt/sources.list.d/nodesource.list file there are:

deb https://deb.nodesource.com/node_12.x focal main

Describe the solution you'd like

Will be good to have ability to force set needed node major version from pillar file.

Data passed to highstate outputter is not a valid highstate return.

I am trying to install node-v4.5.0 using formula, I am getting this error. Can anyone help me how to solve it.

When running the command below on master
sudo salt 'envdev' state.apply

I am getting following error:

Data passed to highstate outputter is not a valid highstate return: {'envdev': ['Pillar failed to render with the following messages:', "Rendering SLS 'node' failed. Please see master log for details."]}
ERROR: Minions returned with non-zero exit code

Below is my /srv/salt/top.sls file:

base:
  'envdev':
    - node 

I have copied node directory from formula to /srv/salt/ directory.

Below is my /srv/pillar/top.sls file.

base:
  '*':
    - node

Below is my /srv/pillar/node.sls file.

# Install from source:
node:
  version: 4.5.0
  install_from_source: False
  checksum: 5678ad94ee35e40fc3a2c545e136a0dc946ac4c039fca5898e1ea51ecf9e7c39
  make_jobs: 2

# Install from binary:
node:
  version: 4.5.0
  install_from_binary: True
  checksum: 5678ad94ee35e40fc3a2c545e136a0dc946ac4c039fca5898e1ea51ecf9e7c39

# Install from PPA:
# node:
#  version: 4.5.0
#  install_from_ppa: False
#  ppa:
#    repository_url: https://deb.nodesource.com/setup_4.x

Key error

When installing from ppa

      ID: nodejs.ppa
Function: pkgrepo.managed
    Name: deb https://deb.nodesource.com/node_5.x trusty main
  Result: False
 Comment: You may not use both "keyid"/"keyserver" and "key_url" argument.
 Started: 10:05:01.887191
Duration: 2.185 ms
 Changes:

Centos/Redhat

I can't use it for my Centos and Redhat instances.
I think to change pkg install (then a will l use a condition)... but some packages are missing.
What do you recommend?

Ensure required packages are present:
pkg.installed:
- names:
- openssl-devel #libssl-dev
- git
- pkgconfig #pkg-config
- build-essential #no
- curl
- gcc
- gcc-c++ # g++
- checkinstall #no

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.