人偶未创建 agent_catalog_run.lock 文件

puppet is not creating agent_catalog_run.lock file

我有一个启动 puppet 代理然后等待 /var/lib/puppet/state/agent_catalog_run.lock 文件的 ansible 脚本。

我发现这个文件没有在目标机器上创建。 Ansible 版本为:1.9.7,Puppet 代理版本为:3.8.7 我检查了目标 linux 机器,puppet 代理处于 运行 状态。

下面是ansible脚本行:

- name: ensure that puppet lock file is created
  wait_for:
    path: /var/lib/puppet/state/agent_catalog_run.lock
    timeout: 1800

在这种情况下应该检查哪些内容? (注意:没有创建人偶日志。)

代码只是检查错误的文件。

顾名思义,agent_catalog_run.lock是:

A lock file to indicate that a puppet agent catalog run is currently in progress. The file contains the pid of the process that holds the lock on the catalog run.

换句话说,只有当 Puppet 代理 运行 出现时,该文件才会存在。

您可能需要 pidfile,即:

The file containing the PID of a running process. This file is intended to be used by service management frameworks and monitoring systems to determine if a puppet process is still in the process table.

  • Default: $rundir/${run_mode}.pid

(其中 $run_mode 将是 "agent"。)

请注意,您可以使用 puppet config print 检查您的实际设置,例如:

▶ puppet config print pidfile
/Users/alexharvey/.puppetlabs/var/run/main.pid

你的会有所不同,因为我的 运行ning 作为 Mac OS X 笔记本电脑上的非根用户。因此,我认为您需要将代码更改为:

- name: wait for the puppet PID file to be created
  wait_for:
    path: /var/run/agent.pid
    timeout: 1800