This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installs basic requirements such as postgres database server | |
yum install -y wget postgresql-server postgresql-contrib pgadmin3 java-1.6.0-openjdk-devel | |
# add ovirt public repo | |
wget http://www.ovirt.org/releases/nightly/fedora/16/ovirt-engine.repo -P /etc/yum.repos.d/ | |
yum install -y ovirt-engine ovirt-engine-setup | |
# now either simply enter engine-setup, or something like the following: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# | |
USER="admin" | |
PASS="changeme" | |
FOREMAN_URL="https://foreman" | |
FQDN=$1 | |
CHANGED_ATTRIBUTE="host[environment_id]=2" | |
curl -H "Accept:application/json" -X PUT \ | |
-k -u $USER:$PASS \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "rubygems" | |
require "rest_client" | |
require "json" | |
require "uri" | |
require "logger" | |
require "pry" | |
class Resource |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HammerCommand < Clamp::Command | |
ALLOWED_CONTENT_TYPES = %w[ json yaml text ] | |
option ["-d", "--debug"], :flag, "Output more information" | |
option ["-u", "--user"], "USER", "Foreman user" | |
option ["-p", "--pass"], "PASSWORD", "Foreman password" | |
option ["-s", "--server"], "URL", "Foreman Server URL", :default => "http://localhost/" | |
option "--format", "FORMAT", "Output format", :default => "json" | |
option "--version", :flag, "show version" do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/models/host.rb b/app/models/host.rb | |
index 2dff361..b7a5aaa 100644 | |
--- a/app/models/host.rb | |
+++ b/app/models/host.rb | |
@@ -387,6 +387,7 @@ class Host < Puppet::Rails::Host | |
self.environment ||= importer.environment unless importer.environment.blank? | |
end | |
+ self.save(:validate => false) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
echo "updating system time" | |
/usr/sbin/ntpdate -sub <%= @host.params["ntp-server"] %> | |
<%# we only change hostnames on image based provisioning %> | |
<% if @host.capabilities.include?(:image) -%> | |
echo "HOSTNAME=<%= @host %>" >> /etc/sysconfig/network | |
hostname <%= @host %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%# simple snippet to generate /etc/hosts when provisioning image based systesm -%> | |
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 <%= @host %> <%= @host.shortname %> | |
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[main] | |
vardir = /var/lib/puppet | |
logdir = /var/log/puppet | |
rundir = /var/run/puppet | |
ssldir = \$vardir/ssl | |
[agent] | |
pluginsync = true | |
report = true | |
ignoreschedules = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assuming we are a CA we remove older certs if they existed | |
sudo rm -rf /var/lib/puppet/ssl/ | |
yum -t -y -e 0 install git | |
git clone --recursive git://github.com/theforeman/foreman-installer.git | |
echo include foreman::params, foreman::config::enc, foreman::config::reports, foreman_proxy, puppet, puppet::server| sudo puppet --modulepath foreman-installer/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/models/lookup_key.rb b/app/models/lookup_key.rb | |
index 256f07d..0a27c99 100644 | |
--- a/app/models/lookup_key.rb | |
+++ b/app/models/lookup_key.rb | |
@@ -150,8 +150,8 @@ class LookupKey < ActiveRecord::Base | |
begin | |
self.default_value = cast_validate_value self.default_value | |
true | |
- rescue | |
- errors.add(:default_value, "is invalid") |