puppet和inline_epp以及使用hiera交付内容

puppet和inline_epp以及使用hiera交付内容,puppet,epp,Puppet,Epp,可以像这样使用inline_epp的字符串变量吗 "htaccess": { "content": [ "<% include stdlib -%>", "AuthType Basic ", "AuthUserFile <%= $auth_file %>

可以像这样使用inline_epp的字符串变量吗

                    "htaccess": {
                    "content": [
                        "<% include stdlib -%>",
                        "AuthType Basic ",
                        "AuthUserFile <%= $auth_file %>",
                        "Require valid-use"
                    ],
                    "params": {
                        "auth_name": "Bootstrap content for provisioning",
                        "auth_file": "file_path"
                    }
                }
这是通知行中的结果:无效的EPP:此名称没有 效应产生一个值,然后在一个或多个前一个值被遗忘 表达式可能有错误的形式

想法是使用hiera数据向epp交付内容。
使用puppet 5.5.2和Ubuntu16.04,这里似乎发生了一些事情

首先,notice函数的语法正确吗?用括号noticemessage或Puppet的类语法notify{message:}显示通知

此外,inline_epp接受用于填充epp的参数的散列。看。在您的例子中,这类似于inline_epp$data,{auth_file=>$auth_file}

最后,EPP需要在顶部列出一行参数。你的情况应该是这样的。看

                $htacces = $sub_attrs['htaccess']
                $content = $htacces['content']
                $data = join($content, "\n")

                $auth_file = "sgsdgsdfgsdfg"

                notice inline_epp($data)