【发布时间】:2019-02-13 22:41:55
【问题描述】:
我正在运行一个创建带有文本的文件的 puppet 代码,当我在本地运行它时它可以工作(在同一台机器上使用 puppet apply <.pp file>)但在我运行代码时它不工作在来自 puppet 主服务器的代理上(在 manifests 目录中使用 puppet agent -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',
}
}
【问题讨论】:
-
它不工作是因为
/test544在客户端文件系统上不存在吗?没有错误信息,我们只能推测。 -
您好,test544 文件夹存在于 puppet 代理中,当我在 puppet 服务器(puppet master)上运行 pp 文件时没有任何错误:[root@puppetserver manifests]# puppet agent -t Info: Retrieving pluginfacts Info: Retrieving plugin Info: Caching catalog for puppet Info: Applying configuration version '1550060319' Notice: Finished catalog run in 0.02 seconds
-
目录运行成功且非常快速地完成而不应用文件表明代理正在接收一个空目录。这可能由多种原因引起,其中突出的原因是包含节点声明的清单位于错误的位置或目录编译器无法读取,或者需要清除主服务器的环境缓存(重新启动主服务是一种简单的方法实现这一点)。要在这些和可能的其他之间进行判断,我们需要更多信息。
-
嗨,John,两台 puppet 机器:master 和 agent - 已经重新启动,以防万一任何系统服务需要重新启动,但仍然无法正常工作。请告诉我/指导我如何为您提供相关信息。谢谢!
-
首先,让我们在服务器上获取清单的路径名,相对于 Puppet 的基本目录。此外,如果清单包含的内容超出了您已经呈现的内容,那么这也是相关的,相关环境的站点清单目录中的任何(其他)清单的内容也是如此。您使用的是哪个版本的 Puppet?
标签: puppet