vagrant-ovirt4 1.2.3 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +3 -0
- data/.gitignore +1 -2
- data/CHANGELOG +50 -0
- data/Gemfile +6 -11
- data/Gemfile.lock +99 -163
- data/README.md +39 -24
- data/Rakefile +3 -16
- data/SECURITY.md +23 -0
- data/lib/vagrant-ovirt4/action/connect_ovirt.rb +29 -7
- data/lib/vagrant-ovirt4/action/create_vm.rb +14 -11
- data/lib/vagrant-ovirt4/action/disconnect_ovirt.rb +4 -1
- data/lib/vagrant-ovirt4/action/halt_vm.rb +11 -0
- data/lib/vagrant-ovirt4/action/read_ssh_info.rb +20 -6
- data/lib/vagrant-ovirt4/action/read_state.rb +7 -1
- data/lib/vagrant-ovirt4/action/snapshot_list.rb +15 -19
- data/lib/vagrant-ovirt4/action/start_vm.rb +13 -4
- data/lib/vagrant-ovirt4/action/wait_till_up.rb +7 -1
- data/lib/vagrant-ovirt4/action.rb +17 -8
- data/lib/vagrant-ovirt4/config.rb +31 -1
- data/lib/vagrant-ovirt4/errors.rb +4 -0
- data/lib/vagrant-ovirt4/util/connection.rb +40 -0
- data/lib/vagrant-ovirt4/util/machine_names.rb +21 -0
- data/lib/vagrant-ovirt4/version.rb +1 -1
- data/lib/vagrant-ovirt4.rb +4 -0
- data/locales/en.yml +6 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/support/shared_context.rb +39 -0
- data/spec/vagrant-ovirt4/action/create_vm_spec.rb +47 -0
- data/spec/vagrant-ovirt4/action/read_ssh_info_spec.rb +31 -17
- data/spec/vagrant-ovirt4/action/start_vm_spec.rb +54 -0
- data/spec/vagrant-ovirt4/config_spec.rb +90 -17
- data/spec/vagrant-ovirt4/util/connection_spec.rb +80 -0
- data/vagrant-ovirt4.gemspec +2 -1
- metadata +35 -19
- data/.kitchen.yml +0 -83
- data/Jenkinsfile +0 -70
- data/lib/vagrant-ovirt4/action/sync_folders.rb +0 -69
- data/test/integration/bios_serial/bios_serial_spec.rb +0 -6
- data/test/integration/dynamic_network/network_spec.rb +0 -6
- data/test/integration/optimized_for.sh +0 -4
- data/test/integration/singleton-static_network/network_spec.rb +0 -11
data/Jenkinsfile
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
#!/usr/bin/env groovy
|
2
|
-
node {
|
3
|
-
stage('Checkout') {
|
4
|
-
checkout scm
|
5
|
-
}
|
6
|
-
|
7
|
-
// Run as many tests as possible in parallel.
|
8
|
-
String[] vagrantVersions = ["1.9.1", "1.9.2"]
|
9
|
-
stage('Test') {
|
10
|
-
|
11
|
-
def buildJobs = [:]
|
12
|
-
|
13
|
-
buildJobs["rspec"] = {
|
14
|
-
docker.build("jenkins/ruby:2.2.6").inside('-v /opt/gemcache:/opt/gemcache') {
|
15
|
-
sh """#!/bin/bash -ex
|
16
|
-
bundle install --path /opt/gemcache
|
17
|
-
bundle exec rspec
|
18
|
-
"""
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
22
|
-
for (int i = 0; i < vagrantVersions.length; i++) {
|
23
|
-
def index = i //if we tried to use i below, it would equal 4 in each job execution.
|
24
|
-
def vagrantVersion = vagrantVersions[index]
|
25
|
-
|
26
|
-
buildJobs["vagrant-${vagrantVersion}"] = {
|
27
|
-
|
28
|
-
docker.image("myoung34/vagrant:${vagrantVersion}").inside('-v /opt/gemcache:/opt/gemcache') {
|
29
|
-
sh """#!/bin/bash -ex
|
30
|
-
temp_dir="/tmp/\$(cat /proc/sys/kernel/random/uuid)"
|
31
|
-
cp -r \$(pwd) \$temp_dir
|
32
|
-
cd \$temp_dir
|
33
|
-
gem build *.gemspec
|
34
|
-
/usr/bin/vagrant plugin install *.gem
|
35
|
-
bundle install --path /opt/gemcache --without development plugins
|
36
|
-
export VAGRANT_VERSION=\$(echo ${vagrantVersion} | sed 's/\\.//g')
|
37
|
-
bundle exec kitchen test ^[^singleton-]
|
38
|
-
"""
|
39
|
-
}
|
40
|
-
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
parallel( buildJobs )
|
45
|
-
}
|
46
|
-
|
47
|
-
for (int i = 0; i < vagrantVersions.length; i++) {
|
48
|
-
def index = i //if we tried to use i below, it would equal 4 in each job execution.
|
49
|
-
def vagrantVersion = vagrantVersions[index]
|
50
|
-
|
51
|
-
|
52
|
-
stage("singleton vagrant-${vagrantVersion}") {
|
53
|
-
docker.image("myoung34/vagrant:${vagrantVersion}").inside('-v /opt/gemcache:/opt/gemcache') {
|
54
|
-
sh """#!/bin/bash -ex
|
55
|
-
gem build *.gemspec
|
56
|
-
/usr/bin/vagrant plugin install *.gem
|
57
|
-
bundle install --path /opt/gemcache --without development plugins
|
58
|
-
bundle exec kitchen destroy all
|
59
|
-
rm -rf .kitchen
|
60
|
-
export VAGRANT_VERSION=\$(echo ${vagrantVersion} | sed 's/\\.//g')
|
61
|
-
bundle exec kitchen test ^singleton-
|
62
|
-
"""
|
63
|
-
}
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
stage("Cleanup") {
|
68
|
-
deleteDir()
|
69
|
-
}
|
70
|
-
}
|
@@ -1,69 +0,0 @@
|
|
1
|
-
require "log4r"
|
2
|
-
require "vagrant/util/subprocess"
|
3
|
-
|
4
|
-
module VagrantPlugins
|
5
|
-
module OVirtProvider
|
6
|
-
module Action
|
7
|
-
class SyncFolders
|
8
|
-
def initialize(app, env)
|
9
|
-
@app = app
|
10
|
-
@logger = Log4r::Logger.new("vagrant_ovirt::action::sync_folders")
|
11
|
-
end
|
12
|
-
|
13
|
-
def call(env)
|
14
|
-
@app.call(env)
|
15
|
-
|
16
|
-
ssh_info = env[:machine].ssh_info
|
17
|
-
|
18
|
-
env[:machine].config.vm.synced_folders.each do |id, data|
|
19
|
-
next if data[:disabled]
|
20
|
-
hostpath = File.expand_path(data[:hostpath], env[:root_path])
|
21
|
-
guestpath = data[:guestpath]
|
22
|
-
|
23
|
-
# Make sure there is a trailing slash on the host path to avoid creating an additional directory with rsync
|
24
|
-
hostpath = "#{hostpath}/" if hostpath !~ /\/$/
|
25
|
-
|
26
|
-
# on windows rsync.exe requires cygdrive-style paths.
|
27
|
-
# assumes: /c/...
|
28
|
-
# Should be msysgit and cygwin compatible if /etc/fstab in cygwin contains:
|
29
|
-
# none / cygdrive binary,posix=0,user 0 0
|
30
|
-
if Vagrant::Util::Platform.windows?
|
31
|
-
hostpath = hostpath.gsub(/^(\w):/) { "/#{$1}" }
|
32
|
-
end
|
33
|
-
|
34
|
-
env[:ui].info(I18n.t("vagrant_ovirt4.rsync_folder", :hostpath => hostpath, :guestpath => guestpath))
|
35
|
-
|
36
|
-
# Create the guest path
|
37
|
-
env[:machine].communicate.sudo("mkdir -p '#{guestpath}'")
|
38
|
-
env[:machine].communicate.sudo("chown #{ssh_info[:username]} '#{guestpath}'")
|
39
|
-
|
40
|
-
# Rsync over to the guest path using the SSH info
|
41
|
-
command = [
|
42
|
-
"rsync",
|
43
|
-
"--verbose",
|
44
|
-
"--archive",
|
45
|
-
"-z",
|
46
|
-
"--owner",
|
47
|
-
"--perms",
|
48
|
-
"--exclude",
|
49
|
-
".vagrant/",
|
50
|
-
"-e",
|
51
|
-
"ssh -p #{ssh_info[:port]} -o StrictHostKeyChecking=no -i '#{ssh_info[:private_key_path][0]}'",
|
52
|
-
hostpath,
|
53
|
-
"#{ssh_info[:username]}@#{ssh_info[:host]}:#{guestpath}"
|
54
|
-
]
|
55
|
-
|
56
|
-
r = Vagrant::Util::Subprocess.execute(*command)
|
57
|
-
if r.exit_code != 0
|
58
|
-
raise Errors::RsyncError,
|
59
|
-
:guestpath => guestpath,
|
60
|
-
:hostpath => hostpath,
|
61
|
-
:stderr => r.stderr
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
@@ -1,4 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
bios_serial=$(vagrant ssh -c 'sudo dmidecode -s system-serial-number' 2>/dev/null | tail -n 1 | sed 's/[\r\n]//g')
|
3
|
-
vm_id=$(curl --silent -k -L --user "${OVIRT_USERNAME}:${OVIRT_PASSWORD}" --header 'Content-Type: application/xml' --header 'Accept: application/xml' ${OVIRT_URL}/vms | xmllint --xpath 'string(./vms/vm[./serial_number/value/text() = "'$bios_serial'"]/@id)' -)
|
4
|
-
curl --silent -k -L --user "${OVIRT_USERNAME}:${OVIRT_PASSWORD}" --header 'Content-Type: application/xml' --header 'Accept: application/xml' ${OVIRT_URL}/vms/${vm_id} | xmllint --xpath './vm/type/text()' - | grep server
|
@@ -1,11 +0,0 @@
|
|
1
|
-
describe command('uname -a') do
|
2
|
-
its(:exit_status) { should eq 0 }
|
3
|
-
its(:stderr) { should be_empty }
|
4
|
-
its(:stdout) { should match(/^Linux kitchen-static-[0-9]+-[a-f0-9\-]+/) }
|
5
|
-
end
|
6
|
-
|
7
|
-
describe command("ip route get 1 | awk '{print $NF;exit}'") do
|
8
|
-
its(:exit_status) { should eq 0 }
|
9
|
-
its(:stderr) { should be_empty }
|
10
|
-
its(:stdout) { should match(/^192.168.2.254$/) }
|
11
|
-
end
|