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

issue with REG_SZ and REG_EXPAND_SZ on Windows 2012R2 #16

Open
mikecurrancs opened this issue Apr 18, 2016 · 7 comments
Open

issue with REG_SZ and REG_EXPAND_SZ on Windows 2012R2 #16

mikecurrancs opened this issue Apr 18, 2016 · 7 comments

Comments

@mikecurrancs
Copy link

We use this module with PuppetEnterprise 3.8 and Win2008R2 with no issues, but when I run it in our devlab (puppet 4.2 and win 2012R2) I get the following error

Parameter type failed on Windows_env[PATH=%ProgramFiles(x86)%\Java\jre1.8.0_72\bin]:
Invalid value "Reg_expand_sz[]". Valid values are REG_SZ, REG_EXPAND_SZ.

Even though my type is set to REG_EXPAND_SZ -- have you tested this on 2012R2 ? Possible incompatibility ?

@badgerious
Copy link
Contributor

I haven't tested that particular combination, no. Could you show me a sample of the puppet code that results in that error?

@mikecurrancs
Copy link
Author

Here is the code that works on PE3.8 / w2k8r2 -- we read in hiera to build the variables below.

class cs_win_java (
$jre_version,
$jre_installer,
$jre_pkgname,
$jre_directory,
$staging_path,
$puppet_file_mount
) {

file { $jre_installer:
ensure => file,
owner => 'Administrator',
group => 'Administrators',
mode => '0770',
path => "${staging_path}/${jre_installer}",
source => "puppet:///${puppet_file_mount}/${module_name}/${jre_installer}"
} ->
package { $jre_pkgname:
ensure => installed,
source => "${staging_path}/${jre_installer}",
install_options => ['/s'],
} ->
windows_env { "PATH=%ProgramFiles(x86)%\Java${jre_directory}\bin":
type => REG_EXPAND_SZ,
} ->
windows_env { "JAVA_HOME=%ProgramFiles(x86)%\Java${jre_directory}":
type => REG_EXPAND_SZ,
}
}

@mikecurrancs
Copy link
Author

I realized my agent was 4.4.1 and server was 4.3.2 -- replace agent with 4.3.2 , hoping it was a 4.4.x issue -- but same error.

@mikecurrancs
Copy link
Author

Well -- I found that I did not have win32/registry installed with puppet server 4.3.2 -- and that there is an open bug report, where your module is listed as affected by the way Ruby 2.1.x (pre-packaged with puppet 4.x) Win32::Registry is handled -- here is the link

https://tickets.puppetlabs.com/browse/PUP-3837

@badgerious
Copy link
Contributor

PUP-3837 was handled by #8, so that shouldn't be an issue. I'm not sure what you mean that you didn't have win32/registry installed with puppet server; it should only be installed on the Windows client, never on the (presumably Linux, but certainly not Windows) server.

I need to spin up a VM to test and I haven't had a chance yet; hopefully this weekend.

@badgerious
Copy link
Contributor

Try:

type => "REG_EXPAND_SZ",

Instead of

type => REG_EXPAND_SZ,

Seems like new puppet interprets unquoted strings differently. I'll have to update the docs.

badgerious added a commit that referenced this issue Apr 29, 2016
Puppet's future parser changed the meaning of unquoted, capitalized bare
words.

closes #16
@pngfei
Copy link

pngfei commented Oct 20, 2016

quote the REG_EXPAND_SZ, the issue is gone

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

3 participants