The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Bug #20528

puppet in windows install mangles one liners (using Start Command Prompt with Puppet)

Added by Anonymous almost 3 years ago. Updated almost 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Josh Cooper% Done:

0%

Category:-
Target version:-
Affected Puppet version: Branch:https://github.com/puppetlabs/puppet-docs/pull/161
Keywords:windows

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com


Description

The command:

C:\Program Files (x86)\Puppet Labs\Puppet\bin>puppet apply -e 'notify { foo: message => "hello world!" }'

Produces:

Error: Could not parse for environment production: Syntax error at '='; expected '}' at line 1 on node win-p4cvm028u5j.localdomain
Error: Could not parse for environment production: Syntax error at '='; expected '}' at line 1 on node win-p4cvm028u5j.localdomain

If you take the same snippet and place it in a .pp file, it works.

C:\Program Files (x86)\Puppet Labs\Puppet\bin>type t.pp
notify { foo: message => "hello world!" }
C:\Program Files (x86)\Puppet Labs\Puppet\bin>puppet apply t.pp
Notice: hello world!
Notice: /Stage[main]//Notify[foo]/message: defined 'message' as 'hello world!'
Notice: Finished catalog run in 0.12 seconds

History

#1 Updated by Anonymous almost 3 years ago

  • Subject changed from puppet.bat in windows install mangles one liners to puppet in windows install mangles one liners (using Start Command Prompt with Puppet)
  • Status changed from Unreviewed to Ready for Documentation

The problem is that the > character is being interpreted by cmd.exe since it is inside single quotes (‘). The fix for this is to change the command to use double quotes (“).

puppet apply -e "notify { foo: message => 'hello world!' }"

There is a lot of character quoting subtlety that needs to be taken into account. It seems as though double quotes will resolve these problems, but you’ll then need to escape any double quotes. See http://www.robvanderwoude.com/escapechars.php for some info on escaping on windows.

This issue and the resolution should be documented in the Troubleshooting Guide.

#2 Updated by Anonymous almost 3 years ago

  • Status changed from Ready for Documentation to In Topic Branch Pending Review
  • Branch set to https://github.com/puppetlabs/puppet-docs/pull/161

https://github.com/puppetlabs/puppet-docs/pull/161

#3 Updated by Josh Cooper almost 3 years ago

  • Keywords set to windows

#4 Updated by Josh Cooper almost 3 years ago

  • Status changed from In Topic Branch Pending Review to Closed

Merged into troubleshooting docs

Also available in: Atom PDF