To get started developing ManageIQ, or to deploy on an OS other than CentOS or Red Hat Enterprise Linux (RHEL), there are a few steps to get started.
A lot of this has been automated in the ManageIQ kickstart file. Details on installing an image using a quickstart file are available from the Kickstart page on Fedora.
- For RHEL, make sure you have
rhel-6-server-rpms
channel enabled.
rhn-channel --add --channel=rhel-6-server-rpms --user=(your RHN login) --password=(password)
-
As root, add the miqbuilder user
chmod 777 /opt useradd miqbuilder echo "" >> /etc/sudoers
echo "" >> /etc/sudoers echo "miqbuilder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers ```
-
(Optional) For both RHEL and CentOS, download and install the epel (Extra Packages for Enterprise Linux) package
yum -y install http://dl.fedoraproject.org/pub/epel/6Server/x86_64/epel-release-6-8.noarch.rpm
-
Update the VM and add iptables rule
yum update -y iptables -I INPUT -p tcp --dport 3000 -j ACCEPT service iptables save service iptables restart
-
ManageIQ prerequisites are git, libxml2 and libxslt (including headers), postgresql, and memcached. sudo should be upgraded to the latest version. On RHEL and CentOS, install these packages:
yum -y install git libxml2-devel libxslt libxslt-devel sudo yum -y install postgresql-server postgresql-devel memcached ruby-devel
-
Start memcached
service memcached start chkconfig memcached on
-
Configure Postgres
-
Initialize the database:
chkconfig postgresql on service postgresql initdb
-
You want to modify
/var/lib/pgsql/data/pg_hba.conf
,by commenting out everything and add a new line, but you can do that by running the command below as root:echo "local all all trust" > /var/lib/pgsql/data/pg_hba.conf
-
You want to modify `/var/lib/pgsql/data/postgresql.conf``,by commenting out everything and add a new line, but you can do that by running the commands below as root
echo "" >> /var/lib/pgsql/data/postgresql.conf echo "listen_addresses = '*'" >> /var/lib/pgsql/data/postgresql.conf
-
Start the database:
service postgresql start
-
Log in as postgres, and generate test, production and development databases and the root user. Then assign the development database
vmdb_development
toroot
su - postgres for i in test production development;do createdb vmdb_$i;done psql -c "create role root login password 'smartvm'" psql -c "alter database vmdb_development owner to root" exit
-
-
As user miqbuilder, set up the ManageIQ Ruby development environment.
su - miqbuilder \curl -sSL https://get.rvm.io | bash . ~/.bash_profile rvm install 2.0.0 gem install bundler -v "~>1.3"
-
Clone the ManageIQ repo and install dependencies:
cd /opt git clone https://github.com/ManageIQ/manageiq cd manageiq/vmdb bundle install --without qpid cd .. vmdb/bin/rake build:shared_objects cd vmdb bundle install --without qpid
-
Ensure that ManageIQ is connecting to the right database. Edit the
config/database.yml
file. Add theroot
user for thevmdb_development
database.cp config/database.pg.yml config/database.yml bin/rake db:migrate
-
Add SSL support
mkdir ~/.ssl cd ~/.ssl openssl genrsa -out server.key 2048
#answer prompts when running the command below openssl req -new -key server.key -out server.csr
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt ```
- Replace the contents of the rails file
vi /opt/manageiq/vmdb/script/rails
with the rails file below:
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
require 'rack'
# Thin SSL workaround
module Rack
module Handler
class Thin
def self.run(app, options={})
app = Rack::Chunked.new(Rack::ContentLength.new(app))
server = ::Thin::Server.new(options[:Host] || '0.0.0.0',
options[:Port] || 3000,
app)
server.ssl = true
server.ssl_options = {
:private_key_file => '/home/miqbuilder/.ssl/server.key',
:cert_chain_file => '/home/miqbuilder/.ssl/server.crt'
}
yield server if block_given?
server.start
end
end
end
end
# Workaround end
APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
require 'rails/commands'
- add the line below to
vi /opt/manageiq/vmdb/config/environments/development.rb
, before the 'end' line
config.force_ssl = true
- start the evm
cd /opt/manageiq/vmdb/
bin/rake evm:start
You should now be able to access the ManageIQ console at <IP_ADDRESS>:3000. The default username and password is username : admin
and password : smartvm