Puppet:无法从木偶控制台找到角色

时间:2017-10-21 17:11:28

标签: git puppet puppet-enterprise

Control repo的Puppetfile

forge "http://forge.puppetlabs.com"

# Modules from the Puppet Forge
# Versions should be updated to be the latest at the time you start
mod "puppetlabs/inifile",    '1.5.0'
mod "puppetlabs/stdlib",     '4.11.0'
mod "puppetlabs/concat",     '2.1.0'
mod "puppetlabs/java",       '1.6.0'
mod "puppet-selinux",        '0.8.0'
mod "garethr-docker",        '5.3.0'

# Modules from Git
# Examples: https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd#examples
#mod 'apache',
#  :git    => 'https://github.com/puppetlabs/puppetlabs-apache',
#  :commit => '83401079053dca11d61945bd9beef9ecf7576cbf'

#mod 'apache',
#  :git    => 'https://github.com/puppetlabs/puppetlabs-apache',
#  :branch => 'docs_experiment'

mod 'ssh',
  :git => 'https://github.com/rajagennu/puppet-ssh.git',
  :ref => 'master'

mod 'ntp',
  :git => 'https://github.com/rajagennu/puppet-ntp_1.git',
  :ref => 'master'

mod 'role',
  :git => 'https://github.com/rajagennu/puppet-role.git',
  :ref => 'development'

mod 'profile',
  :git => 'https://github.com/rajagennu/puppet-profile.git',
  :ref => 'development'

个人资料在这里 https://github.com/rajagennu/puppet-profile/tree/development

和泊坞窗配置文件代码如下

class profile::docker {
include ::docker
      }

并且角色就在这里 https://github.com/rajagennu/puppet-role/tree/development

和docker角色代码如下

class role::docker {
  include profile::docker 
}

一切都提交后,我跑了

puppet-code deploy --all --wait 

在Puppet控制台中,我创建了开发环境,并将Production添加为父环境,但我无法在班级列表中找到role::dockerprofile::docker。我也试过刷新,但没有帮助。

请在下面找到截图作为参考

enter image description here

在Puppet服务器中 - >开发环境我可以在角色和配置文件中看到docker.pp,供参考

[root@rgenupula1 puppetserver]# cd /etc/puppetlabs/code/environments/development/
[root@rgenupula1 development]# ls
environment.conf  hieradata  LICENSE  manifests  modules  Puppetfile  README.md  scripts  site
[root@rgenupula1 development]# cd modules/
[root@rgenupula1 modules]# ls
concat  docker  inifile  java  ntp  profile  role  selinux  ssh  stdlib
[root@rgenupula1 modules]# cat profile/manifests/docker.pp
class profile::docker {
    include ::docker
}
[root@rgenupula1 modules]# cat role/manifests/docker.pp
class role::docker {
  include profile::docker
}
[root@rgenupula1 modules]#

我不确定这里的错误是什么?请求你的帮助。 我该如何排除这些情况?

谢谢。

1 个答案:

答案 0 :(得分:0)

修改environment.conf环境中的development并更新模块路径,如下所示

modulepath   = /etc/puppetlabs/code/environments/development/modules:$basemodulepath

然后重启puppetserver。

我的问题得到了解决。