Hello all, I''ve been trying to run this exec statement (which to my peril was initially thought to be something simple): exec { "/opt/pbis/bin/config UserDomainPrefix "" " : } After the command is run I''m getting the following error: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '''' ''; expected ''}'' at /etc/puppet/modules/powerbroker_install/manifests/init.pp:20 on node sbxwk-blackhole.sbx.leiproductions.com I need to run the command with the double quotes as the value of UserDomainPrefix but I''m having a hard time getting this one to run. I figured if I changed to the command below, puppet wouldn''t interpret the double quotes and things would work but I was quite wrong. exec { " ''/opt/pbis/bin/config UserDomainPrefix "" '' " : } Does anybody have any suggestions as to how one might run an exec with double quotes? As always, thanks for the help in advance. Cheers, Mike -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/nDswUwx_4tsJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Christopher Wood
2012-Jul-05 20:37 UTC
Re: [Puppet Users] Double quotes within an exec statement
On Thu, Jul 05, 2012 at 01:23:47PM -0700, Mike Reed wrote:> Hello all, > > I''ve been trying to run this exec statement (which to my peril was > initially thought to be something simple): > > exec { "/opt/pbis/bin/config UserDomainPrefix "" " : }Escape the inside double quotes: $ cat /tmp/2.pp notice("\"this is quoted\"") notice("this is not quoted") $ puppet apply /tmp/2.pp notice: Scope(Class[main]): "this is quoted" notice: Scope(Class[main]): this is not quoted> After the command is run I''m getting the following error: > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Syntax error at '''' ''; expected ''}'' at > /etc/puppet/modules/powerbroker_install/manifests/init.pp:20 on node > sbxwk-blackhole.sbx.leiproductions.com > > I need to run the command with the double quotes as the value of > UserDomainPrefix but I''m having a hard time getting this one to run. I > figured if I changed to the command below, puppet wouldn''t interpret the > double quotes and things would work but I was quite wrong. > > exec { " ''/opt/pbis/bin/config UserDomainPrefix "" '' " : }Better, if you''re using the literal: exec { ''/opt/pbis/bin/config UserDomainPrefix "" '': } But you''d save yourself the trouble by emplacing a shell script and running that.> Does anybody have any suggestions as to how one might run an exec with > double quotes? > > As always, thanks for the help in advance. > > Cheers, > > Mike > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > [1]https://groups.google.com/d/msg/puppet-users/-/nDswUwx_4tsJ. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > References > > Visible links > 1. https://groups.google.com/d/msg/puppet-users/-/nDswUwx_4tsJ-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Mike Zupan
2012-Jul-05 20:40 UTC
Re: [Puppet Users] Double quotes within an exec statement
escape your inner quotes \" \" exec { "/opt/pbis/bin/config UserDomainPrefix \"\" " : } On Thu, Jul 5, 2012 at 1:23 PM, Mike Reed <mjohn.reed@gmail.com> wrote:> Hello all, > > I''ve been trying to run this exec statement (which to my peril was initially > thought to be something simple): > > exec { "/opt/pbis/bin/config UserDomainPrefix "" " : } > > After the command is run I''m getting the following error: > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Syntax error at '''' ''; expected ''}'' at > /etc/puppet/modules/powerbroker_install/manifests/init.pp:20 on node > sbxwk-blackhole.sbx.leiproductions.com > > I need to run the command with the double quotes as the value of > UserDomainPrefix but I''m having a hard time getting this one to run. I > figured if I changed to the command below, puppet wouldn''t interpret the > double quotes and things would work but I was quite wrong. > > exec { " ''/opt/pbis/bin/config UserDomainPrefix "" '' " : } > > Does anybody have any suggestions as to how one might run an exec with > double quotes? > > As always, thanks for the help in advance. > > Cheers, > > Mike > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/nDswUwx_4tsJ. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
jcbollinger
2012-Jul-05 20:40 UTC
[Puppet Users] Re: Double quotes within an exec statement
On Thursday, July 5, 2012 3:23:47 PM UTC-5, Mike Reed wrote:> > Hello all, > > I''ve been trying to run this exec statement (which to my peril was > initially thought to be something simple): > > exec { "/opt/pbis/bin/config UserDomainPrefix "" " : } > > After the command is run I''m getting the following error: > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Syntax error at '''' ''; expected ''}'' at > /etc/puppet/modules/powerbroker_install/manifests/init.pp:20 on node > sbxwk-blackhole.sbx.leiproductions.com >The double quotes around the command''s second argument are being interpreted as the end of the resource title. The easiest solution is probably to switch the outer quotes to single: exec { ''/opt/pbis/bin/config UserDomainPrefix "" '' : } Indeed, it''s a good idea to make a habit of using single quotes instead of double quotes in your Puppet manifests, except where you have specific reason to do otherwise (such as when you want to interpolate a variable into your string). Alternatively, you should also be able to escape the internal double quotes with backslashes: exec { "/opt/pbis/bin/config UserDomainPrefix \"\" " : } John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/8EJr4qDJEJUJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hey Guys, Thanks for the input. Your comments were most helpful and I definitely get it now. I realize that the way I''m going about doing this one probably isn''t the most desirable and as soon as I have my important manifests working in a basic state, I''ll come back to each one and fix them up. Thanks again for the help. Cheers, Mike On Thursday, July 5, 2012 1:23:47 PM UTC-7, Mike Reed wrote:> > Hello all, > > I''ve been trying to run this exec statement (which to my peril was > initially thought to be something simple): > > exec { "/opt/pbis/bin/config UserDomainPrefix "" " : } > > After the command is run I''m getting the following error: > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Syntax error at '''' ''; expected ''}'' at > /etc/puppet/modules/powerbroker_install/manifests/init.pp:20 on node > sbxwk-blackhole.sbx.leiproductions.com > > I need to run the command with the double quotes as the value of > UserDomainPrefix but I''m having a hard time getting this one to run. I > figured if I changed to the command below, puppet wouldn''t interpret the > double quotes and things would work but I was quite wrong. > > exec { " ''/opt/pbis/bin/config UserDomainPrefix "" '' " : } > > Does anybody have any suggestions as to how one might run an exec with > double quotes? > > As always, thanks for the help in advance. > > Cheers, > > Mike > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/TxrnTcgquB4J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Seemingly Similar Threads
- I have issue in configuring file servers with AD integration.
- I have issue in configuring file servers with AD integration.
- I have issue in configuring file servers with AD integration.
- Help! How do I make Samba3 + Winbind drop the domain\ on a user's account?
- loop kerberos client samba