Hello,
I'm using PuppetServer 1.1.3 and want to use directory environments (I can not update to puppet 4 because of
http://projects.theforeman.org/issues/8447, Foreman is used for reporting and facts only (CMDB like)).
The main puppet repo has 2 branches:
- master (production)
- development (test&dev)
I use r10k to manage the environments under /etc/puppet/environments
--- o<----
:sources:
example:
basedir: /etc/puppet/environments
prefix: false
remote: <GIT_URL>
--- o<----
The following master setup has worked for both "master" and "development"
---- o< ----
# file /etc/puppet/puppet.conf
[master]
# insecure not via server_facts ...
environment = ...
# PuppetDB Enabled
storeconfigs = true
storeconfigs_backend = ...
reports = ...
# Hiera Config File
hiera_config = ...
default_manifest = /etc/puppet/environments/$environment/manifests/site.pp
manifestdir = /etc/puppet/environments/$environment/manifests
manifest = /etc/puppet/environments/$environment/manifests/site.pp
modulepath = /etc/puppet/modules:/etc/puppet/environments/$environment/modules:/etc/puppet/environments/$environment/forge:/etc/puppet/environments/$environment/3rdparty
# ENC Enabled
node_terminus = exec
external_nodes = ...
trusted_server_facts = true
trusted_node_data = true
## Make sure master uses another directory so master can be agent of someone else
ssldir = ...
certname = ...
server = ...
## Add extra DNS Names
dns_alt_names = ...
---- o< ----
Now I want to switch to directory environments changed configuration as follows:
Puppet master config is as follows:
---- o< ----
# file /etc/puppet/puppet.conf
[master]
environment = ...
# PuppetDB Enabled
storeconfigs = true
storeconfigs_backend = ...
reports = ...
# Hiera Config File
hiera_config = ...
## Directory Environments enabled
default_manifest = /etc/puppet/manifests/site.pp
environmentpath = /etc/puppet/environments
environment_timeout = 0
basemodulepath = /etc/puppet/modules
disable_per_environment_manifest = false
# ENC Enabled
node_terminus = exec
external_nodes = ...
trusted_server_facts = true
trusted_node_data = true
## Make sure master uses another directory so master can be agent of someone else
ssldir = ...
certname = ...
server = ...
## Add extra DNS Names
dns_alt_names = ...
---- o< ----
The environment.conf is
---- o< ----
# file /etc/puppet/environments/master/environment.conf and
# file /etc/puppet/environments/development/environment.conf
# The module path
modulepath = ./modules/:./forge/:./3rdparty/:$basemodulepath
# Manifest
manifest = manifests/site.pp
# current or future (3.8 only)
# parser = current
## Path to custom script
# config_version=
## Timeout for cache
environment_timeout = unlimited
---- o< ----
This setup works for environment "development" but not "master".
agent shell# puppet agent --onetime --test --environment master => Fail with 404
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class my_webserver for webserver-test1 on node webserver-test1
agent shell# puppet agent --onetime --test --environment development => OK
If I do "mv /etc/puppet/environments/master /etc/puppet/environments/mytest123" and restart the puppetserver mytest123 environment works
agent shell# puppet agent --onetime --test --environment mytest123 => OK
If I do "mv /etc/puppet/environments/mytest123 /etc/puppet/environments/master" and restart the puppetserver master environment FAILES again
agent shell# puppet agent --onetime --test --environment master => Fail with 404
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class my_webserver for webserver-test1 on node webserver-test1
So it is not the repo content but the name of the environment causing the problem I guess.
Has someone seen this issue yet ??
Using "prefix: true" on r10k should fix the issue and generate unique environment names.
Also renaming all git branches should solve the issue.
However I would like to know if this issue is known and if it still exists on Puppet 4.0 ?
Regards,
Robert