using $environment yaml file with pre loaded modules

37 views
Skip to first unread message

Simon

unread,
Jan 13, 2014, 9:24:59 AM1/13/14
to puppet...@googlegroups.com
hi,

I have a strange problem that I cant see a solution too -

I have 2 modules i want to load before main so that  network and yum are setup before the other modules load.

i have the following in manifests/site.pp  to do this
stage { 'pre' :
        before => Stage['main'],
}

node default {
        class {
                'yum': stage => 'pre';
                'network': stage => 'pre';
        }
}

my problem is that I have parameters in hiera data,  if I have them in the host specific file all is fine,  if I have any in the environment specific file they fail with

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Detected in [environment] at   /etc/puppet/modules/yum/manifests/init.pp:14

If i move the module out of pre and assign it to a node it works ok.

my hiera.yaml is
---
:backends:
  - yaml
:hierarchy:
  - "%{environment}/hosts/%{fqdn}"
  - "%{environment}/groups/%{group}"
  - "%{environment}/%{environment}"
  - global

:yaml:
  :datadir: /etc/puppet/hieradata


has anyone faced anything similar or have any suggestions

thanks
simon

Simon

unread,
Jan 13, 2014, 11:10:22 AM1/13/14
to puppet...@googlegroups.com
I found that puppet does not like
  - "%{environment}/%{environment}"

if i set a variable ENV to the same and have
  - "%{environment}/%{ENV}"

it works 
Reply all
Reply to author
Forward
0 new messages