-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
Manage /root/.npmrc #216
Manage /root/.npmrc #216
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# PRIVATE CLASS: do not call directly | ||
class nodejs::install { | ||
|
||
$npmrc_auth = $::nodejs::npmrc_auth | ||
|
||
if $caller_module_name != $module_name { | ||
fail("Use of private class ${name} by ${caller_module_name}") | ||
} | ||
|
@@ -55,5 +58,13 @@ | |
tag => 'nodesource_repo', | ||
} | ||
} | ||
} | ||
|
||
file { 'root_npmrc': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to manage the whole file? Can this be file_line? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did this because the docs read that this file is managed, even though it actually is not. So this is a step to get reality to match the docs. I don't have any strong feelings between managing the contents of the file as it is now or using file_line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the docs read that the whole file is managed, how do you think we should do that? I'm thinking a concat resource. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should do what's in the PR :D or file_line if you'd like.. whatever get's this merged. |
||
ensure => 'file', | ||
path => '/root/.npmrc', | ||
content => template('nodejs/npmrc.erb'), | ||
owner => 'root', | ||
group => 'root', | ||
mode => '0600', | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This file is being maintained by Puppet. | ||
# DO NOT EDIT | ||
|
||
<% if @npmrc_auth -%> | ||
_auth="<%= @npmrc_auth %>" | ||
<% end -%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this instead of validate_string because I wanted to check for the Puppet::Error and a specific error string which can change quite a bit using
validate_string()
on different platforms.