Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ansiwen committed Oct 22, 2015
0 parents commit cfd7073
Show file tree
Hide file tree
Showing 3 changed files with 225 additions and 0 deletions.
112 changes: 112 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2" if not defined? VAGRANTFILE_API_VERSION

PRIVATE_NET = "192.168.73"

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.hostname = "devstack"
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "rarguello/fedora-22"

# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080

# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "#{PRIVATE_NET}.10"

if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = "http://#{PRIVATE_NET}.1:3128/"
config.proxy.https = "http://#{PRIVATE_NET}.1:3128/"
config.proxy.no_proxy = "localhost,127.0.0.1,#{PRIVATE_NET}.1"
end

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"

#config.vm.synced_folder ".", "/vagrant", type: "nfs"
#config.vm.synced_folder ".", "/vagrant", type: "9p"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
vb.memory = 4096
vb.cpus = 2
end

config.vm.provider "libvirt" do |domain|
domain.memory = 4096
domain.cpus = 2
domain.nested = true
# domain.volume_cache = 'none'
end



#
# View the documentation for the provider you are using for more
# information on available options.

# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end

# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", privileged: false, inline: <<-SHELL
# cat > /tmp/pip.conf <<EOF
#[global]
#index-url = http://#{PRIVATE_NET}.1:3141/root/pypi/+simple/
#trusted-host = #{PRIVATE_NET}.1
#EOF
# sudo cp /tmp/pip.conf /etc
# sudo sed -i 's/^#baseurl/baseurl/' /etc/yum.repos.d/*
# sudo sed -i 's/^metalink/#metalink/' /etc/yum.repos.d/*
# sudo sed -i 's,download.fedoraproject.org/pub,mirror2.hs-esslingen.de,' /etc/yum.repos.d/*
sudo dnf install -y rsyslog joe yum-utils net-tools nfs-utils mlocate telnet sudo git dnf
chmod o+x .
# git clone /vagrant/repos/openstack-dev/devstack
git clone https://git.openstack.org/openstack-dev/devstack
cp /vagrant/local.conf devstack/
cd devstack
./stack.sh |& tee /tmp/stack.log
sudo systemctl enable openvswitch mariadb rabbitmq-server httpd
SHELL
end
32 changes: 32 additions & 0 deletions local.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[[local|localrc]]
DEST=/home/vagrant/stack
DATA_DIR=$DEST/data
SERVICE_DIR=$DEST/status
SCREEN_LOGDIR=$DATA_DIR/logs/
LOGFILE=/$DATA_DIR/logs/devstacklog.txt
VERBOSE=True
USE_SCREEN=True

RABBIT_PASSWORD=123456
MYSQL_PASSWORD=123456
SERVICE_TOKEN=123456
SERVICE_PASSWORD=123456
ADMIN_PASSWORD=123456

# Networking
SERVICE_HOST=127.0.0.1
NETWORK_GATEWAY=10.1.0.1
FIXED_RANGE=10.1.0.0/24
FIXED_NETWORK_SIZE=256
VIRT_DRIVER=libvirt
LOG_COLOR=True

ENABLED_SERVICES=g-api,g-reg,key,n-api,n-cpu,n-sch,n-cond,mysql,rabbit,dstat,quantum,q-svc,q-agt,q-dhcp,q-l3,q-meta

IMAGE_URLS="http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img"
export YUM=dnf

# To test on un-released Fedoras, uncomment the below line
# FORCE=yes

#GIT_BASE=/vagrant/repos
81 changes: 81 additions & 0 deletions update-repos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/sh

GIT_BASE='git://git.openstack.org'

REPOS='
openstack-dev/devstack
openstack/cinder
openstack/glance
openstack/heat
openstack/horizon
openstack/ironic
openstack/keystone
openstack/neutron
openstack/neutron-fwaas
openstack/neutron-lbaas
openstack/neutron-vpnaas
openstack/nova
openstack/swift
openstack/requirements
openstack/tempest
openstack/tempest-lib
openstack/python-cinderclient
openstack/python-glanceclient
openstack/python-heatclient
openstack/python-ironicclient
openstack/keystoneauth
openstack/python-keystoneclient
openstack/python-neutronclient
openstack/python-novaclient
openstack/python-swiftclient
openstack/python-openstackclient
openstack/cliff
openstack/futurist
openstack/debtcollector
openstack/automaton
openstack/oslo.cache
openstack/oslo.concurrency
openstack/oslo.config
openstack/oslo.context
openstack/oslo.db
openstack/oslo.i18n
openstack/oslo.log
openstack/oslo.messaging
openstack/oslo.middleware
openstack/oslo.policy
openstack/oslo.reports
openstack/oslo.rootwrap
openstack/oslo.serialization
openstack/oslo.service
openstack/oslo.utils
openstack/oslo.versionedobjects
openstack/oslo.vmware
openstack/pycadf
openstack/stevedore
openstack/taskflow
openstack/tooz
openstack/glance_store
openstack/heat-cfntools
openstack/heat-templates
openstack/django_openstack_auth
openstack/keystonemiddleware
openstack/swift3
openstack/ceilometermiddleware
openstack/os-brick
openstack/ironic-lib
openstack/dib-utils
openstack/os-apply-config
openstack/os-collect-config
openstack/os-refresh-config
openstack/ironic-python-agent
'

for r in $REPOS ; do
if [ -x repos/$r.git ] ; then
pushd repos/$r.git
git pull --rebase
popd
else
git clone $GIT_BASE/$r.git repos/$r.git
fi
done

0 comments on commit cfd7073

Please sign in to comment.