Puppet agent environment

216 views
Skip to first unread message

Evgeniy Troitskiy

unread,
Jan 23, 2015, 3:04:22 AM1/23/15
to puppet...@googlegroups.com

Hello all!

I have a directory environments configured in Puppet (production and development) and I use the Foreman as an ENC.

When I try to set development environment for the host in Foreman, then Puppet agent execute module from right environment. But if agent try to access to files folder (puppet:///modules/$module_name/testfile), it gets testfile from same directory from production not from development. And if I change environment to development in Puppet agent config file - puppet:///modules/$module_name/testfile links to right place in development environment.

How can I correct this?

Additional info:

part of puppet.conf

[master]

    environment       = production

    environmentpath   = /etc/puppet/environments

part of fileserver.conf

[development]

   path /etc/puppet/environments/development/files

   allow *

[production]

   path /etc/puppet/environments/production/files

   allow *

/etc/puppet/environments/

├── production

│   ├── files

│   ├── manifests

│   └── modules

└── development

    ├── files

    ├── manifests

    └── modules 

Thanks for advice!



--

Regards,

Evgeniy Troitskiy

Craig White

unread,
Jan 23, 2015, 12:21:53 PM1/23/15
to puppet...@googlegroups.com
why not let puppet manage puppet.conf and thus changes in foreman make changes to puppet.conf?

Tony Thayer

unread,
Jan 23, 2015, 12:30:01 PM1/23/15
to puppet...@googlegroups.com
I don't specify the environment for the master at all and haven't had any problems thus far with the wrong environment being picked up. I have 'Production' set as the client environment and will pass specific environments to the agent via 'puppet agent -t --environment=MYDEVENV', though Craig's suggestion does make more sense given you're using an ENC.
Reply all
Reply to author
Forward
0 new messages