Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've created the next Puppet manifest file:

node 'puppetmaster' {
    package { "screen": ensure => "installed"}
    $enhancers = [ "pixman","pixman-devel","libXfont","tigervnc-server" ]
    package { $enhancers: ensure => "installed" }
    file { '/etc/skel/.vimrc':
    content => ":set nu\n :set incsearch\n :set ignorecase\n :set smartcase\n:set ts=2",}
    file { '/root/.vimrc':
    content => ":set nu\nset incsearch\n:set ignorecase\n:set smartcase\n:set ts=2",}
    file { '/etc/sysconfig/vncserver':
    content => 'VNCSERVERS="6:root"\nVNCSERVERARGS[6]="-geometry 1152x864"',}

After applying the manifest, I check /etc/sysconfig/vncserver and it looks like this:

VNCSERVERS=6:root\nVNCSERVERARGS[6]="-geometry 1152x864"

Instead of being separated to two lines like this:

VNCSERVERARGS[6]="-geometry 1152x864"

I used the same format when setting the /etc/skel/.vimrc file and it worked like a charm so I don't understand why it doesn't work while trying to set /etc/sysconfig/vncserver, I believe it has something to do with the double quotes "". Any help would be appreciated!

share|improve this question

1 Answer 1

up vote 5 down vote accepted

You need to use double quotes ("") instead of single quotes ('). Much like the shell, perl, and other languages, single quotes in Puppet indicate a literal string and inhibit variable interpolation and the interpretation of backslash-escapes.

file { '/etc/sysconfig/vncserver':
  content => "VNCSERVERS=\"6:root\"\nVNCSERVERARGS[6]=\"-geometry 1152x864\"",}

Notice that I've had to escape the double quotes inside the string.

share|improve this answer
Thanks man, that solved my issue! – Itai Ganot Jul 25 '13 at 13:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.