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

Make the npm package installation idempotent #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dickp
Copy link
Contributor

@dickp dickp commented Nov 16, 2019

Installing the 'latest' package triggers a change every time puppet agent runs. This changes the default to 'present' so it installs the latest at the time of installation, and lets the admin choose to upgrade to subsequent versions at a time of their choosing.

It also fixes the home_dir setting, so a doubled .npm directory isn't created.

…ry time

puppet agent runs

Fix npm home_dir setting
@juanpicado
Copy link
Member

@dickp but that means present tag should be present? how the users would be aware of it?

@dickp
Copy link
Contributor Author

dickp commented Nov 29, 2019

The difference between 'latest' and 'present' is that 'latest' will check for updates every time puppet runs, while 'present' only makes sure the package is installed - and if it isn't it installs the latest at that time, and if it is installed it does nothing.

The problem with 'latest' is that it registers a change every time.

@troy2914
Copy link

@dickp but that means present tag should be present? how the users would be aware of it?

Instead of
$version = undef,
in the declaration
Variant[Enum['present', 'absent', 'held', 'installed', 'latest'], Pattern[/./]] $version = 'present',

That way it is explicit as what that field expects and will allow. And also means the inline if can be removed
so it's just
$npm_ensure = $version

@troy2914
Copy link

@dickp but that means present tag should be present? how the users would be aware of it?

Instead of $version = undef, in the declaration Variant[Enum['present', 'absent', 'held', 'installed', 'latest'], Pattern[/./]] $version = 'present',

That way it is explicit as what that field expects and will allow. And also means the inline if can be removed so it's just $npm_ensure = $version

btw, the same thing should be done with $ldap_plugin_version, also @param doc should be added for those two variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants