-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
Added windows support #352
Conversation
Certainly! Can you rebase against current master first to resolve the merge conflicts? |
# Conflicts: # manifests/config.pp # manifests/install.pp # manifests/params.pp # manifests/run_service.pp
Conflict should be solved now, I have simplified the logic around init_style for windows, so it reuse existing logic around |
Windows needs 775 to create sym-link
case $::operatingsystem { | ||
'windows': { | ||
$binary_name = 'consul.exe' | ||
$binary_mode = '0775' |
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.
why does windows need different permissions here?
If we already know what the group should be, I'm ok with making 775 being the default for both oses. Does 555 not work for running windows binaries?
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.
I just ran a test on the, and the binary_mode can be set to 755, but 555 does not work on windows 2016. I have pushed a version where I set it to 755 for both data_dir and binary
Let me do another test tomorrow and I'll let you know. |
A domain joined machine needs 775, to allow domain users to create files and folders in the install_dir.
Hey, I was just looking into adding windows support to this puppet module. I see this merge request was about to get merged, but hasn't yet? Is there something I can do? |
The main blocker is that this PR installs nssm on behalf of the user, which I don't think this module should do. |
OMG it looks like all my review comments are still pending because I didn't hit the "submit review" button... :( |
class consul::windows_service ( | ||
$nssm_version = '2.24', | ||
$nssm_download_url = undef, | ||
$nssm_download_url_base = 'https://nssm.cc/release', |
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 a large new dependency that I didn't expect.
I'm ok with depending on nssm if you think that is the right tool for the job on windows, but I don't think it is appropriate for the consul module to install it on the users behalf.
Please instead assume it is available, add documentation on how to install it via something like
https://github.com/opentable/puppet-nssm
And then change the consul code to do the parameter execing
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 still a blocker for acceptance. The consul module should not presume to install nssm for the user.
However it can require it and assume it is available as long as it is documented in the README
provider => 'powershell', | ||
notify => Exec['consul_service_set_parameters'] | ||
} | ||
file { "${consul::bin_dir}/set_service_parameters.ps1": |
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.
It does look like are in good company using nssm for this
https://chocolatey.org/packages/consul
Can you "show" tools\chocolateyInstall.ps1 on that page and make sure there isn't anything we missed?
file { "${consul::bin_dir}/set_service_parameters.ps1": | ||
ensure => 'present', | ||
content => template('consul/set_service_parameters.ps1.erb'), | ||
notify => Exec['consul_service_set_parameters'] |
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.
Just do the ~> shorthand
command => "${consul::bin_dir}/set_service_parameters.ps1", | ||
refreshonly => true, | ||
logoutput => true, | ||
provider => 'powershell', |
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.
Is it safe to assume powershell is installed already? even if not technically safe, please start a section for "Experimental Windows Support" in the readme and note this.
mode => '0555'; | ||
"${consul::bin_dir}/consul": | ||
"${install_path}/consul-${consul::version}/${binary_name}": | ||
owner => $consul::user, |
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.
can you remove this extra prepending space for style?
mode => '0555'; | ||
owner => $consul::user, | ||
group => $consul::group, | ||
mode => $binary_mode; |
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.
can you use a ,
instead of ;
"${install_path}/consul-${consul::version}/${binary_name}": | ||
owner => $consul::user, | ||
group => $consul::group, | ||
mode => $binary_mode; |
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.
can you use a ,
instead of ;
ensure => link, | ||
notify => $do_notify_service, | ||
target => "${install_path}/consul-${consul::version}/consul"; | ||
target => "${install_path}/consul-${consul::version}/${binary_name}"; |
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.
can you use a ,
instead of ;
@solarkennedy yeah I understand your reluctance. I do agree however that NSSM is the best option. But it would also be fine to me if the puppet-consul module would only manage the config and not the installation. Then we can do the NSSM part in our profile. |
I agree that would be a good compromise. For the same reason this puppet module doesn't install curl or unzip (as much as other people want it to), I don't think it is sustainable. If every puppet module that need to use the unzip binary tried to manage that package there would be lots of conflicts. If the consul module tries to install NSSM, it would conflict with any other puppet module that thinks it should install NSSM too. NSSM should "just" be its own puppet module, puppet-consul should "just" use that or assume it is available. |
Any thoughts on proceeding? I don't mind taking a stab at rebasing @krjensen's PR into the latest master and cleaning up the concerns raised here. |
Go for it |
Closed by #403 |
This is an updated attempt to add windows support, it is based on the old branch
feature/windows_support
but has been updates and tested on server 2016.Could we get this merged and mark windows support as experimental?
Fixes #195