0

The following choco install command works fine:

choco Install 'InstallTest' -y --source 'C:\installtest' --params="'/serverinstance:MyServer /buildtype:OTP'"

I now have the following, in a Puppet manifest:

package { 'InstallTest':
  ensure            => installed,
  install_options   => ['-params','"', /serverinstance:MyServer, /buildtype:OTP, '"'],
  source            => 'c:\installtest',
}

I thought that I was correctly covering spaces with commas, etc, but puppet parser throws the following error:

puppet : [1;31mError: Could not parse for environment production: invalid byte sequence in UTF-8[0m

Without the install_options line, it compiles fine.

What should the correct syntax be?

PAC
  • 15
  • 1
  • 4

1 Answers1

0

The problem is here:

  install_options   => ['-params','"', /serverinstance:MyServer, /buildtype:OTP, '"'],

Although Puppet can accept bare words as strings, there are limitations on the content of such strings. The one relevant here is that they must

Begin with a lower case letter, and contain only letters, digits, hyphens (-), and underscores (_).

Thus, you're looking for this:

  install_options   => ['-params', '"', '/serverinstance:MyServer', '/buildtype:OTP', '"'],

Overall, its better style to quote substantially all strings, whether they need it or not. That's clearer, and it will keep you out of trouble.

John Bollinger
  • 160,171
  • 8
  • 81
  • 157