file_line doesn't work with variables?

542 views
Skip to first unread message

Matt Gieselman

unread,
Mar 28, 2014, 1:58:31 PM3/28/14
to puppet...@googlegroups.com

Given the following snippet from an init.pp file:

          $instance = 22

file_line { 'instance' :

              path => '/etc/init.d/myfile',

              line => 'INSTANCE=$instance',

              match => 'INSTANCE='

}

What I expect to happen is have the line in /etc/init.d/myfile change from INSTANCE=1 to INSTANCE=22, what happens is the file has INSTANCE=$instance any suggestions?

Stephen Jahl

unread,
Mar 28, 2014, 2:02:02 PM3/28/14
to puppet...@googlegroups.com
I think you need to double quote strings that contain variables. So try:

    line => "INSTANCE=$instance",

-Steve


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/879ed188-481d-4c25-805c-acd5ce1b3a85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages