So reading this right you want to have an agent run code out of the test
branch on the puppetserver and not the production branch?  And it will work
fine if you change the codedir on the puppetserver?

The clients usually do not dictate the code directory on the remote
server.  They tell the server their environment and the server will handle
the rest.  The server has a root codedir, and then uses environments to run
different branches of your code.

Ideally you would have:

/etc/puppetlabs/code as your codedir on the server

Then you would have:
/etc/puppetlabs/code/environments/production
/etc/puppetlans/code/environments/test


On the agent then you would have in puppet.conf
[agent]
environment = test


Puppet has a bunch of defaults so commenting it out in the conf does not
mean it isn't set still.

HTH

On Thu, Feb 4, 2016 at 4:32 PM, CJ Cotton <mikache...@gmail.com> wrote:

> My understanding is that the Puppet CLI parameters will be the values
> taken in at run time.
> I have two code directories; test and production.
>
> They are exact replicas of each other.
> If I force the puppetserver to run /etc/puppetlabs/test -- it will run
> without issue and as expected.
>
> When I run the command;
> puppet agent -t --codedir /etc/puppetlabs/test --noop
>
> It will still run code out of /etc/puppetlabs/production. I tested this by
> putting a notify statement in  production, and not having one in test.
> Every time I ran it, it ran with the notify statement indicating it was
> still reading /etc/puppetlabs/production.
>
> Does anyone have any idea why it would not be using the parameter I input?
>
> The puppetmaster does have the master.code.dir commented out.
> The puppet.conf file on master only has an agent environment
>
> I'm running this from a node (different server). I verified the
> puppet.conf for the server I'm running it from also does not have values,
> though at one point of testing I explicitly hardcoded them and it still
> failed.
>
> Ideas, thoughts?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/522ca301-dddb-4111-b19d-ebbd30666337%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/522ca301-dddb-4111-b19d-ebbd30666337%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAJNEtxvxdbwPa%2B_8FHEUFhSQZmRA9%2B65xy680MV4Liw9nCwGEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to