Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to manage dependent packages else where. #298

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,12 @@ that were available on 2017-01-08:
The USE flags to use for the Node.js package on Gentoo systems. Defaults to
['npm', 'snapshot'].

#### `manage_dep_packages`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it clear in the README that this refers to requirements for an apt HTTPS repository, not nodejs itself.


Specify if hte puppet-nodejs module should install dependent packages
required by nodejs. If you manage these packages elsehwere, set to
false. Defaults to `true`.

## Limitations

This module has received limited testing on:
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
$repo_proxy_username = $nodejs::params::repo_proxy_username,
$repo_url_suffix = $nodejs::params::repo_url_suffix,
$use_flags = $nodejs::params::use_flags,
$manage_dep_packages = $nodejs::params::manage_dep_packages,
) inherits nodejs::params {

validate_bool($legacy_debian_symlinks)
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
$repo_proxy_username = 'absent'
$repo_url_suffix = '0.10'
$use_flags = ['npm', 'snapshot']
$manage_dep_packages = true

# The full path to cmd.exe is required on Windows. The system32 fact is only
# available from Facter 2.3
Expand Down
17 changes: 9 additions & 8 deletions manifests/repo/nodesource.pp
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# PRIVATE CLASS: Do not use directly
class nodejs::repo::nodesource {
$enable_src = $nodejs::repo_enable_src
$ensure = $nodejs::repo_ensure
$pin = $nodejs::repo_pin
$priority = $nodejs::repo_priority
$proxy = $nodejs::repo_proxy
$proxy_password = $nodejs::repo_proxy_password
$proxy_username = $nodejs::repo_proxy_username
$url_suffix = $nodejs::repo_url_suffix
$enable_src = $nodejs::repo_enable_src
$ensure = $nodejs::repo_ensure
$pin = $nodejs::repo_pin
$priority = $nodejs::repo_priority
$proxy = $nodejs::repo_proxy
$proxy_password = $nodejs::repo_proxy_password
$proxy_username = $nodejs::repo_proxy_username
$url_suffix = $nodejs::repo_url_suffix
$manage_dep_packages = $nodejs::manage_dep_packages

case $::osfamily {
'RedHat': {
Expand Down
24 changes: 15 additions & 9 deletions manifests/repo/nodesource/apt.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# PRIVATE CLASS: Do not use directly.
class nodejs::repo::nodesource::apt {

$enable_src = $nodejs::repo::nodesource::enable_src
$ensure = $nodejs::repo::nodesource::ensure
$pin = $nodejs::repo::nodesource::pin
$url_suffix = $nodejs::repo::nodesource::url_suffix
$enable_src = $nodejs::repo::nodesource::enable_src
$ensure = $nodejs::repo::nodesource::ensure
$pin = $nodejs::repo::nodesource::pin
$url_suffix = $nodejs::repo::nodesource::url_suffix
$manage_dep_packages = $nodejs::repo::manage_dep_packages

ensure_packages(['apt-transport-https', 'ca-certificates'])
if $manage_dep_packages {
ensure_packages(['apt-transport-https', 'ca-certificates'])
$require = [
Package['apt-transport-https'],
Package['ca-certificates'],
]
} else {
$require = undef
}

include ::apt

Expand All @@ -23,10 +32,7 @@
pin => $pin,
release => $::lsbdistcodename,
repos => 'main',
require => [
Package['apt-transport-https'],
Package['ca-certificates'],
],
require => $require,
}

Apt::Source['nodesource'] -> Package<| tag == 'nodesource_repo' |>
Expand Down