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

Windows Install #626

Closed
cdenneen opened this issue Mar 22, 2017 · 10 comments
Closed

Windows Install #626

cdenneen opened this issue Mar 22, 2017 · 10 comments
Assignees

Comments

@cdenneen
Copy link
Contributor

cdenneen commented Mar 22, 2017

Doing the following:
include sensu
Doesn't work on windows because it won't support latest.

class { 'sensu':
  version => '0.27.0-1'
}

Complains trying to create the File['C:/opt/sensu/conf.d]' because of Package[sensu] dependency and I believe it's because of the package.pp uses sensu::package_checksum for remote_file to install and that isn't a valid parameter for the sensu class currently.

#625 opened to fix this but appears travis hasn't been updated.

How is anyone installing this on Windows with this parameter missing?

@Justin-DynamicD
Copy link

So you are actually talking about two different issues, both which I (believe, could be wrong) have been fixed but neither fixes have been published. So here's where we are at:

"latest" doesn't exist because the repos that this module is looking at are out of date. If you use this on your linux hosts it will install old versions to boot. There's a ticket on this, but I don't know that it's been fixed yet (latest agent is technically 0.28 now, this installs 0.26 on linux).

The "sensu client" issue is actually a bug as the module attempts to create a user even though Windows runs under local system in Windows and doesn't need this at all. I was actually told this was fixed, but never tested the latest master branch.

So how do we fix it? Well you can either download directly from this repo and try to see if the new fixes actually work, or you can go "plan b" route which is what I did:

create a separate class to create the sensu user. then, in the sensu class, set 'manage_user => false'. This basically tells this module you will control the creation of the account. Then use a "case" or similar statement to tell puppet to configure your sensu account with enough rights based on OS. Go ahead and give sensu "Real" rights in Linux, but on the windows boxes tell it to create a basic user and disable it. The Sensu agent doesn't even need it the account the module is just looking for it so this will pass that test. Bingo: windows agents install.

Word of warning: do that on a DC and you end up with "sensu" as a domain user. Make sure you think that one through :)

@cdenneen
Copy link
Contributor Author

@Justin-DynamicD I'm not sure I follow. The windows package provider doesn't support "upgradeable" so latest will not work until that has been added.
As far as the wrong repo for linux I think that's a separate issue.

My concern is include sensu will not work on windows clients without a package_checksum which is required by the remote_file resource to install the package and also isn't a class parameter for sensu.

I think this needs to be addressed 2 ways:
1a. Create a package_checksum parameter that's expected (PR #625)
1b. set a default package version and checksum which will allow include sensu to work on windows
2. Find a better way to retrieve the checksum to avoid requiring defaults configured in 1b.

cc @cwjohnston

@cwjohnston
Copy link
Contributor

I think this needs to be addressed 2 ways:
1a. Create a package_checksum parameter that's expected (PR #625)

#625 has been merged, thanks for that!

1b. set a default package version and checksum which will allow include sensu to work on windows

Setting a default version and checksum is probably a good idea. Depending on your point of view, this might be something that could wait until Sensu Core 1.0 ships, which we hope will be within the next few weeks.

  1. Find a better way to retrieve the checksum to avoid requiring defaults configured in 1b.

I think ideally there would be an API to retrieve latest Sensu Core version, artifact URL(s), checksums, and so on, but we're not there yet. Maybe someday .... 🌴

@cdenneen
Copy link
Contributor Author

@cwjohnston Thanks

I think the API is nice but for people who want to maintain local artifacts it's probably not ideal to make external call.
This is something that will need to be fixed as well since the repo is actually hardcoded: https://github.com/sensu/sensu-puppet/blob/master/manifests/package.pp#L55

Preferably would probably be to move to a solution like publishing these packages to a nuget repository that can be mirrored internally and then can use chocolatey provider to install.
Any plans to make that repo a nuget repo?

The other option I think might be to have the package and package_checksum.txt published... use some method to retrieve the checksum from the contents of the txt file and use that for the package_checksum.

@cwjohnston
Copy link
Contributor

This is something that will need to be fixed as well since the repo is actually hardcoded: https://github.com/sensu/sensu-puppet/blob/master/manifests/package.pp#L55

Although it's intended as a workaround for now, we do have a redirect rule in place that should allow the hardcoded URL you mention to work for accessing the newer Sensu MSIs under the 2012r2 directory, e.g. http://repositories.sensuapp.org/msi/sensu-0.28.5-2.msi will be redirected to http://repositories.sensuapp.org/msi/2012r2/sensu-0.28.5-2-x64.msi.

Preferably would probably be to move to a solution like publishing these packages to a nuget repository that can be mirrored internally and then can use chocolatey provider to install.
Any plans to make that repo a nuget repo?

We don't have any specific plans around this right now, but I think it would make a lot of sense. I'll bring it up with the team.

The other option I think might be to have the package and package_checksum.txt published

We have this metadata being generated already but it's not uploaded along side the MSI. I've opened sensu/package-deployer#12 to track this as a desired improvement.

@cwjohnston
Copy link
Contributor

The other option I think might be to have the package and package_checksum.txt published... use some method to retrieve the checksum from the contents of the txt file and use that for the package_checksum.

@cdenneen We've enhanced our package deployment process to include the JSON formatted metadata for MSI artifacts, e.g. http://repositories.sensuapp.org/msi/2012r2/sensu-0.28.5-2-x64.msi.metadata.json now reflects the checksum and other metadata generated by our build process.

@ghoneycutt
Copy link
Collaborator

@jeffmccune what's the status on this since we merged your windows work?

@jeffmccune
Copy link
Collaborator

@jeffmccune what's the status on this since we merged your windows work?

Looking into it now.

@jeffmccune
Copy link
Collaborator

jeffmccune commented Jun 30, 2017 via email

@ghoneycutt
Copy link
Collaborator

Thanks @jeffmccune

@cdenneen please try release v2.8.0 and re-open if you have any issues.

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

No branches or pull requests

5 participants