saltstack-formulas / node-formula Goto Github PK
View Code? Open in Web Editor NEWManage node.js with SaltStack
Home Page: http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
License: Other
Manage node.js with SaltStack
Home Page: http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
License: Other
Line 11 in 03b12c2
Still using node_6.x
when 10
(and even 11
) are available:
Is there a specific reason for this?
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.
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?
Will be good to have support for installing yarn
package too, because it very often goes together with node.
I have found the separate formula https://github.com/corux/yarn-formula but it isn't updated already 3+ years..
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:
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?!
If i run nodejs --version
on minion1 i get v0.12.9
but i expected Version 5.1 as defined in the pillar?
Any help would be very much appreciated.
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
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
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.
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
Will be good to have ability to force set needed node major version from pillar file.
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
node-formula/node/config/clean.sls
Line 8 in a4eb6a0
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:
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.