vagrant-ovirt4 1.2.0 → 2.1.0

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.
Files changed (40) hide show
  1. checksums.yaml +5 -5
  2. data/.github/FUNDING.yml +3 -0
  3. data/.github/workflows/release.yml +20 -0
  4. data/.gitignore +1 -1
  5. data/CHANGELOG +31 -0
  6. data/Dockerfile +11 -0
  7. data/Gemfile +6 -7
  8. data/Gemfile.lock +98 -87
  9. data/README.md +27 -3
  10. data/Rakefile +1 -7
  11. data/SECURITY.md +23 -0
  12. data/lib/vagrant-ovirt4.rb +4 -0
  13. data/lib/vagrant-ovirt4/action.rb +29 -9
  14. data/lib/vagrant-ovirt4/action/connect_ovirt.rb +19 -6
  15. data/lib/vagrant-ovirt4/action/create_network_interfaces.rb +57 -43
  16. data/lib/vagrant-ovirt4/action/create_vm.rb +87 -7
  17. data/lib/vagrant-ovirt4/action/destroy_vm.rb +14 -1
  18. data/lib/vagrant-ovirt4/action/disconnect_ovirt.rb +25 -0
  19. data/lib/vagrant-ovirt4/action/halt_vm.rb +11 -0
  20. data/lib/vagrant-ovirt4/action/read_ssh_info.rb +6 -1
  21. data/lib/vagrant-ovirt4/action/read_state.rb +7 -1
  22. data/lib/vagrant-ovirt4/action/resize_disk.rb +18 -17
  23. data/lib/vagrant-ovirt4/action/snapshot_list.rb +15 -19
  24. data/lib/vagrant-ovirt4/action/start_vm.rb +37 -23
  25. data/lib/vagrant-ovirt4/action/wait_til_suspended.rb +1 -1
  26. data/lib/vagrant-ovirt4/action/wait_till_down.rb +13 -2
  27. data/lib/vagrant-ovirt4/action/wait_till_up.rb +35 -6
  28. data/lib/vagrant-ovirt4/config.rb +60 -2
  29. data/lib/vagrant-ovirt4/errors.rb +20 -0
  30. data/lib/vagrant-ovirt4/plugin.rb +3 -3
  31. data/lib/vagrant-ovirt4/version.rb +1 -1
  32. data/locales/en.yml +17 -1
  33. data/spec/vagrant-ovirt4/config_spec.rb +33 -8
  34. data/templates/Vagrantfile.erb +199 -0
  35. data/tools/prepare_redhat_for_box.sh +6 -1
  36. data/vagrant-ovirt4.gemspec +2 -1
  37. metadata +26 -15
  38. data/lib/vagrant-ovirt4/action/sync_folders.rb +0 -69
  39. data/lib/vagrant-ovirt4/cap/nic_mac_addresses.rb +0 -15
  40. data/test.rb +0 -3
@@ -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,15 +0,0 @@
1
- # vim: ai ts=2 sts=2 et sw=2 ft=ruby
2
- module VagrantPlugins
3
- module OVirtProvider
4
- module Cap
5
- module NicMacAddresses
6
- def self.nic_mac_addresses(machine)
7
- ovirt = OVirtProvider.ovirt_connection
8
- interfaces = ovirt.list_vm_interfaces(machine.id.to_s)
9
- Hash[interfaces.map{ |i| [i[:name], i[:mac]] }]
10
- end
11
- end
12
- end
13
- end
14
- end
15
-
data/test.rb DELETED
@@ -1,3 +0,0 @@
1
- require 'ovirt-engine-sdk'
2
-
3
- p 'foo'