简体   繁体   English

人偶在代理上创建文件

[英]Puppet creating file on an agent

I'm running a puppet code that create a file with text, it's working when I'm running it locally (with puppet apply <.pp file> on the same machine) but not working when I'm running the code on an agent from a puppet master server (with puppet agent -t on the manifests directory) my code: 我正在运行一个使用文本创建文件的人偶代码,当我在本地运行该文件时(它在同一台机器上使用人偶应用<.pp文件>)可以正常工作,但是在代理上运行该代码时却无法工作从一个人偶主服务器(清单清单中的人偶代理-t)我的代码:

node default {
  file { '/test544/newdirha1': #the path of the new file
    ensure => 'present',
    content => 'this is the content', #this text will be inside the file
    owner => 'root',
    group => 'root',
    mode => '0644',
  }
}

The problem is that the master does not read or process your manifest file at all. 问题在于主机根本不读取或处理清单文件。

Puppet 3.8 is obsolete and unsupported. 木偶3.8已过时且不受支持。 The latest us Puppet 6.2, and since you're just getting going I recommend starting there. 我们最新的Puppet 6.2,由于您要入门,所以我建议从那里开始。 The expected layout and behavior of that and other more recent Puppet versions differ in some import and relevant ways, but in Puppet 3, the starting point for the master's processing is a single file, the "site manifest", which by default is /etc/puppet/manifests/site.pp . 该版本和其他更新的Puppet版本的预期布局和行为在某些导入和相关方式上有所不同,但是在Puppet 3中,主服务器处理的起点是单个文件“站点清单”,默认情况下为/etc/puppet/manifests/site.pp

Your master having neither a site manifest nor an external node classifier to rely upon, it will not assign any classes or resources to any node. 您的主站点既没有站点清单也不依赖外部节点分类器,则它不会将任何类或资源分配给任何节点。 It will generate only empty catalogs, which is exactly what you observe. 它将仅生成空目录,这正是您所观察到的。 Your manifest woot3.pp is ignored. 您的清单woot3.pp被忽略。 The simplest and most direct way to solve the problem would be to rename woot3.pp to site.pp . 解决问题的最简单,最直接的方法是将woot3.pp重命名为site.pp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM