Ask Your Question

Can you specify an environment when running the puppet agent manually? [closed]

asked 2016-07-18 12:08:53 -0600

Tundra gravatar image

So I have the basic master/agent setup and I use the puppet.conf file to specify the environment on the agent machine. I like test my changes with:

puppet agent -t --noop

Is there a way to specify a different environment then is in puppet.conf when running this command? I know I could use puppet apply and specify a module but that only works if the module was local (which it isn't).

I guess another way to do this would be to have the agent download the module from the server and then run puppet apply. However I'm also not sure if it is possible to do that?


edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Tundra
close date 2016-07-18 12:27:55.820186

1 Answer

Sort by ยป oldest newest most voted

answered 2016-07-18 12:23:04 -0600

Rob Ogilvie gravatar image

Yes, check out the --environment option:

puppet agent -t --noop --environment=OTHERENVIRONMENT
edit flag offensive delete link more



Awesome thanks! I had tried --environment 'name', needed that equal sign. Somebody should probably add that to the puppet agent man page.

Tundra gravatar imageTundra ( 2016-07-18 12:27:22 -0600 )edit

Odd, I've used it with and without the equals, and it worked both ways. Glad you got it to work!

DarylW gravatar imageDarylW ( 2016-07-18 22:04:36 -0600 )edit

Question Tools



Asked: 2016-07-18 12:08:53 -0600

Seen: 126 times

Last updated: Jul 18 '16