Project

General

Profile

Actions

Bug #6452

closed

Source file from the wrong environment

Added by Paolo Larcheri almost 10 years ago. Updated almost 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Puppet integration
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

In order to make some changes to a module and test before pushing them to production, I copied a module from /etc/puppet/environments/production to /etc/puppet/environments/development

Then I added the following statement to the class and consequently I generated the file /etc/puppet/environments/development/modules/rimm-base/files/hugepage-defrag-off

case $::osfamily { debian: {
case $::lsbmajdistrelease {'7': {
file {"/etc/cron.d/hugepage-defrag-off":
source => 'puppet:///modules/rimm-base/hugepage-defrag-off',
owner => 'root',
group => 'root',
mode => '0644', }
}}
}}

I run the agent on a development node that got the changes but unexpectedly failed to fetch the file:

root@eca86bfa40d8:~# /usr/sbin/puppetd --onetime --no-daemonize --verbose --logdest syslog
notice: Ignoring --listen on onetime run
info: Caching catalog for eca86bfa40d8
info: Applying configuration version '1404161338'
err: /Stage[main]/Rimm-base/File[/etc/cron.d/hugepage-defrag-off]: Could not evaluate: Could not retrieve information from *environment production* source(s) puppet:///modules/rimm-base/hugepage-defrag-off at /etc/puppet/environments/development/modules/rimm-base/manifests/init.pp:114
notice: Finished catalog run in 5.03 seconds

Following the hint given by the error message I therefore tried to copy the file
/etc/puppet/environments/development/modules/rimm-base/files/hugepage-defrag-off
into
/etc/puppet/environments/production/modules/rimm-base/files/
and magically:

root@eca86bfa40d8:~# /usr/sbin/puppetd --onetime --no-daemonize --verbose --logdest syslog
notice: Ignoring --listen on onetime run
info: Caching catalog for eca86bfa40d8
info: Applying configuration version '1404161534'
notice: /Stage[main]/Rimm-base/File[/etc/cron.d/hugepage-defrag-off]/ensure: defined content as '{md5}a62ff42d216058e8c2d791449efe3165'
notice: Finished catalog run in 4.93 seconds

The node's ENC is the following:

root@blabla-server:/etc/puppet/environments/development/modules/rimm-base# sudo -u puppet /etc/puppet/node.rb eca86bfa40d8
---
classes:
rimm-base:
rimm_ip: 10.99.99.1
rimm_mask: 255.255.255.0
timezone: Europe/Rome
rimm-drivers:
moxa_nport: false
moxa_uport1130: false
moxa_uport1250: false
parameters:
puppetmaster: foreman-proxy.blabla.it
hostgroup: blabla-development
foreman_env: development
owner_name: Admin User
owner_email: root@blabla

As provided by foreman installaer in the puppet.conf file I have:

[development]
modulepath = /etc/puppet/environments/development/modules:/etc/puppet/environments/common:/usr/share/puppet/modules
config_version =
[production]
modulepath = /etc/puppet/environments/production/modules:/etc/puppet/environments/common:/usr/share/puppet/modules
config_version =

Is this bug or am doing something wrong here?
In case it looks more like a puppet bug, but since its configuration is the one generated by the foreman installer I posted it here at this stage.

Regards,
PL

Actions

Also available in: Atom PDF