Puppet目录创建未正确解析变量

Puppet目录创建未正确解析变量,puppet,Puppet,我正在尝试基于变量值创建一个目录。如果$测试 以下是我的test.pp文件的内容: $test = 'testDir123' file {$test: path => '/temp/$test', ensure => 'directory' } 我希望在运行puppet apply test.pp之后会创建/temp/testDir123,但是,会创建一个/temp/$test目录 我以前使用过puppet变量来解析URL和用户名 我尝试过其他编写测试清单的方法: $

我正在尝试基于变量值创建一个目录。如果$测试

以下是我的test.pp文件的内容:

$test = 'testDir123'

file {$test:
  path   => '/temp/$test',
  ensure => 'directory'
}
我希望在运行puppet apply test.pp之后会创建/temp/testDir123,但是,会创建一个/temp/$test目录

我以前使用过puppet变量来解析URL和用户名

我尝试过其他编写测试清单的方法:

$test = 'testDir123'

file {$test:
  path   => '/temp/${test}',
  ensure => 'directory'
}
及 $test='/temp/testDir123'

file {$test:
  path   => '${test}',
  ensure => 'directory'
}

但他们都失败了。由于某种原因,变量$test似乎没有被解析。

使用双引号进行插值(详细信息为)。这太好了。它就像一个符咒。谢谢