Chef knife equivalent in puppet

1,552 views
Skip to first unread message

sateesh

unread,
Jan 31, 2012, 7:49:48 AM1/31/12
to Puppet Users
Hi,

Is there any tool like chef knife in puppet.

My requirement is, I need to install a specified module on a plane
ubuntu machine with a single line command as chef has with knife. In
chef knife we will specify the IP, username, password, and the recipe
to install on a plane new ubuntu machine. Which installs the chef and
the specified module on the plane ubuntu machine.

Thanks in advance,
Sateesh B.

Nan Liu

unread,
Jan 31, 2012, 11:03:14 PM1/31/12
to puppet...@googlegroups.com

So the model isn't the same, puppet doesn't deploy the module on the
agent, a catalog is compiled on the server and the catalog is what the
client enforces. With that said, if you have a specific system in mind
that you want to deploy a puppet module, on the master:

node 'hostname' {
include 'class_name'
}

If you use an ENC such as dashboard, you can use rake task or REST API
to modify the system's class.

HTH,

Nan

Kenneth Lo

unread,
Feb 1, 2012, 10:34:52 AM2/1/12
to puppet...@googlegroups.com

Hi Nan:

I'm interested to know more regarding your comment. In my environment
we've decided to use dashboard for ENC and "the one true source" for
customization (parameters, node configuration etc).

Where is the place to check on tutorial and documentation your suggestion?
I have no real prior knowledge on ruby. Thx in advance.

--KL

On 1/31/12 11:03 PM, "Nan Liu" <n...@puppetlabs.com> wrote:

>
>
>If you use an ENC such as dashboard, you can use rake task or REST API
>to modify the system's class.
>
>HTH,
>
>Nan
>

>--
>You received this message because you are subscribed to the Google Groups
>"Puppet Users" group.
>To post to this group, send email to puppet...@googlegroups.com.
>To unsubscribe from this group, send email to
>puppet-users...@googlegroups.com.
>For more options, visit this group at
>http://groups.google.com/group/puppet-users?hl=en.
>

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.

sateesh

unread,
Jan 31, 2012, 11:58:49 PM1/31/12
to Puppet Users
Thanks Nan for your response.

So, can't we install the required module on a plain ubuntu machine
using puppet? Only procedure is to install the Puppet client on the
plain ubuntu machine and make it as a agent for the server and include
the node code in the server. Am I right? or is there any other
technique for that?

Thanks in advance,
Sateesh B.


On Feb 1, 9:03 am, Nan Liu <n...@puppetlabs.com> wrote:

Ronald Cotoni

unread,
Jan 31, 2012, 9:59:35 PM1/31/12
to puppet...@googlegroups.com
This may do what you want:  http://docs.puppetlabs.com/mcollective/ Not entirely sure as I have not used it yet.  

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.




--
Ronald Cotoni
Systems Engineer

Nan Liu

unread,
Feb 1, 2012, 5:25:48 PM2/1/12
to puppet...@googlegroups.com
On Wed, Feb 1, 2012 at 10:34 AM, Kenneth Lo <k...@paydiant.com> wrote:
> I'm interested to know more regarding your comment. In my environment
> we've decided to use dashboard for ENC and "the one true source" for
> customization (parameters, node configuration etc).
>
> Where is the place to check on tutorial and documentation your suggestion?
> I have no real prior knowledge on ruby. Thx in advance.

Using the rake task is reasonably straightforward. I'm not finding an
authoritative documentation, but you can use this page as starting
point:
http://docs.puppetlabs.com/dashboard/manual/1.2/maintaining.html

In dashboard directory run rake -T, and the ones of interest are
node:* nodeclass:* and nodegroup: *.

Also there's a puppet dashboard face:
https://github.com/puppetlabs/puppetlabs-dashboard

Thanks,

Nan

John Warburton

unread,
Feb 1, 2012, 5:46:59 PM2/1/12
to puppet...@googlegroups.com
On 2 February 2012 09:25, Nan Liu <n...@puppetlabs.com> wrote:
Using the rake task is reasonably straightforward. I'm not finding an
authoritative documentation, but you can use this page as starting

Nan, this has been bugging me for a while - I've raised this as an issue - http://projects.puppetlabs.com/issues/12366

Regards

John

Nick Fagerlund

unread,
Feb 1, 2012, 7:16:28 PM2/1/12
to Puppet Users
Like this?

http://docs.puppetlabs.com/pe/2.0/console_classes_groups.html#rake-api

It needs a few more tasks added, and then I'll C&P it to the dashboard
manual too.

John Warburton

unread,
Feb 1, 2012, 7:40:55 PM2/1/12
to puppet...@googlegroups.com
On 2 February 2012 11:16, Nick Fagerlund <nick.fa...@puppetlabs.com> wrote:
Like this?

http://docs.puppetlabs.com/pe/2.0/console_classes_groups.html#rake-api

It needs a few more tasks added, and then I'll C&P it to the dashboard
manual too.

Very nice. Thanks!

John

Nick Fagerlund

unread,
Feb 1, 2012, 8:28:23 PM2/1/12
to Puppet Users

Cody Herriges

unread,
Feb 1, 2012, 9:07:12 PM2/1/12
to puppet...@googlegroups.com
Sateesh,

I think Nan's response isn't fully answering your question since it isn't clear how you are executing Chef. Reading your question I foresee that you are actually in fact running Chef Solo, knife is configured with an ssh key that is capable to logging into a specific machine, uploading a cookbook, and executing it? Your trying to implement the same workflow using Puppet's stand alone mode? If this assumption is correct than we can point you in a better direction. Nan's response would be relevant if you were using Chef Server vs. Puppet Master.

Regards,

--
Cody Herriges
Professional Service Engineer - Puppet Labs
pgp key: 0x5DB77142 @ pgp.mit.edu

John Warburton

unread,
Feb 1, 2012, 9:54:44 PM2/1/12
to puppet...@googlegroups.com

sateesh

unread,
Feb 2, 2012, 7:04:36 AM2/2/12
to Puppet Users
Hi Cody,

Probably that may also solve my problem.

My requirement is I need to run a command line that takes the IP,
user, password and module to be installed on that IP. By giving that
command it should install that module on that IP.

So, in chef after doing that command (it is knife bootstrap), the new
IP will be installed with chef and registers with the server along
with installing the specified recipe. In dashboard we can see what all
the agents are associated to that server.

Also, is there any Dashboard where we can manage the clients that are
registered to the Puppet server.

Thanks,
Sateesh B.

sateesh

unread,
Feb 2, 2012, 7:04:41 AM2/2/12
to Puppet Users
Hi Cody,

Probably that may also solve my problem.

My requirement is I need to run a command line that takes the IP,
user, password and module to be installed on that IP. By giving that
command it should install that module on that IP.

So, in chef after doing that command (it is knife bootstrap), the new
IP will be installed with chef and registers with the server along
with installing the specified recipe. In dashboard we can see what all
the agents are associated to that server.

Also, is there any Dashboard where we can manage the clients that are
registered to the Puppet server.

Thanks,
Sateesh B.

On Feb 2, 7:07 am, Cody Herriges <c.a.herri...@gmail.com> wrote:

sateesh

unread,
Feb 2, 2012, 8:18:04 AM2/2/12
to Puppet Users
Hi Cody,

Probably that may also solve my problem.

My requirement is I need to run a command line that takes the IP,
user, password and module to be installed on that IP. By giving that
command it should install that module on that IP.

So, in chef after doing that command (it is knife bootstrap), the new
IP will be installed with chef and registers with the server along
with installing the specified recipe. In dashboard we can see what all
the agents are associated to that server.

Also, is there any Dashboard where we can manage the clients that are
registered to the Puppet server.

Thanks,
Sateesh B.

On Feb 2, 7:07 am, Cody Herriges <c.a.herri...@gmail.com> wrote:

Cody Herriges

unread,
Feb 2, 2012, 12:24:05 PM2/2/12
to puppet...@googlegroups.com
On Feb 2, 2012, at 5:18 AM, sateesh wrote:

> Hi Cody,
>
> Probably that may also solve my problem.
>
> My requirement is I need to run a command line that takes the IP,
> user, password and module to be installed on that IP. By giving that
> command it should install that module on that IP.
>
> So, in chef after doing that command (it is knife bootstrap), the new
> IP will be installed with chef and registers with the server along
> with installing the specified recipe. In dashboard we can see what all
> the agents are associated to that server.
>
> Also, is there any Dashboard where we can manage the clients that are
> registered to the Puppet server.

Ah! So the end goal is to really just be able to bootstrap puppet on a machine, not necessarily run an arbitrary module? If that is the case you should look at the following module, https://github.com/puppetlabs/puppetlabs-cloud-provisioner. Yes it says it is for provisioning cloud instances but it is in fact two faces. One for launching aws nodes and another for bootstrapping Puppet, via SSH. Last I checked the install via SSH did require keys though, wouldn't allow for passwords to be given on the command line. I think there is already a feature request for passwords.

sateesh

unread,
Feb 3, 2012, 12:38:09 AM2/3/12
to Puppet Users
Hi Cody,

Thanks for your response.

As Specified by you I understood this way. Please correct me if I am
wrong.

1) I will be having a ready new VM with Ubuntu installed. So I dont
need to execute the step "puppet node create --image ami-2342a94a --
keypair jeff --type t1.micro" in the link
https://github.com/puppetlabs/puppetlabs-cloud-provisioner.

2) In the step ssh -i ~/.ssh/jeff.pem
ro...@ec2-107-20-18-142.compute-1.amazonaws.com, I can replace the
amazon url with my local VM IP. (Ex: xx.xxx.xx.xxx).

3) The command "puppet node install --login root --keyfile ~/.ssh/
jeff.pem ec2-107-20-18-142.compute-1.amazonaws.com" (replaced with my
local IP) will install the puppet on the specified IP.

4) Command "ssh ro...@ec2-107-20-18-142.compute-1.amazonaws.com puppet
--version" will display the puppet version of the newly installed
local IP. (Will the puppet is installed with the new version. And how
can we specify the which version to install in this step.)

The next step is now I need to install some modules that are located
in the server on to newly created IP. I think in chef the server will
copy on to the new VM in /tmp location and install the modules on that
IP. After installing it will delete the copied module. So, is there
any mechanism in Puppet.

Also, in chef if we bootstrap any vm, that will be registered as agent
to the server and logs what modules have been installed on that
machine. There is a search functionality where we can get the list of
IP's where a particular module has been installed (by writing a query
in the recipe).

Thanks in advance,
Sateesh B.

On Feb 2, 10:24 pm, Cody Herriges <c.a.herri...@gmail.com> wrote:
> On Feb 2, 2012, at 5:18 AM, sateesh wrote:
>
> > Hi Cody,
>
> > Probably that may also solve my problem.
>
> > My requirement is I need to run a command line that takes the IP,
> > user, password and module to be installed on that IP. By giving that
> > command it should install that module on that IP.
>
> > So, in chef after doing that command (it is knife bootstrap), the new
> > IP will be installed with chef and registers with the server along
> > with installing the specified recipe. In dashboard we can see what all
> > the agents are associated to that server.
>
> > Also, is there any Dashboard where we can manage the clients that are
> > registered to the Puppet server.
>
> Ah!  So the end goal is to really just be able to bootstrap puppet on a machine, not necessarily run an arbitrary module?  If that is the case you should look at the following module,https://github.com/puppetlabs/puppetlabs-cloud-provisioner.  Yes it says it is for provisioning cloud instances but it is in fact two faces.  One for launching aws nodes and another for bootstrapping Puppet, via SSH.  Last I checked the install via SSH did require keys though, wouldn't allow for passwords to be given on the command line.  I think there is already a feature request for passwords.

Felix Frank

unread,
Feb 3, 2012, 4:51:01 AM2/3/12
to puppet...@googlegroups.com
Hi,

On 02/03/2012 06:38 AM, sateesh wrote:
> The next step is now I need to install some modules that are located
> in the server on to newly created IP. I think in chef the server will
> copy on to the new VM in /tmp location and install the modules on that
> IP. After installing it will delete the copied module. So, is there
> any mechanism in Puppet.

you need to do this master-side. Make sure that a newly strapped VM
always includes your wanted classes.

As to how to do this, I'm not familiar with cloud-provisioner so I
couldn't say. If you can specify the bootstrapping commandline for
puppet, you could do

FACTER_bootstrapvm=true puppetd --test

and in your manifest

if $::bootstrapvm {
include bootstrap_class
}

HTH,
Felix

sateesh

unread,
Feb 6, 2012, 12:18:34 AM2/6/12
to Puppet Users
Hi Cody. Can you please help me in this.

Thanks in advance,
Sateesh B.

On Feb 3, 10:38 am, sateesh <bbalasate...@gmail.com> wrote:
> Hi Cody,
>
> Thanks for your response.
>
> As Specified by you I understood this way. Please correct me if I am
> wrong.
>
> 1) I will be having a ready new VM with Ubuntu installed. So I dont
> need to execute the step "puppet node create --image ami-2342a94a --
> keypair jeff --type t1.micro" in the linkhttps://github.com/puppetlabs/puppetlabs-cloud-provisioner.
>
> 2) In the step ssh -i ~/.ssh/jeff.pem
> r...@ec2-107-20-18-142.compute-1.amazonaws.com, I can replace the
> amazon url with my local VM IP. (Ex: xx.xxx.xx.xxx).
>
> 3) The command "puppet node install --login root --keyfile ~/.ssh/
> jeff.pem ec2-107-20-18-142.compute-1.amazonaws.com" (replaced with my
> local IP) will install the puppet on the specified IP.
>
> 4) Command "ssh r...@ec2-107-20-18-142.compute-1.amazonaws.com puppet

Cody Herriges

unread,
Feb 6, 2012, 1:31:22 PM2/6/12
to puppet...@googlegroups.com

Unlink chef server Puppet doesn't "copy" sets of code to an agent machine. It compiles a directed acyclic graph we call the catalog and deliveries it via HTTPS as JSON. So where in chef you would register a "runlist" that copies down cookbooks, in Puppet you "classify" the machine. This is done manually with a node definition or can be programmatically accomplish via an ENC like Puppet Dashboard or Foreman. If you set up the Dashboard you can classify the new machine you just installed Puppet on using the classify action available in the puppet node face.

To query what nodes have what classes you can reference your ENC or like more and more people, they grab the data live via MCollective.

signature.asc
Reply all
Reply to author
Forward
0 new messages