Ask Your Question
0

Razor Server set static IP

asked 2016-03-01 07:34:19 -0500

tatroc gravatar image

What is the standard way to set a static IP on a node after it has been deployed with Razor. I am doing a POC with Razor, I was able to deploy a CentOS server. However, I'm unsure of how to set the static IP. It would be preferable if I could set it during the Razor install. Or configure it after install using the puppet agent.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-03-03 15:24:18 -0500

smcclellan gravatar image

Hello,

I'd recommend using hooks for this. The flow would be that a node binds to a policy, which triggers a hook script to run. That hook script determines which static IP a node should use. The script returns that value as metadata, which gets applied to the node. Later, when the node requests its install script, this metadata can be used to change how the install scripts are rendered for the node, in this case setting the static IP.

Here's what would be required:

  • Write a hook that will run on the node-bound-to-policy event. This hook should operate similar to the hostname hook, so that can be used as a model if you choose to write yours in Ruby. The job of this script, which can be written in any executable language, is to update the node's ip metadata to the desired value.
  • Modify the kernel_args.erb in your task to set the static IP of the node to the ip value of the node's metadata, e.g.: --ip=<%= node.metadata['ip'] %>

The hook script can be as complicated or simple as you like. You could have a block of available addresses and use a counter to select an available value, or query an external system for the value, or any other number of methods.

Let me know if you need any further help!

Scott

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

2 followers

Stats

Asked: 2016-03-01 07:34:19 -0500

Seen: 145 times

Last updated: Mar 03 '16