A puppet module to install Yarn Package Manager.
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with yarn
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Yarn is a fast, reliable, and secure dependency manager for npm and bower. This Puppet module simplifies the task of installing it and supports package, npm or source installation.
- It will install Yarn.
- It will install
wget
,tar
andgzip
packages if you choose the source installation method.
Node.js requirement: Yarn requires Node.js to be installed, but this module will not do it. You need to install Node.js by your own, you can use the puppet-nodejs to do it. Examples are provided with this module.
To have Puppet install yarn with the default parameters, declare the yarn class:
class { 'yarn': }
The Puppet module applies a default configuration: installs yarn using the recommended methods, package for Debian and RedHat families
and source for the rest. You can also use npm
to install it.
Use the Reference section to find information about the class's parameters and their default values.
You can customize parameters when declaring the yarn
class. For instance, this declaration will install yarn using the npm
method
for the foo
user:
class { 'yarn':
user => 'foo',
install_method => 'npm',
}
This is the most common usage for yarn. It installs yarn with default parameters.
class { 'yarn': }
The following code require that you add the puppet-nodejs module also, but you can adapt it for any other module.
class { 'nodejs':
repo_url_suffix => '6.x',
}
class { 'yarn': }
Package['nodejs'] -> Package['yarn']
if $facts['os']['family'] == 'RedHat' and $::operatingsystemrelease =~ /^5\.(\d+)/ {
class { 'epel': }
Class['epel'] -> Class['nodejs'] -> Class['yarn']
}
The following code require that you add the puppet-nodejs module also, but you can adapt it for any other module.
class { 'nodejs':
repo_url_suffix => '6.x',
}
class { 'yarn': }
Package['nodejs'] -> Package['yarn']
The following code require that you add the puppet-nodejs module also, but you can adapt it for any other module.
class { 'nodejs':
repo_url_suffix => '6.x',
}
class { 'yarn':
manage_repo => false,
install_method => 'source',
require => Package['nodejs'],
}
The following code require that you add the puppet-nodejs module also, but you can adapt it for any other module.
class { 'nodejs':
repo_url_suffix => '6.x',
}
class { 'yarn':
manage_repo => false,
install_method => 'npm',
require => Class['nodejs'],
}
class { 'yarn':
package_ensure => 'absent',
}
Details are into REFERENCE.md
in puppet-strings format, excepted for OS dependent values of yarn
class presented bellow.
Allos the module to manage the Yarn repo.
Default: true
for Debian and RedHat, false
for the rest.
Sets the installation method. Allowed values: source
, npm
, package
.
Default: package
for Debian and RedHat, source
for the rest.
- Ensures packages
wget
,tar
andgzip
whensource
method is used.
This module can not work on Windows and should work on LINUX systems.
This module is CI tested against open source Puppet on OSes declared in metadata.json
.
This module should also work properly in other distributions and operating systems, such as FreeBSD, Gentoo, and Amazon Linux, but is not formally tested on them.
This modules is an open project, and community contributions are highly appreciated.
For more information, please read the complete module contribution guide.
This project contains tests for both rspec-puppet and beaker-rspec to verify functionality. For detailed information on using these tools, please see their respective documentation.
This project contains tests for rspec-puppet to verify functionality. For detailed information on using these tools, please see their respective documentation.
gem install bundler
bundle install
bundle exec rake test
./spec/run_virtualbox_tests.sh # this will take a long time