Parameterizing "puppet agent --test" with 'puppet agent $svn_branch --test"

45 views
Skip to first unread message

Kamal Ahmed

unread,
Jul 8, 2013, 8:54:22 AM7/8/13
to puppet...@googlegroups.com
Hi,

how can i parameterize puppet command line run, to be able to use the same host, and have multiple subversion branches being updated / managed by the same puppet agent, depending on what i specify on the command line as an argument

so i can have 3 subversion branches:

1. 7.3
2. trunk
3. RC

currently each one is hardcoded , what i would like to do is to be able to :

puppet agent 7.3 --test - to update 7.3

puppet agent trunk --test - to update trunk

puppet agent RC --test - to update trunk


Thanks,
-Kamal.

Nikola Petrov

unread,
Jul 8, 2013, 9:34:47 AM7/8/13
to puppet...@googlegroups.com
Now sure what you want to achieve here?!?!? If those are different
modules or something you can move that as a variable in facter and then
run the puppet agent by overriding the fact at runtime

Something like this

FACTER_MYENVPROPERTY="7.3" puppet agent -t
FACTER_MYENVPROPERTY="trunk" puppet agent -t
FACTER_MYENVPROPERTY="RC" puppet agent -t

then you can have conditional code around the global "myenvproperty" as
a variable.

But please give more info for your particular usecase so we
can better help you.

--
Nikola
> --
> 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...@googlegroups.com.
> To post to this group, send email to puppet...@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Lothar Gesslein

unread,
Jul 8, 2013, 9:38:34 AM7/8/13
to puppet...@googlegroups.com
Hi Kamal,

On 07/08/2013 02:54 PM, Kamal Ahmed wrote:
> currently each one is hardcoded , what i would like to do is to be able to :
>
> puppet agent 7.3 --test - to update 7.3
>
> puppet agent trunk --test - to update trunk
>
> puppet agent RC --test - to update trunk

What puppet can do is the following:

puppet agent --test --environment 7.3
puppet agent --test --environment trunk
puppet agent --test --environment RC

On the puppet master you would have checkouts of your branches in
different folders and use them for environments as described in

http://docs.puppetlabs.com/guides/environment.html

Regards,
Lothar


--
Lothar Gesslein
Linux Consultant
Mail: gess...@b1-systems.de

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537

signature.asc

Kamal Ahmed

unread,
Jul 9, 2013, 12:22:09 AM7/9/13
to puppet...@googlegroups.com
Nikola,

What i want to accomplish, is to have multiple subversion controlled branches of the code base on one Virtual Machine, and be able to run tests separately in Jenkins ( CI Srver ) . at the time of setup of Jenkins Slave , we have to declare a root directory, and this is where currently puppet updates the client configuration. But this is one place for all hosts managed by puppet.  If we can have multiple directories ( hence branches in subversion ) we can multiple branches being build on the same VM hence saving space.. Hence the need for a run time puppet agent variable

Hope this explains better,
Thanks,
-Kamal.


You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/dnwXxmIaJuM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages