puppet替换文件中的string

简介: 版权声明:本文可能为博主原创文章,若标明出处可随便转载。 https://blog.csdn.net/Jailman/article/details/84783855 ...
版权声明:本文可能为博主原创文章,若标明出处可随便转载。 https://blog.csdn.net/Jailman/article/details/84783855

文件
<VirtualHost :80>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.
) https://%{SERVER_NAME}/$1 [R,L]

命题
substitute the * with the $fqdn facter variable on the first line
答案

include stdlib
$fqdn = $facts['fqdn']
file_line { 'virtual_host':
  ensure => present,
  path   => '/path/to/httpd.conf',
  line   => "<VirtualHost ${fqdn}:80>",
  match  => '<VirtualHost \*:80>',
}
目录
相关文章
|
10月前
|
数据安全/隐私保护
fatal error: boost/algorithm/string.hpp: 没有那个文件或目录
fatal error: boost/algorithm/string.hpp: 没有那个文件或目录
122 0
分别把 string, list, tuple, dict写入到文件中
import codecs list = ['2','4','3','9','1','7']     # 列表 tul = ('a','b','b','e','b')          # 元组 k={'name':'zhouyuyao','age':21}      # 字典 f=codecs.
1406 0
|
测试技术 网络安全
编写函数,以读模式打开一个文件,将其内容读入到一个string的vector中,将每一行作为一个对立的元素存于vector中
#include #include #include #include using namespace std; int main(int argc,char *argv[]) { ifstream input(argv[1]); vector vec; ...
823 0
|
Apache
Puppet: Puppet是如何找到你写在Manifests文件的配置的
今天群里有人问了我问题,其实说的我挺晕,因为好多基础知识点都理解的有问题,或者说还没有仔细看文档。
960 0

推荐镜像

更多