Ask Your Question
0

Generate script for manually maintained node

asked 2013-04-01 11:29:32 -0500

dustyburwell gravatar image

We're using foreman and have several nodes that are maintained by it. For one reason or another, we have a few nodes that will be unable to communicate with foreman and will need to be maintained manually. The way we've done that so far is to build a .pp file for the node based on the yaml export for a similar node and copy that, along with the other necessary module files and packages, to the manually maintained node and run puppet apply against it.

Is there an easy way to use foreman or anything else to generate ... (more)

edit retag flag offensive close merge delete

Comments

I take the system can't communicate with the puppetmaster either/same host?

domcleal gravatar imagedomcleal ( 2013-04-01 16:23:15 -0500 )edit

Correct, it's the same host.

dustyburwell gravatar imagedustyburwell ( 2013-04-01 16:49:43 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-04-01 16:39:34 -0500

domcleal gravatar image

You can avoid converting the YAML to a manifest by using a simple ENC script with puppet apply. In the same way as a puppetmaster can call out to Foreman via the ENC script (/etc/puppet/node.rb usually), apply can call a script which could reference a copy of the YAML file you prepared earlier.

$ cat /tmp/iridium.int.m0dlx.com.yaml 
parameters: 
  puppetmaster: puppet
  root_pw: xybxa6JUkz63w
classes: 
  - foo
environment: production

This is the simple ENC script and Puppet config:

$ cat /tmp/enc.sh
#!/bin/sh
exec cat /tmp/${1}.yaml

$ cat /tmp/puppet.conf 
[main]
node_terminus = exec
external_nodes ...
(more)
edit flag offensive delete link more

Comments

Cool, I'll try this out tomorrow! Thanks.

dustyburwell gravatar imagedustyburwell ( 2013-04-01 16:51:06 -0500 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2013-04-01 11:29:32 -0500

Seen: 637 times

Last updated: Apr 01 '13