-
Notifications
You must be signed in to change notification settings - Fork 289
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
(GH-701) Stop using scope.lookupvar() in templates #724
Conversation
I have separated the commits to proof that the existing functionality is not changed. If prefered I can squash them into one commit. |
ready for review |
Please squash into one commit. Thanks! |
This looks good to me. The tests are great! Only question is why scope.lookup var is being left in |
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.
This is great, thanks! Please make a similar change to sensu-client.erb and sensu-windows-package-version.erb, or mention why they need to be preserved as they are in the commit message.
Please squash into one commit.
Thanks for the positive feedback, will do the same for the other templates as well :) |
720cfd9
to
49c2583
Compare
Here we go:
ready for merge ;) |
@@ -49,7 +108,7 @@ | |||
# $pkg_version is passed to Package[sensu] { ensure }. The Windows MSI | |||
# provider translates hyphens to dots, e.g. '0.29.0-11' maps to | |||
# '0.29.0.11' on the system. This mapping is necessary to converge. | |||
$pkg_version = template('sensu/sensu-windows-package-version.erb') | |||
$pkg_version = regsubst($::sensu::version, '-', '.') |
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.
good catch!
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.
same is true for sensu-version.erb. I have created the issue #731 to get it changed later on too.
@Phil-Friderici looks like we still have a few
While you are changing these, could you have them use .erb files. I prefer to use .erb files, even for one liners, so they can be validated. |
have added the grep results to #731 as I think they should be refactored to Puppet code instead. |
Yes, please address that in this PR. Solves #731 |
@Phil-Friderici please use vagrant to confirm that all platforms still work. Here's a bash function I use to see what clients are connected, instead of poking around through the Dashboard. function sensuclients {
curl -s http://admin:[email protected]:4567/clients | jq .[].name | awk -F \" '{print $2}' | awk -F \. '{print $1}' | sort
} |
Add tests for existing functionality as proof for backward compatibility.
Think we should replace Ruby with Puppet code where possible. So I have replaced all occurrences of Sorry, haven't used vagrant yet. Will need some time to get into the details and understand it. |
@@ -69,7 +128,7 @@ | |||
# The OS Release specific sub-folder | |||
$os_release = $facts['os']['release']['major'] | |||
# e.g. '2012 R2' => '2012r2' | |||
$pkg_url_dir = template('sensu/sensu-version.erb') | |||
$pkg_url_dir = regsubst($os_release, '^(\d+)\s*[rR](\d+)', '\\1r\\2') |
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.
same as for line 111 above ($pkg_version in package.pp)
sweet :) |
Released in v2.22.0 |
Add tests for existing functionality as preparation and to proof backward compatibility.