大网数据广告活动
服务器运维问答

Creating new environments in Puppet Server

· 52CE 我爱测

We are using a shared Puppet Server to manage both QA and DEV environments . The default configurations Puppet Server uses is Production environment # puppet master --configprint all | grep production environment = production man…

问题原文

原帖链接 · Zama Ques · CC BY-SA 3.0

We are using a shared Puppet Server to manage both QA and DEV environments . The default configurations Puppet Server uses is Production environment

# puppet master --configprint all | grep production

environment = production
manifest = /data/puppetlabs/code/environments/production/manifests
modulepath = /data/puppetlabs/code/environments/production/modules:/data/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules

I want to enable two more environments DEV and QA. For this I will copy the above directories and rename to qa and development environment respectively on Puppet Server. What configuration items to enable in puppet.conf to enable the new environments in Puppet Server. If I create multiple entries as in example above will it work . Please suggest .

已采纳解答

原帖链接 · Dmitry Ilyin · CC BY-SA 3.0

The classical way to configure the environment is this:

#Environments
[development]
     modulepath =/etc/puppet/development/modules
     manifest = /etc/puppet/development/manifest/site.pp
     manifestdir = /etc/puppet/development/manifest

[testing]
     modulepath =/etc/puppet/testing/modules
     manifest = /etc/puppet/testing/manifest/site.pp
     manifestdir = /etc/puppet/testing/manifest

[production]
     modulepath =/etc/puppet/production/modules
     manifest = /etc/puppet/production/manifest/site.pp
     manifestdir = /etc/puppet/production/manifest

Then you can place modules and manifests for every enviroment into these folders.

But this method is considered depricated and people are using directory based environemnts. Set environmentpath to /etc/puppet/environments and create environment folders with modules and manifests there.

For example:

/etc/puppet/environments/production/modules/
/etc/puppet/environments/production/manifests/
/etc/puppet/environments/testing/modules/
/etc/puppet/environments/testing/manifests/

The, you can use r10k to automagickally download these environments fron Git branches.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-06-22)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。