This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #189 from willdurand/cleanup-and-refactor-internals
Preparation for 2.1
- Loading branch information
Showing
24 changed files
with
278 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
# RSpec | ||
spec/fixtures/ | ||
/coverage | ||
|
||
# Puppet | ||
pkg/ | ||
|
||
# Bundler | ||
Gemfile.lock | ||
/.bundle/ | ||
/vendor/ | ||
/coverage | ||
|
||
# Beaker | ||
log/ | ||
junit/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ This module allows you to install [Node.js](https://nodejs.org/) and | |
[willdurand/nodejs](https://forge.puppetlabs.com/willdurand/nodejs). | ||
|
||
### Announcements | ||
|
||
* From now on `2.0` is maintenance-only and accepts bugfixes until `2.2` is released. On `master` | ||
the active development on `2.1` is currently happening. The docs of `2.0` can be found | ||
[here](https://github.com/willdurand/puppet-nodejs/tree/2.0#puppet-nodejs) | ||
|
@@ -25,7 +24,6 @@ This module allows you to install [Node.js](https://nodejs.org/) and | |
The module depends on the following well-adopted and commonly used modules: | ||
|
||
* [puppetlabs/stdlib](https://github.com/puppetlabs/puppetlabs-stdlib) | ||
* [puppetlabs/gcc](https://github.com/puppetlabs/puppetlabs-gcc) | ||
|
||
The easiest approach to install this module is by using [r10k](https://github.com/puppetlabs/r10k): | ||
|
||
|
@@ -34,9 +32,13 @@ forge 'http://forge.puppetlabs.com' | |
|
||
mod 'willdurand/nodejs', '2.0.3' | ||
mod 'puppetlabs/stdlib', '5.1.0' | ||
mod 'puppetlabs/gcc', '0.3.0' | ||
``` | ||
|
||
The Puppet Master which evaluates the catalogue before deploying each node requires | ||
the following modules to properly evaluate the functions bundled with this module: | ||
|
||
* [semver](https://rubygems.org/gems/semver/versions/1.0.1) | ||
|
||
## Usage | ||
|
||
### Deploying a precompiled package | ||
|
@@ -73,6 +75,28 @@ class { 'nodejs': | |
} | ||
``` | ||
|
||
### Using a custom source | ||
|
||
It's also possible to deploy NodeJS instances to Puppet nodes from your own server. | ||
This can be helpful when e.g. distributing your own, patched version of NodeJS. | ||
|
||
The source can be specified like this: | ||
|
||
``` puppet | ||
class { '::nodejs': | ||
source => 'https://example.org/dist-nodejs', | ||
} | ||
``` | ||
|
||
It's also possible to compile the custom instance from source: | ||
|
||
``` puppet | ||
class { '::nodejs': | ||
source => 'https://example.org/src-nodejs', | ||
make_install => true, | ||
} | ||
``` | ||
|
||
### Setup with a given download timeout | ||
|
||
Due to infrastructures with slower connections the download timeout of the nodejs binaries can be increased | ||
|
@@ -201,7 +225,15 @@ package { 'express': | |
} | ||
``` | ||
|
||
### NPM installer | ||
### NPM installer (deprecated) | ||
|
||
Note: this API is deprecated and will be removed in `3.0`. It's recommended to either package your | ||
applications properly using `npm` and install them as package using the `npm` provider or to directly | ||
run `npm install` when deploying your application (e.g. with a custom Puppet module). | ||
|
||
This module is focused on setting up an environment with `nodejs`, application deployment should be handled | ||
in its own module. In the end this was just a wrapper on top of `npm` which runs an `exec` with | ||
`npm install` and a configurable user and lacks proper `ensure => absent` support. | ||
|
||
The `nodejs` installer can be used if a npm package should not be installed globally, but in a | ||
certain directory. | ||
|
@@ -258,9 +290,7 @@ class { '::nodejs': | |
In this case you'll need to take care of the following packages: | ||
|
||
- `tar` | ||
- `ruby` | ||
- `wget` | ||
- `semver` (GEM used by ruby) | ||
- `make` (if `make_install` = `true`) | ||
- `gcc` compiler (if `make_install` = `true`) | ||
|
||
|
@@ -271,8 +301,12 @@ The easiest way to get started is using [`bundler`](https://bundler.io): | |
``` | ||
bundle install | ||
bundle exec rake test | ||
PUPPET_INSTALL_TYPE=agent BEAKER_setfile=spec/acceptance/nodesets/ubuntu-1604-x64.yml bundle exec rake acceptance | ||
``` | ||
|
||
**Note:** to run the acceptance tests that are part of rake's `test` target, | ||
[Docker](https://www.docker.com/) is required. | ||
|
||
## Authors | ||
|
||
* William Durand (<[email protected]>) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.