Puppet:无法从 Puppet 控制台找到角色
Puppet: Unable to find role from puppet console
控制库的 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
和docker个人资料代码如下
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 控制台中,我创建了开发环境并将生产环境添加为父环境,但我无法在 class 列表中找到 role::docker
或 profile::docker
。我也尝试过刷新,但没有帮助。
请参考以下截图
并且在 Puppet server -> Development environment 中我可以看到 docker.pp 在 role 和 profiles 中,供参考
[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]#
我不确定我的错误是什么?请求你的帮助。
我怎样才能解决这些问题?
谢谢。
在您的 development
环境中修改 environment.conf
并如下更新模块路径
modulepath = /etc/puppetlabs/code/environments/development/modules:$basemodulepath
然后重新启动 puppetserver。
我的问题得到了解决。
控制库的 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
和docker个人资料代码如下
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 控制台中,我创建了开发环境并将生产环境添加为父环境,但我无法在 class 列表中找到 role::docker
或 profile::docker
。我也尝试过刷新,但没有帮助。
请参考以下截图
并且在 Puppet server -> Development environment 中我可以看到 docker.pp 在 role 和 profiles 中,供参考
[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]#
我不确定我的错误是什么?请求你的帮助。 我怎样才能解决这些问题?
谢谢。
在您的 development
环境中修改 environment.conf
并如下更新模块路径
modulepath = /etc/puppetlabs/code/environments/development/modules:$basemodulepath
然后重新启动 puppetserver。
我的问题得到了解决。