Skip to content

Instantly share code, notes, and snippets.

@dizz
Created October 8, 2012 08:56
Show Gist options
  • Save dizz/3851513 to your computer and use it in GitHub Desktop.
Save dizz/3851513 to your computer and use it in GitHub Desktop.
Register host with foreman
#! /bin/sh
#
FOREMAN_URL="http://192.168.56.2:3000"
NAME=$1
MAC=$2
HOSTGROUP_ID=$3 # Change this to your favorite hostgroup
curl -s -H "Accept:application/json" \
-d "host[name]=$NAME" -d "host[hostgroup_id]=$HOSTGROUP_ID" \
-d "host[powerup]=1" -d "host[build]=0" -d "host[mac]=$MAC" \
$FOREMAN_URL/hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment