Environment & foreman_env in 0.5

Seeing some strangeness in the environment and foreman_env variables in the
yaml:

environment: &id001 production
foreman_env: *id001

The value should just be "production"

Looking at the hosts table in the database, the environment fields is
correct:

    environment: production

Even stranger, I use the foreman_env variable to set the environment in
puppet.conf and it actually comes out correctly.

This is valid YAML - the &id is a label and the *id is a pointer to
the label, so when you parse the yaml and ask for foreman_env, it
follows the pointer and retrieves the value.

The fact that it works is the clue :wink:

Greg

··· On 5 June 2012 16:37, Roger wrote: > Seeing some strangeness in the environment and foreman_env variables in the > yaml: > > environment: &id001 production > foreman_env: *id001 > > The value should just be "production" > > Looking at the hosts table in the database, the environment fields is > correct: > > environment: production > > Even stranger, I use the foreman_env variable to set the environment in > puppet.conf and it actually comes out correctly.

That makes sense. Thanks for clarifying it for me.

··· On Tuesday, June 5, 2012 11:42:13 AM UTC-4, Greg Sutcliffe wrote: > > > > Seeing some strangeness in the environment and foreman_env variables in > the > > yaml: > > > > environment: &id001 production > > foreman_env: *id001 > > > > The value should just be "production" > > > > Looking at the hosts table in the database, the environment fields is > > correct: > > > > environment: production > > > > Even stranger, I use the foreman_env variable to set the environment in > > puppet.conf and it actually comes out correctly. > > This is valid YAML - the &id is a label and the *id is a pointer to > the label, so when you parse the yaml and ask for foreman_env, it > follows the pointer and retrieves the value. > > The fact that it works is the clue ;) > > Greg >