Skip to content

Instantly share code, notes, and snippets.

View jcpowermac's full-sized avatar

Joseph Callen jcpowermac

View GitHub Profile
require "fileutils"
require "digest/sha2"
module ProjectHanlon
module ImageService
# Base image abstract
class Base < ProjectHanlon::Object
MOUNT_COMMAND = (Process::uid == 0 ? "mount" : "sudo -n mount")
UMOUNT_COMMAND = (Process::uid == 0 ? "umount" : "sudo -n umount")
Log file initialized...
E, [2014-07-02T17:10:00.977000 #5609] ERROR -- image_service/base.rb:129:in `archive_handler?'>>ProjectHanlon::ImageService::OSInstall#archive_handler?: fullpath test: Version: 20070708
Usage: /usr/bin/fuseiso [-n] [-p] [-c <iocharset>] [-h] <isofs_image_file> <mount_point> [<FUSE library options>]
Where options are:
-n -- do NOT maintain file $HOME/.mtab.fuseiso
-p -- maintain mount point;
create it if it does not exists and delete it on exit
-c <iocharset> -- specify iocharset for Joliet filesystem
-h -- print this screen
require "fileutils"
require "digest/sha2"
module ProjectHanlon
module ImageService
# Base image abstract
class Base < ProjectHanlon::Object
MOUNT_COMMAND = (Process::uid == 0 ? "mount" : "sudo -n mount")
UMOUNT_COMMAND = (Process::uid == 0 ? "umount" : "sudo -n umount")
virt-sysprep -a /dev/virtualmachine/virctlpaw002 --hostname virctlpaw002.virtomation.com \
--firstboot-command "sed -i -r 's/IPADDR=(\b[0-9]{1,3}\.){3}[0-9]{1,3}\b'/IPADDR=10.53.252.62/ /etc/sysconfig/network-scripts/ifcfg-eth0" \
--firstboot-command 'systemctl restart network' \
--firstboot-command 'yum install -y http://rdo.fedorapeople.org/rdo-release.rpm' \
--firstboot-command 'yum install openstack-packstack -y'
@jcpowermac
jcpowermac / gist:72072c7f2df107db433f
Created August 12, 2014 14:53
Create RabbitMQ passwords
for serv in "cinder" "nova" "neutron" "heat";
do
passwd=`openssl rand -base64 8`
echo "$serv - $passwd"
rabbitmqctl add_user $serv $passwd
done
yum install http://mirror.sfo12.us.leaseweb.net/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm
yum install mongodb-server mongodb -y
systemctl restart mongod.service
systemctl start tomcat.service
yum install tomcat tomcat-admin-webapps
vi /etc/tomcat/tomcat-users.xml
systemctl status tomcat
systemctl start tomcat
__author__ = 'jcallen'
from subprocess import Popen, PIPE
import syslog
import httplib
import sys
import re
import json
import traceback
@jcpowermac
jcpowermac / gist:816eafb2acd214439287
Last active August 29, 2015 14:06
Create Custom RHEL 6.5 Minimal
mkdir /mnt/cdrom
mkdir /rhel
mount -o loop rhel-server-6.5-x86_64-dvd.iso /mnt/cdrom
cat > /etc/yum.repos.d/rhel-dvd.repo <<EOF
[dvd]
name=Red Hat Enterprise Linux Installation DVD
baseurl=file:///mnt/cdrom/Server
enabled=0
#!/bin/bash
# Kickstart for RHEL/CentOS 6
# see: http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s1-kickstart2-options.html
install
url --url=http://<%= config.hanlon_server %>:<%= config.api_port %><%= config.websvc_root %>/image/os/<%= @image_uuid %>
text
lang en_US.UTF-8
keyboard us
rootpw <%= @root_password %>
diff --git a/core/image_service/base.rb b/core/image_service/base.rb
index a38368d..e94bc93 100644
--- a/core/image_service/base.rb
+++ b/core/image_service/base.rb
@@ -94,7 +94,7 @@ module ProjectHanlon
logger.error e.message
return cleanup_on_failure(create_mount_success, create_imagepath_success, e.message)
end
-
+puts ">>>>> in base.rb add_image"