Ask Your Question

Puppet PE 3.2+ Rest API from the command line

asked 2015-04-07 12:04:46 -0600

gcollins gravatar image

Hello all!

I am currently working on doing automated builds of VM's and I would like to automate the assigning of classes to the VM's from the VM's themselves after the build is complete. I have looked at rake and it seems like it would work just fine but I see it's being deprecated and I don't want to build someone in that a year will be gone. So I would like to use the rest api to do what I need to do. Is there a set of scripts that will allow me to assign nodes to classes from the command line without the need to get down and dirty into the API itself?

I'm guess what I'm asking is, has someone come up with a set of scripts that's a frontend to the API that I could say (on the node just joined to puppet master)

puppet-class-join <classname> <nodename>

And have it add the class to the node automagically?

Just don't want to create something that may already exist.

Thanks for any help and/or information!


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-04-07 13:45:28 -0600

WhatsARanjit gravatar image

Glen, take a look at the follow Ruby gem.

You can use the update_classes method to post a new class list.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-04-07 12:04:46 -0600

Seen: 46 times

Last updated: Apr 07 '15