Use Vagrant box boxcutter/centos71 and remove external bridge

Change-Id: I1730a6c0879a8e119fee9096c557217ad787e66c
This commit is contained in:
Christian Berendt
2015-04-14 23:47:21 +02:00
parent 8ea6a6ab77
commit dd8bf5c6cb
16 changed files with 13 additions and 201 deletions

3
Vagrantfile vendored
View File

@@ -85,9 +85,6 @@ Vagrant.configure(2) do |config|
node.vm.network :private_network, node.vm.network :private_network,
ip: '10.0.0.30', ip: '10.0.0.30',
virtualbox__intnet: 'tunnel' virtualbox__intnet: 'tunnel'
node.vm.network :public_network,
bridge: CONFIG['bridge_external'],
auto_config: false
elsif name == 'storage' elsif name == 'storage'
add_block_device(node, 1, CONFIG['resources']['storage']) add_block_device(node, 1, CONFIG['resources']['storage'])
end end

View File

@@ -1,6 +1,8 @@
--- ---
- lineinfile: dest=/etc/yum/pluginconf.d/fastestmirror.conf regexp=^enabled= line=enabled=0 - lineinfile: dest=/etc/yum/pluginconf.d/fastestmirror.conf regexp=^enabled= line=enabled=0
- yum: name=* state=latest - yum: name=* state=latest
- yum: name=http://rdo.fedorapeople.org/rdo-release.rpm state=present
- yum: name=openstack-selinux state=present
- copy: src=files/id_rsa dest=/home/vagrant/.ssh/id_packstack mode=0600 owner=vagrant group=vagrant - copy: src=files/id_rsa dest=/home/vagrant/.ssh/id_packstack mode=0600 owner=vagrant group=vagrant
- copy: src=files/id_rsa.pub dest=/home/vagrant/.ssh/id_packstack.pub mode=0600 owner=vagrant group=vagrant - copy: src=files/id_rsa.pub dest=/home/vagrant/.ssh/id_packstack.pub mode=0600 owner=vagrant group=vagrant
- copy: src=files/selinux dest=/etc/selinux/config mode=0644 owner=root group=root - copy: src=files/selinux dest=/etc/selinux/config mode=0644 owner=root group=root

View File

@@ -3,4 +3,4 @@
- yum: name=openvswitch state=present - yum: name=openvswitch state=present
- service: name=openvswitch state=started enabled=yes - service: name=openvswitch state=started enabled=yes
- openvswitch_bridge: bridge=br-ex state=present - openvswitch_bridge: bridge=br-ex state=present
- openvswitch_port: bridge=br-ex port=enp0s10 state=present - openvswitch_port: bridge=br-ex port=enp0s09 state=present

View File

@@ -6,6 +6,12 @@
- copy: src=files/exports dest=/etc/exports mode=0644 owner=root group=root - copy: src=files/exports dest=/etc/exports mode=0644 owner=root group=root
- service: name=rpcbind state=started enabled=yes - service: name=rpcbind state=started enabled=yes
- service: name=nfs-server state=started enabled=yes - service: name=nfs-server state=started enabled=yes
- service: name=nfs-lock state=started enabled=yes
when: ansible_distribution_version == '7.0.1406'
- service: name=rpc-statd state=started enabled=yes - service: name=rpc-statd state=started enabled=yes
when: ansible_distribution_version == '7.1.1503'
- service: name=nfs-idmap state=started enabled=yes
when: ansible_distribution_version == '7.0.1406'
- service: name=nfs-idmapd state=started enabled=yes - service: name=nfs-idmapd state=started enabled=yes
when: ansible_distribution_version == '7.1.1503'
- command: /usr/sbin/exportfs -a - command: /usr/sbin/exportfs -a

View File

@@ -1,10 +1,9 @@
--- ---
box: box:
name: b1-systems/centos-packstack name: boxcutter/centos71
storage_controller: 'SATA Controller' storage_controller: 'SATA Controller'
development: false development: false
bridge_internal: tap0 bridge_internal: tap0
bridge_external: tap1
network_agent: openvswitch network_agent: openvswitch
network_type: gre network_type: gre
netmask_internal: 255.255.0.0 netmask_internal: 255.255.0.0

View File

@@ -8,19 +8,12 @@ Base box
-------- --------
In theory (not tested) it is possible to use RHEL or Fedora instead of In theory (not tested) it is possible to use RHEL or Fedora instead of
CentOS. By default the box ``centos-packstack`` will be used. CentOS. By default the box ``boxcutter/centos71`` will be used.
:: ::
box: box:
name: b1-systems/centos-packstack name: boxcutter/centos71
``centos-packstack`` is a customized version of
`boxcutter/centos70 <https://github.com/box-cutter/centos-vm>`__. The
`Packer <https://packer.io/>`__ template is available in the
`stackforge/packstack-vagrant <https://github.com/stackforge/packstack-vagrant/tree/master/packer>`__
repository and the box iself on
`Atlas <https://atlas.hashicorp.com/b1-systems/centos-packstack>`__.
To change the used base box modify the value of ``name``. A list To change the used base box modify the value of ``name``. A list
of public available boxes is available on of public available boxes is available on
@@ -33,7 +26,7 @@ storage controller of the used base box must support at least three ports.
:: ::
box: box:
name: b1-systems/centos-packstack name: boxcutter/centos71
storage_controller: 'SATA Controller' storage_controller: 'SATA Controller'
@@ -46,7 +39,6 @@ Bridges
:: ::
bridge_internal: tap0 bridge_internal: tap0
bridge_external: tap1
Addresses Addresses
~~~~~~~~~ ~~~~~~~~~

View File

@@ -32,17 +32,3 @@ to start this Vagrant environment install Ansible on the Vagrant host.
:: ::
$ sudo yum install -y ansible $ sudo yum install -y ansible
Packer
------
The installation of `Packer <https://packer.io/>`__ is optional and only
necessary to build the Vagrant base box ``centos-packstack``
`provided on Atlas <https://atlas.hashicorp.com/b1-systems/boxes/centos-packstack>`__
on a local system.
The installation is documented in the
`Packer documentation <https://packer.io/docs/installation.html`__.
To build the Vagrant base box run
``/opt/packer/packer build packer/centos-packstack-7.1.json``.

4
packer/.gitignore vendored
View File

@@ -1,4 +0,0 @@
packer_cache
output-virtualbox-iso
*.box
build.*

View File

@@ -1,44 +0,0 @@
{
"builders": [
{
"vm_name": "centos-packstack",
"type": "virtualbox-iso",
"http_directory": "http",
"iso_url": "http://ftp.halifax.rwth-aachen.de/centos/7.1.1503/isos/x86_64/CentOS-7-x86_64-DVD-1503-01.iso",
"iso_checksum": "99e450fb1b22d2e528757653fcbf5fdc",
"iso_checksum_type": "md5",
"guest_os_type": "RedHat_64",
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
"virtualbox_version_file": ".vbox_version",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "10000s",
"headless": "true",
"boot_command": [
"<tab> text ks=http://{{ .HTTPIP }}:{{ .HTTPPort}}/ks.cfg<enter>"
],
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
"disk_size": 16384,
"hard_drive_interface": "sata",
"vboxmanage": [
["storagectl", "{{.Name}}", "--name", "SATA Controller", "--portcount", "4"]
]
}],
"provisioners": [{
"type": "shell",
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
"scripts": [
"scripts/update.sh",
"scripts/vbox.sh",
"scripts/sshd.sh",
"scripts/vagrant.sh",
"scripts/packstack.sh",
"scripts/cleanup.sh"
]
}],
"post-processors": [{
"type": "vagrant",
"keep_input_artifact": false,
"output": "centos-packstack-7.1.box"
}]
}

View File

@@ -1,83 +0,0 @@
lang en_US.UTF-8
keyboard us
rootpw vagrant
authconfig --enableshadow --enablemd5
timezone UTC
install
cdrom
user --name=vagrant --plaintext --password vagrant
unsupported_hardware
network --bootproto=dhcp
firewall --disabled
selinux --disabled
bootloader --location=mbr
text
skipx
zerombr
clearpart --all --initlabel
autopart --type=plain
firstboot --disabled
reboot
%packages --nobase --ignoremissing --excludedocs
deltarpm
vim-enhanced
openssh-clients
kernel-headers
kernel-devel
gcc
make
perl
curl
wget
bzip2
dkms
patch
net-tools
git
sudo
nfs-utils
-fprintd-pam
-intltool
-aic94xx-firmware
-atmel-firmware
-b43-openfwwf
-bfa-firmware
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware
-iwl100-firmware
-iwl1000-firmware
-iwl105-firmware
-iwl135-firmware
-iwl2000-firmware
-iwl2030-firmware
-iwl3160-firmware
-iwl3945-firmware
-iwl4965-firmware
-iwl5000-firmware
-iwl5150-firmware
-iwl6000-firmware
-iwl6000g2a-firmware
-iwl6000g2b-firmware
-iwl6050-firmware
-iwl7260-firmware
-libertas-usb8388-firmware
-ql2100-firmware
-ql2200-firmware
-ql23xx-firmware
-ql2400-firmware
-ql2500-firmware
-rt61pci-firmware
-rt73usb-firmware
-xorg-x11-drv-ati-firmware
-zd1211-firmware
%end
%post
echo "%vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant
cp /etc/sudoers /etc/sudoers.orig
sed -i "s/^\(.*requiretty\)$/#\1/" /etc/sudoers
echo 'Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY NO_PROXY"' >> /etc/sudoers
%end

View File

@@ -1,7 +0,0 @@
#!/usr/bin/env bash
rm -rf /dev/.udev/
rm -rf /tmp/*
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
sync

View File

@@ -1,4 +0,0 @@
#!/bin/sh
yum install -y http://rdo.fedorapeople.org/rdo-release.rpm
yum install -y openstack-selinux

View File

@@ -1,4 +0,0 @@
#!/bin/sh
echo "UseDNS no" >> /etc/ssh/sshd_config
echo "GSSAPIAuthentication no" >> /etc/ssh/sshd_config

View File

@@ -1,4 +0,0 @@
#!/bin/sh
yum update -y
reboot

View File

@@ -1,8 +0,0 @@
#!/bin/sh
mkdir /home/vagrant/.ssh
wget --no-check-certificate \
'https://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' \
-O /home/vagrant/.ssh/authorized_keys
chown -R vagrant /home/vagrant/.ssh
chmod -R go-rwsx /home/vagrant/.ssh

View File

@@ -1,12 +0,0 @@
#!/bin/sh
VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
mount -o loop /home/vagrant/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
sh /mnt/VBoxLinuxAdditions.run --nox11
umount /mnt
rm -rf /home/vagrant/VBoxGuestAdditions_$VBOX_VERSION.iso
rm -f /home/vagrant/.vbox_version
if [[ $VBOX_VERSION = "4.3.10" ]]; then
ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
fi
yum -y remove gcc cpp kernel-devel kernel-headers perl