vagrant-libvirt 0.0.41 → 0.0.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.coveralls.yml +1 -0
- data/.github/issue_template.md +37 -0
- data/.gitignore +21 -0
- data/.travis.yml +24 -0
- data/Gemfile +26 -0
- data/LICENSE +22 -0
- data/README.md +1380 -0
- data/Rakefile +8 -0
- data/example_box/README.md +29 -0
- data/example_box/Vagrantfile +60 -0
- data/example_box/metadata.json +5 -0
- data/lib/vagrant-libvirt.rb +29 -0
- data/lib/vagrant-libvirt/action.rb +370 -0
- data/lib/vagrant-libvirt/action/create_domain.rb +322 -0
- data/lib/vagrant-libvirt/action/create_domain_volume.rb +87 -0
- data/lib/vagrant-libvirt/action/create_network_interfaces.rb +302 -0
- data/lib/vagrant-libvirt/action/create_networks.rb +361 -0
- data/lib/vagrant-libvirt/action/destroy_domain.rb +83 -0
- data/lib/vagrant-libvirt/action/destroy_networks.rb +95 -0
- data/lib/vagrant-libvirt/action/forward_ports.rb +227 -0
- data/lib/vagrant-libvirt/action/halt_domain.rb +41 -0
- data/lib/vagrant-libvirt/action/handle_box_image.rb +156 -0
- data/lib/vagrant-libvirt/action/handle_storage_pool.rb +57 -0
- data/lib/vagrant-libvirt/action/is_created.rb +18 -0
- data/lib/vagrant-libvirt/action/is_running.rb +21 -0
- data/lib/vagrant-libvirt/action/is_suspended.rb +42 -0
- data/lib/vagrant-libvirt/action/message_already_created.rb +16 -0
- data/lib/vagrant-libvirt/action/message_not_created.rb +16 -0
- data/lib/vagrant-libvirt/action/message_not_running.rb +16 -0
- data/lib/vagrant-libvirt/action/message_not_suspended.rb +16 -0
- data/lib/vagrant-libvirt/action/message_will_not_destroy.rb +17 -0
- data/lib/vagrant-libvirt/action/package_domain.rb +105 -0
- data/lib/vagrant-libvirt/action/prepare_nfs_settings.rb +94 -0
- data/lib/vagrant-libvirt/action/prepare_nfs_valid_ids.rb +17 -0
- data/lib/vagrant-libvirt/action/prune_nfs_exports.rb +27 -0
- data/lib/vagrant-libvirt/action/read_mac_addresses.rb +40 -0
- data/lib/vagrant-libvirt/action/remove_libvirt_image.rb +20 -0
- data/lib/vagrant-libvirt/action/remove_stale_volume.rb +50 -0
- data/lib/vagrant-libvirt/action/resume_domain.rb +34 -0
- data/lib/vagrant-libvirt/action/set_boot_order.rb +109 -0
- data/lib/vagrant-libvirt/action/set_name_of_domain.rb +64 -0
- data/lib/vagrant-libvirt/action/share_folders.rb +71 -0
- data/lib/vagrant-libvirt/action/start_domain.rb +307 -0
- data/lib/vagrant-libvirt/action/suspend_domain.rb +40 -0
- data/lib/vagrant-libvirt/action/wait_till_up.rb +109 -0
- data/lib/vagrant-libvirt/cap/mount_p9.rb +42 -0
- data/lib/vagrant-libvirt/cap/nic_mac_addresses.rb +17 -0
- data/lib/vagrant-libvirt/cap/synced_folder.rb +113 -0
- data/lib/vagrant-libvirt/config.rb +746 -0
- data/lib/vagrant-libvirt/driver.rb +118 -0
- data/lib/vagrant-libvirt/errors.rb +153 -0
- data/lib/vagrant-libvirt/plugin.rb +92 -0
- data/lib/vagrant-libvirt/provider.rb +130 -0
- data/lib/vagrant-libvirt/templates/default_storage_pool.xml.erb +13 -0
- data/lib/vagrant-libvirt/templates/domain.xml.erb +244 -0
- data/lib/vagrant-libvirt/templates/private_network.xml.erb +42 -0
- data/lib/vagrant-libvirt/templates/public_interface.xml.erb +26 -0
- data/lib/vagrant-libvirt/util.rb +11 -0
- data/lib/vagrant-libvirt/util/collection.rb +19 -0
- data/lib/vagrant-libvirt/util/erb_template.rb +22 -0
- data/lib/vagrant-libvirt/util/error_codes.rb +100 -0
- data/lib/vagrant-libvirt/util/network_util.rb +151 -0
- data/lib/vagrant-libvirt/util/timer.rb +17 -0
- data/lib/vagrant-libvirt/version.rb +5 -0
- data/locales/en.yml +162 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/support/environment_helper.rb +46 -0
- data/spec/support/libvirt_context.rb +30 -0
- data/spec/support/sharedcontext.rb +34 -0
- data/spec/unit/action/destroy_domain_spec.rb +97 -0
- data/spec/unit/action/set_name_of_domain_spec.rb +21 -0
- data/spec/unit/action/wait_till_up_spec.rb +127 -0
- data/spec/unit/config_spec.rb +113 -0
- data/spec/unit/templates/domain_all_settings.xml +137 -0
- data/spec/unit/templates/domain_defaults.xml +46 -0
- data/spec/unit/templates/domain_spec.rb +84 -0
- data/tools/create_box.sh +130 -0
- data/tools/prepare_redhat_for_box.sh +119 -0
- data/vagrant-libvirt.gemspec +54 -0
- metadata +93 -3
@@ -0,0 +1,46 @@
|
|
1
|
+
<domain type='' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
|
2
|
+
<name></name>
|
3
|
+
<uuid></uuid>
|
4
|
+
<memory></memory>
|
5
|
+
<vcpu>1</vcpu>
|
6
|
+
|
7
|
+
|
8
|
+
<cpu mode='host-model'>
|
9
|
+
<model fallback='allow'></model>
|
10
|
+
</cpu>
|
11
|
+
|
12
|
+
|
13
|
+
<os>
|
14
|
+
<type>hvm</type>
|
15
|
+
<kernel></kernel>
|
16
|
+
<initrd></initrd>
|
17
|
+
<cmdline></cmdline>
|
18
|
+
</os>
|
19
|
+
<features>
|
20
|
+
<acpi/>
|
21
|
+
<apic/>
|
22
|
+
<pae/>
|
23
|
+
</features>
|
24
|
+
<clock offset='utc'/>
|
25
|
+
<devices>
|
26
|
+
|
27
|
+
|
28
|
+
<serial type='pty'>
|
29
|
+
<target port='0'/>
|
30
|
+
</serial>
|
31
|
+
<console type='pty'>
|
32
|
+
<target port='0'/>
|
33
|
+
</console>
|
34
|
+
|
35
|
+
|
36
|
+
<input type='mouse' bus='ps2'/>
|
37
|
+
|
38
|
+
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us' />
|
39
|
+
<video>
|
40
|
+
<model type='cirrus' vram='9216' heads='1'/>
|
41
|
+
</video>
|
42
|
+
|
43
|
+
|
44
|
+
</devices>
|
45
|
+
|
46
|
+
</domain>
|
@@ -0,0 +1,84 @@
|
|
1
|
+
require 'support/sharedcontext'
|
2
|
+
|
3
|
+
require 'vagrant-libvirt/config'
|
4
|
+
require 'vagrant-libvirt/util/erb_template'
|
5
|
+
|
6
|
+
describe 'templates/domain' do
|
7
|
+
include_context 'unit'
|
8
|
+
|
9
|
+
class DomainTemplateHelper < VagrantPlugins::ProviderLibvirt::Config
|
10
|
+
include VagrantPlugins::ProviderLibvirt::Util::ErbTemplate
|
11
|
+
|
12
|
+
def finalize!
|
13
|
+
super
|
14
|
+
@qargs = @qemu_args
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
let(:domain) { DomainTemplateHelper.new }
|
19
|
+
let(:xml_expected) { File.read(File.join(File.dirname(__FILE__), test_file)) }
|
20
|
+
|
21
|
+
context 'when only defaults used' do
|
22
|
+
let(:test_file) { 'domain_defaults.xml' }
|
23
|
+
it 'renders template' do
|
24
|
+
domain.finalize!
|
25
|
+
expect(domain.to_xml('domain')).to eq xml_expected
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'when all settings enabled' do
|
30
|
+
before do
|
31
|
+
domain.instance_variable_set('@domain_type', 'kvm')
|
32
|
+
domain.cpu_mode = 'custom'
|
33
|
+
domain.cpu_feature(name: 'AAA', policy: 'required')
|
34
|
+
domain.cputopology(sockets: '1', cores: '3', threads: '2')
|
35
|
+
domain.machine_type = 'pc-compatible'
|
36
|
+
domain.machine_arch = 'x86_64'
|
37
|
+
domain.loader = '/efi/loader'
|
38
|
+
domain.boot('network')
|
39
|
+
domain.boot('cdrom')
|
40
|
+
domain.boot('hd')
|
41
|
+
domain.emulator_path = '/usr/bin/kvm-spice'
|
42
|
+
domain.instance_variable_set('@domain_volume_path', '/var/lib/libvirt/images/test.qcow2')
|
43
|
+
domain.instance_variable_set('@domain_volume_cache', 'unsafe')
|
44
|
+
domain.disk_bus = 'ide'
|
45
|
+
domain.disk_device = 'vda'
|
46
|
+
domain.storage(:file, path: 'test-disk1.qcow2')
|
47
|
+
domain.storage(:file, path: 'test-disk2.qcow2')
|
48
|
+
domain.disks.each do |disk|
|
49
|
+
disk[:absolute_path] = '/var/lib/libvirt/images/' + disk[:path]
|
50
|
+
end
|
51
|
+
domain.storage(:file, device: :cdrom)
|
52
|
+
domain.storage(:file, device: :cdrom)
|
53
|
+
domain.channel(type: 'unix',
|
54
|
+
target_name: 'org.qemu.guest_agent.0',
|
55
|
+
target_type: 'virtio')
|
56
|
+
domain.channel(type: 'spicevmc',
|
57
|
+
target_name: 'com.redhat.spice.0',
|
58
|
+
target_type: 'virtio')
|
59
|
+
domain.channel(type: 'unix',
|
60
|
+
target_type: 'guestfwd',
|
61
|
+
target_address: '192.0.2.42',
|
62
|
+
target_port: '4242',
|
63
|
+
source_path: '/tmp/foo')
|
64
|
+
domain.random(model: 'random')
|
65
|
+
domain.pci(bus: '0x06', slot: '0x12', function: '0x5')
|
66
|
+
domain.pci(bus: '0x03', slot: '0x00', function: '0x0')
|
67
|
+
domain.usb(bus: '1', device: '2', vendor: '0x1234', product: '0xabcd')
|
68
|
+
domain.redirdev(type: 'tcp', host: 'localhost', port: '4000')
|
69
|
+
domain.redirfilter(class: '0x0b', vendor: '0x08e6',
|
70
|
+
product: '0x3437', version: '2.00', allow: 'yes')
|
71
|
+
domain.watchdog(model: 'i6300esb', action: 'reset')
|
72
|
+
domain.smartcard(mode: 'passthrough')
|
73
|
+
domain.tpm_path = '/dev/tpm0'
|
74
|
+
|
75
|
+
domain.qemuargs(value: '-device')
|
76
|
+
domain.qemuargs(value: 'dummy-device')
|
77
|
+
end
|
78
|
+
let(:test_file) { 'domain_all_settings.xml' }
|
79
|
+
it 'renders template' do
|
80
|
+
domain.finalize!
|
81
|
+
expect(domain.to_xml('domain')).to eq xml_expected
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
data/tools/create_box.sh
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
#set -xu
|
3
|
+
|
4
|
+
error() {
|
5
|
+
local msg="${1}"
|
6
|
+
echo "==> ERROR: ${msg}"
|
7
|
+
exit 1
|
8
|
+
}
|
9
|
+
|
10
|
+
usage() {
|
11
|
+
echo "Usage: ${0} IMAGE [BOX] [Vagrantfile.add]"
|
12
|
+
echo
|
13
|
+
echo "Package a qcow2 image into a vagrant-libvirt reusable box"
|
14
|
+
}
|
15
|
+
|
16
|
+
# Print the image's backing file
|
17
|
+
backing(){
|
18
|
+
local img=${1}
|
19
|
+
qemu-img info "$img" | grep 'backing file:' | cut -d ':' -f2
|
20
|
+
}
|
21
|
+
|
22
|
+
# Rebase the image
|
23
|
+
rebase(){
|
24
|
+
local img=${1}
|
25
|
+
qemu-img rebase -p -b "" "$img"
|
26
|
+
[[ "$?" -ne 0 ]] && error "Error during rebase"
|
27
|
+
}
|
28
|
+
|
29
|
+
# Is absolute path
|
30
|
+
isabspath(){
|
31
|
+
local path=${1}
|
32
|
+
[[ "$path" =~ ^/.* ]]
|
33
|
+
}
|
34
|
+
|
35
|
+
if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
36
|
+
usage
|
37
|
+
exit 1
|
38
|
+
fi
|
39
|
+
|
40
|
+
IMG=$(readlink -e "$1")
|
41
|
+
[[ "$?" -ne 0 ]] && error "'$1': No such image"
|
42
|
+
|
43
|
+
IMG_DIR=$(dirname "$IMG")
|
44
|
+
IMG_BASENAME=$(basename "$IMG")
|
45
|
+
|
46
|
+
BOX=${2:-}
|
47
|
+
# If no box name is supplied infer one from image name
|
48
|
+
if [[ -z "$BOX" ]]; then
|
49
|
+
BOX_NAME=${IMG_BASENAME%.*}
|
50
|
+
BOX=$BOX_NAME.box
|
51
|
+
else
|
52
|
+
BOX_NAME=$(basename "${BOX%.*}")
|
53
|
+
fi
|
54
|
+
|
55
|
+
[[ -f "$BOX" ]] && error "'$BOX': Already exists"
|
56
|
+
|
57
|
+
CWD=$(pwd)
|
58
|
+
TMP_DIR="$CWD/_tmp_package"
|
59
|
+
TMP_IMG="$TMP_DIR/box.img"
|
60
|
+
|
61
|
+
mkdir -p "$TMP_DIR"
|
62
|
+
|
63
|
+
[[ ! -r "$IMG" ]] && error "'$IMG': Permission denied"
|
64
|
+
|
65
|
+
if [ -n "$3" ] && [ -r "$3" ]; then
|
66
|
+
VAGRANTFILE_ADD="$(cat $3)"
|
67
|
+
fi
|
68
|
+
|
69
|
+
# We move / copy (when the image has master) the image to the tempdir
|
70
|
+
# ensure that it's moved back / removed again
|
71
|
+
if [[ -n $(backing "$IMG") ]]; then
|
72
|
+
echo "==> Image has backing image, copying image and rebasing ..."
|
73
|
+
trap "rm -rf $TMP_DIR" EXIT
|
74
|
+
cp "$IMG" "$TMP_IMG"
|
75
|
+
rebase "$TMP_IMG"
|
76
|
+
else
|
77
|
+
if fuser -s "$IMG"; then
|
78
|
+
error "Image '$IMG_BASENAME' is used by another process"
|
79
|
+
fi
|
80
|
+
|
81
|
+
# move the image to get a speed-up and use less space on disk
|
82
|
+
trap 'mv "$TMP_IMG" "$IMG"; rm -rf "$TMP_DIR"' EXIT
|
83
|
+
mv "$IMG" "$TMP_IMG"
|
84
|
+
fi
|
85
|
+
|
86
|
+
cd "$TMP_DIR"
|
87
|
+
|
88
|
+
#Using the awk int function here to truncate the virtual image size to an
|
89
|
+
#integer since the fog-libvirt library does not seem to properly handle
|
90
|
+
#floating point.
|
91
|
+
IMG_SIZE=$(qemu-img info --output=json "$TMP_IMG" | awk '/virtual-size/{s=int($2)/(1024^3); print (s == int(s)) ? s : int(s)+1 }')
|
92
|
+
|
93
|
+
echo "{$IMG_SIZE}"
|
94
|
+
|
95
|
+
cat > metadata.json <<EOF
|
96
|
+
{
|
97
|
+
"provider": "libvirt",
|
98
|
+
"format": "qcow2",
|
99
|
+
"virtual_size": ${IMG_SIZE}
|
100
|
+
}
|
101
|
+
EOF
|
102
|
+
|
103
|
+
cat > Vagrantfile <<EOF
|
104
|
+
Vagrant.configure("2") do |config|
|
105
|
+
|
106
|
+
config.vm.provider :libvirt do |libvirt|
|
107
|
+
|
108
|
+
libvirt.driver = "kvm"
|
109
|
+
libvirt.host = ""
|
110
|
+
libvirt.connect_via_ssh = false
|
111
|
+
libvirt.storage_pool_name = "default"
|
112
|
+
|
113
|
+
end
|
114
|
+
|
115
|
+
${VAGRANTFILE_ADD:-}
|
116
|
+
end
|
117
|
+
EOF
|
118
|
+
|
119
|
+
echo "==> Creating box, tarring and gzipping"
|
120
|
+
|
121
|
+
tar cvzf "$BOX" -S --totals ./metadata.json ./Vagrantfile ./box.img
|
122
|
+
|
123
|
+
# if box is in tmpdir move it to CWD before removing tmpdir
|
124
|
+
if ! isabspath "$BOX"; then
|
125
|
+
mv "$BOX" "$CWD"
|
126
|
+
fi
|
127
|
+
|
128
|
+
echo "==> ${BOX} created"
|
129
|
+
echo "==> You can now add the box:"
|
130
|
+
echo "==> 'vagrant box add ${BOX} --name ${BOX_NAME}'"
|
@@ -0,0 +1,119 @@
|
|
1
|
+
#!/bin/bash +x
|
2
|
+
|
3
|
+
# This script should help to prepare RedHat and RedHat like OS (CentOS,
|
4
|
+
# Scientific Linux, ...) for Vagrant box usage.
|
5
|
+
|
6
|
+
# To create new box image, just install minimal base system in VM on top of not
|
7
|
+
# fully allocated qcow2 image. Then upload this script to the VM and run it.
|
8
|
+
# After script has finished, nothing else than halting machine should be done.
|
9
|
+
|
10
|
+
# For more info about creating custom box refer to
|
11
|
+
# https://github.com/vagrant-libvirt/vagrant-libvirt/tree/master/example_box
|
12
|
+
|
13
|
+
# We need to set a hostname.
|
14
|
+
if [ $# -ne 1 ]; then
|
15
|
+
echo "Usage: $0 <hostname>"
|
16
|
+
echo "Hostname should be in format vagrant-[os-name], e.g. vagrant-redhat63."
|
17
|
+
exit 1
|
18
|
+
fi
|
19
|
+
|
20
|
+
|
21
|
+
# On which version of RedHet are we running?
|
22
|
+
RHEL_MAJOR_VERSION=$(sed 's/.*release \([0-9]\)\..*/\1/' /etc/redhat-release)
|
23
|
+
if [ $? -ne 0 ]; then
|
24
|
+
echo "Is this a RedHat distro?"
|
25
|
+
exit 1
|
26
|
+
fi
|
27
|
+
echo "* Found RedHat ${RHEL_MAJOR_VERSION} version."
|
28
|
+
|
29
|
+
|
30
|
+
# Setup hostname vagrant-something.
|
31
|
+
FQDN="$1.vagrantup.com"
|
32
|
+
if grep '^HOSTNAME=' /etc/sysconfig/network > /dev/null; then
|
33
|
+
sed -i 's/HOSTNAME=\(.*\)/HOSTNAME='${FQDN}'/' /etc/sysconfig/network
|
34
|
+
else
|
35
|
+
echo "HOSTNAME=${FQDN}" >> /etc/sysconfig/network
|
36
|
+
fi
|
37
|
+
|
38
|
+
|
39
|
+
# Enable EPEL repository.
|
40
|
+
yum -y install wget
|
41
|
+
cd ~root
|
42
|
+
if [ $RHEL_MAJOR_VERSION -eq 5 ]; then
|
43
|
+
wget http://ftp.astral.ro/mirrors/fedora/pub/epel/5/i386/epel-release-5-4.noarch.rpm
|
44
|
+
EPEL_PKG="epel-release-5-4.noarch.rpm"
|
45
|
+
else
|
46
|
+
wget http://ftp.astral.ro/mirrors/fedora/pub/epel/6/i386/epel-release-6-8.noarch.rpm
|
47
|
+
EPEL_PKG="epel-release-6-8.noarch.rpm"
|
48
|
+
fi
|
49
|
+
rpm -i ~root/${EPEL_PKG}
|
50
|
+
rm -f ~root/${EPEL_PKG}
|
51
|
+
|
52
|
+
|
53
|
+
# Install some required software.
|
54
|
+
yum -y install openssh-server openssh-clients sudo \
|
55
|
+
ruby ruby-devel make gcc rubygems rsync
|
56
|
+
chkconfig sshd on
|
57
|
+
|
58
|
+
|
59
|
+
# Users, groups, passwords and sudoers.
|
60
|
+
echo 'vagrant' | passwd --stdin root
|
61
|
+
grep 'vagrant' /etc/passwd > /dev/null
|
62
|
+
if [ $? -ne 0 ]; then
|
63
|
+
echo '* Creating user vagrant.'
|
64
|
+
useradd vagrant
|
65
|
+
echo 'vagrant' | passwd --stdin vagrant
|
66
|
+
fi
|
67
|
+
grep '^admin:' /etc/group > /dev/null || groupadd admin
|
68
|
+
usermod -G admin vagrant
|
69
|
+
|
70
|
+
echo 'Defaults env_keep += "SSH_AUTH_SOCK"' >> /etc/sudoers
|
71
|
+
echo '%admin ALL=NOPASSWD: ALL' >> /etc/sudoers
|
72
|
+
sed -i 's/Defaults\s*requiretty/Defaults !requiretty/' /etc/sudoers
|
73
|
+
|
74
|
+
|
75
|
+
# SSH setup
|
76
|
+
# Add Vagrant ssh key for root and vagrant accouts.
|
77
|
+
sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config
|
78
|
+
|
79
|
+
[ -d ~root/.ssh ] || mkdir ~root/.ssh
|
80
|
+
chmod 700 ~root/.ssh
|
81
|
+
cat > ~root/.ssh/authorized_keys << EOF
|
82
|
+
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
|
83
|
+
EOF
|
84
|
+
chmod 600 ~root/.ssh/authorized_keys
|
85
|
+
|
86
|
+
[ -d ~vagrant/.ssh ] || mkdir ~vagrant/.ssh
|
87
|
+
chmod 700 ~vagrant/.ssh
|
88
|
+
cat > ~vagrant/.ssh/authorized_keys << EOF
|
89
|
+
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
|
90
|
+
EOF
|
91
|
+
chmod 600 ~vagrant/.ssh/authorized_keys
|
92
|
+
|
93
|
+
|
94
|
+
# Disable firewall and switch SELinux to permissive mode.
|
95
|
+
chkconfig iptables off
|
96
|
+
chkconfig ip6tables off
|
97
|
+
|
98
|
+
|
99
|
+
# Networking setup..
|
100
|
+
# Don't fix ethX names to hw address.
|
101
|
+
rm -f /etc/udev/rules.d/*persistent-net.rules
|
102
|
+
rm -f /etc/udev/rules.d/*-net.rules
|
103
|
+
rm -fr /var/lib/dhclient/*
|
104
|
+
|
105
|
+
# Interface eth0 should get IP address via dhcp.
|
106
|
+
cat > /etc/sysconfig/network-scripts/ifcfg-eth0 << EOF
|
107
|
+
DEVICE="eth0"
|
108
|
+
BOOTPROTO="dhcp"
|
109
|
+
ONBOOT="yes"
|
110
|
+
NM_CONTROLLED="no"
|
111
|
+
EOF
|
112
|
+
|
113
|
+
|
114
|
+
# Do some cleanup..
|
115
|
+
rm -f ~root/.bash_history
|
116
|
+
rm -r "$(gem env gemdir)"/doc/*
|
117
|
+
yum clean all
|
118
|
+
|
119
|
+
halt
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# stub: vagrant-libvirt 0.0.41 ruby lib
|
3
|
+
require File.expand_path('../lib/vagrant-libvirt/version', __FILE__)
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "vagrant-libvirt".freeze
|
7
|
+
s.version = VagrantPlugins::ProviderLibvirt::VERSION
|
8
|
+
|
9
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
10
|
+
s.require_paths = ["lib".freeze]
|
11
|
+
s.authors = ["Lukas Stanek".freeze, "Dima Vasilets".freeze, "Brian Pitts".freeze]
|
12
|
+
s.files = `git ls-files`.split($\)
|
13
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
14
|
+
|
15
|
+
s.date = "2018-02-02"
|
16
|
+
s.description = "libvirt provider for Vagrant.".freeze
|
17
|
+
s.email = ["ls@elostech.cz".freeze, "pronix.service@gmail.com".freeze, "brian@polibyte.com".freeze]
|
18
|
+
s.homepage = "https://github.com/vagrant-libvirt/vagrant-libvirt".freeze
|
19
|
+
s.licenses = ["MIT".freeze]
|
20
|
+
s.rubygems_version = "2.6.14".freeze
|
21
|
+
s.summary = "libvirt provider for Vagrant.".freeze
|
22
|
+
|
23
|
+
s.installed_by_version = "2.6.14" if s.respond_to? :installed_by_version
|
24
|
+
|
25
|
+
if s.respond_to? :specification_version then
|
26
|
+
s.specification_version = 4
|
27
|
+
|
28
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
29
|
+
s.add_development_dependency(%q<rspec-core>.freeze, ["~> 3.5.0"])
|
30
|
+
s.add_development_dependency(%q<rspec-expectations>.freeze, ["~> 3.5.0"])
|
31
|
+
s.add_development_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
|
32
|
+
s.add_runtime_dependency(%q<fog-libvirt>.freeze, [">= 0.3.0"])
|
33
|
+
s.add_runtime_dependency(%q<nokogiri>.freeze, [">= 1.6.0"])
|
34
|
+
s.add_runtime_dependency(%q<fog-core>.freeze, ["~> 1.43.0"])
|
35
|
+
s.add_development_dependency(%q<rake>.freeze, [">= 0"])
|
36
|
+
else
|
37
|
+
s.add_dependency(%q<rspec-core>.freeze, ["~> 3.5.0"])
|
38
|
+
s.add_dependency(%q<rspec-expectations>.freeze, ["~> 3.5.0"])
|
39
|
+
s.add_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
|
40
|
+
s.add_dependency(%q<fog-libvirt>.freeze, [">= 0.3.0"])
|
41
|
+
s.add_dependency(%q<nokogiri>.freeze, [">= 1.6.0"])
|
42
|
+
s.add_dependency(%q<fog-core>.freeze, ["~> 1.43.0"])
|
43
|
+
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
44
|
+
end
|
45
|
+
else
|
46
|
+
s.add_dependency(%q<rspec-core>.freeze, ["~> 3.5.0"])
|
47
|
+
s.add_dependency(%q<rspec-expectations>.freeze, ["~> 3.5.0"])
|
48
|
+
s.add_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
|
49
|
+
s.add_dependency(%q<fog-libvirt>.freeze, [">= 0.3.0"])
|
50
|
+
s.add_dependency(%q<nokogiri>.freeze, [">= 1.6.0"])
|
51
|
+
s.add_dependency(%q<fog-core>.freeze, ["~> 1.43.0"])
|
52
|
+
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
53
|
+
end
|
54
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-libvirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.42
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukas Stanek
|
@@ -118,7 +118,86 @@ email:
|
|
118
118
|
executables: []
|
119
119
|
extensions: []
|
120
120
|
extra_rdoc_files: []
|
121
|
-
files:
|
121
|
+
files:
|
122
|
+
- ".coveralls.yml"
|
123
|
+
- ".github/issue_template.md"
|
124
|
+
- ".gitignore"
|
125
|
+
- ".travis.yml"
|
126
|
+
- Gemfile
|
127
|
+
- LICENSE
|
128
|
+
- README.md
|
129
|
+
- Rakefile
|
130
|
+
- example_box/README.md
|
131
|
+
- example_box/Vagrantfile
|
132
|
+
- example_box/metadata.json
|
133
|
+
- lib/vagrant-libvirt.rb
|
134
|
+
- lib/vagrant-libvirt/action.rb
|
135
|
+
- lib/vagrant-libvirt/action/create_domain.rb
|
136
|
+
- lib/vagrant-libvirt/action/create_domain_volume.rb
|
137
|
+
- lib/vagrant-libvirt/action/create_network_interfaces.rb
|
138
|
+
- lib/vagrant-libvirt/action/create_networks.rb
|
139
|
+
- lib/vagrant-libvirt/action/destroy_domain.rb
|
140
|
+
- lib/vagrant-libvirt/action/destroy_networks.rb
|
141
|
+
- lib/vagrant-libvirt/action/forward_ports.rb
|
142
|
+
- lib/vagrant-libvirt/action/halt_domain.rb
|
143
|
+
- lib/vagrant-libvirt/action/handle_box_image.rb
|
144
|
+
- lib/vagrant-libvirt/action/handle_storage_pool.rb
|
145
|
+
- lib/vagrant-libvirt/action/is_created.rb
|
146
|
+
- lib/vagrant-libvirt/action/is_running.rb
|
147
|
+
- lib/vagrant-libvirt/action/is_suspended.rb
|
148
|
+
- lib/vagrant-libvirt/action/message_already_created.rb
|
149
|
+
- lib/vagrant-libvirt/action/message_not_created.rb
|
150
|
+
- lib/vagrant-libvirt/action/message_not_running.rb
|
151
|
+
- lib/vagrant-libvirt/action/message_not_suspended.rb
|
152
|
+
- lib/vagrant-libvirt/action/message_will_not_destroy.rb
|
153
|
+
- lib/vagrant-libvirt/action/package_domain.rb
|
154
|
+
- lib/vagrant-libvirt/action/prepare_nfs_settings.rb
|
155
|
+
- lib/vagrant-libvirt/action/prepare_nfs_valid_ids.rb
|
156
|
+
- lib/vagrant-libvirt/action/prune_nfs_exports.rb
|
157
|
+
- lib/vagrant-libvirt/action/read_mac_addresses.rb
|
158
|
+
- lib/vagrant-libvirt/action/remove_libvirt_image.rb
|
159
|
+
- lib/vagrant-libvirt/action/remove_stale_volume.rb
|
160
|
+
- lib/vagrant-libvirt/action/resume_domain.rb
|
161
|
+
- lib/vagrant-libvirt/action/set_boot_order.rb
|
162
|
+
- lib/vagrant-libvirt/action/set_name_of_domain.rb
|
163
|
+
- lib/vagrant-libvirt/action/share_folders.rb
|
164
|
+
- lib/vagrant-libvirt/action/start_domain.rb
|
165
|
+
- lib/vagrant-libvirt/action/suspend_domain.rb
|
166
|
+
- lib/vagrant-libvirt/action/wait_till_up.rb
|
167
|
+
- lib/vagrant-libvirt/cap/mount_p9.rb
|
168
|
+
- lib/vagrant-libvirt/cap/nic_mac_addresses.rb
|
169
|
+
- lib/vagrant-libvirt/cap/synced_folder.rb
|
170
|
+
- lib/vagrant-libvirt/config.rb
|
171
|
+
- lib/vagrant-libvirt/driver.rb
|
172
|
+
- lib/vagrant-libvirt/errors.rb
|
173
|
+
- lib/vagrant-libvirt/plugin.rb
|
174
|
+
- lib/vagrant-libvirt/provider.rb
|
175
|
+
- lib/vagrant-libvirt/templates/default_storage_pool.xml.erb
|
176
|
+
- lib/vagrant-libvirt/templates/domain.xml.erb
|
177
|
+
- lib/vagrant-libvirt/templates/private_network.xml.erb
|
178
|
+
- lib/vagrant-libvirt/templates/public_interface.xml.erb
|
179
|
+
- lib/vagrant-libvirt/util.rb
|
180
|
+
- lib/vagrant-libvirt/util/collection.rb
|
181
|
+
- lib/vagrant-libvirt/util/erb_template.rb
|
182
|
+
- lib/vagrant-libvirt/util/error_codes.rb
|
183
|
+
- lib/vagrant-libvirt/util/network_util.rb
|
184
|
+
- lib/vagrant-libvirt/util/timer.rb
|
185
|
+
- lib/vagrant-libvirt/version.rb
|
186
|
+
- locales/en.yml
|
187
|
+
- spec/spec_helper.rb
|
188
|
+
- spec/support/environment_helper.rb
|
189
|
+
- spec/support/libvirt_context.rb
|
190
|
+
- spec/support/sharedcontext.rb
|
191
|
+
- spec/unit/action/destroy_domain_spec.rb
|
192
|
+
- spec/unit/action/set_name_of_domain_spec.rb
|
193
|
+
- spec/unit/action/wait_till_up_spec.rb
|
194
|
+
- spec/unit/config_spec.rb
|
195
|
+
- spec/unit/templates/domain_all_settings.xml
|
196
|
+
- spec/unit/templates/domain_defaults.xml
|
197
|
+
- spec/unit/templates/domain_spec.rb
|
198
|
+
- tools/create_box.sh
|
199
|
+
- tools/prepare_redhat_for_box.sh
|
200
|
+
- vagrant-libvirt.gemspec
|
122
201
|
homepage: https://github.com/vagrant-libvirt/vagrant-libvirt
|
123
202
|
licenses:
|
124
203
|
- MIT
|
@@ -143,4 +222,15 @@ rubygems_version: 2.6.14
|
|
143
222
|
signing_key:
|
144
223
|
specification_version: 4
|
145
224
|
summary: libvirt provider for Vagrant.
|
146
|
-
test_files:
|
225
|
+
test_files:
|
226
|
+
- spec/spec_helper.rb
|
227
|
+
- spec/support/environment_helper.rb
|
228
|
+
- spec/support/libvirt_context.rb
|
229
|
+
- spec/support/sharedcontext.rb
|
230
|
+
- spec/unit/action/destroy_domain_spec.rb
|
231
|
+
- spec/unit/action/set_name_of_domain_spec.rb
|
232
|
+
- spec/unit/action/wait_till_up_spec.rb
|
233
|
+
- spec/unit/config_spec.rb
|
234
|
+
- spec/unit/templates/domain_all_settings.xml
|
235
|
+
- spec/unit/templates/domain_defaults.xml
|
236
|
+
- spec/unit/templates/domain_spec.rb
|