Puppet error in node variable

asked 2018-08-02 09:06:18 -0500

Hello everyone!

I have this manifest:

$foremanlogin = file('/etc/puppetlabs/code/environments/production/manifests/foremanlogin.txt')
$foremanpass = file('/etc/puppetlabs/code/environments/production/manifests/foremanpass.txt')

$query = foreman({foreman_user => "$foremanlogin",
                  foreman_pass => "$foremanpass",
                  item         => 'hosts',
                  search       => 'hostgroup = "Web Servers"',
filter_result => 'name',

$quoted = regsubst($query, '(.*)', '"\1"')
$query6 = join($quoted, ",")

notify{"The value is: ${query6}": }

node ${query6} {

package { 'atop':
    ensure => 'installed',


When I execute this on agent I got error:

Server Error: Could not parse for environment production: Syntax error at ''

Error in my node block

node ${query6}

Now if I remove this from code:

node ${query6} {

package { 'atop':
    ensure => 'installed',


I see correct output from notify, my variable looks like this:


Variable in correct node manifest format.

I don't understand whats wrong? variable query6 is correct.

How to fix that?

edit retag flag offensive close merge delete