简体   繁体   English

人偶模块未添加到目录中

[英]puppet module not being added to catalog

I have a module that builds /etc/passwd on nodes using concat. 我有一个使用concat在节点上构建/ etc / passwd的模块。 The puppetmaster is somehow not able to see that I've created the module. puppetmaster无法以某种方式看到我已经创建了模块。 When I run 'puppet agent -t' on the client nodes, I see no errors nor is the password file touched. 当我在客户端节点上运行'puppet agent -t'时,看不到任何错误,也看不到密码文件。

class eeee_passwd {

$eeee_passwd = '/etc/passwd'
  concat  { $eeee_passwd:
  owner => root,
  group => root,
  mode  => '0644',
}

concat::fragment  { 'passwd_root':
  target  =>  $eeee_passwd,
  content =>  'root:x:0:0:root:/root:/bin/bash',
  order   =>  01,
}

concat::fragment  { 'passwd_bin':
  target  =>  $eeee_passwd,
  content =>  'bin:x:1:1:bin:/bin:/sbin/nologin',
  order   =>  02,
}

concat::fragment { 'passwd_daemon':
  target  =>  $eeee_passwd,
  content =>  'daemon:x:2:2:daemon:/sbin:/sbin/nologin',
  order   =>  03,
}

Creating a module is not sufficient. 创建模块还不够。 You must also instruct the master to add the one or more appropriate classes or resources provided by the module to the node's catalog. 您还必须指示主服务器将模块提供的一个或多个适当的类或资源添加到节点的目录中。 For instance, supposing that you are classifying nodes via node blocks, you might have something like this: 例如,假设您要通过节点块对节点进行分类,则可能会有以下内容:

node mynode {
  ...
  include 'eeee_passwd'
  ...
}

If it were otherwise, then you would have a lot of trouble managing dissimilar nodes via the same master. 如果不是这样,那么通过同一主节点管理异类节点将有很多麻烦。

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

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