vagrant-ovirt4 1.1.0 → 2.0.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 (37) 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 +2 -0
  5. data/Dockerfile +11 -0
  6. data/Gemfile +5 -11
  7. data/Gemfile.lock +31 -37
  8. data/README.md +26 -12
  9. data/Rakefile +1 -7
  10. data/lib/vagrant-ovirt4/action.rb +29 -9
  11. data/lib/vagrant-ovirt4/action/connect_ovirt.rb +1 -0
  12. data/lib/vagrant-ovirt4/action/create_network_interfaces.rb +62 -26
  13. data/lib/vagrant-ovirt4/action/create_vm.rb +98 -14
  14. data/lib/vagrant-ovirt4/action/destroy_vm.rb +14 -1
  15. data/lib/vagrant-ovirt4/action/disconnect_ovirt.rb +25 -0
  16. data/lib/vagrant-ovirt4/action/halt_vm.rb +11 -0
  17. data/lib/vagrant-ovirt4/action/read_ssh_info.rb +6 -1
  18. data/lib/vagrant-ovirt4/action/read_state.rb +7 -1
  19. data/lib/vagrant-ovirt4/action/resize_disk.rb +18 -17
  20. data/lib/vagrant-ovirt4/action/start_vm.rb +76 -34
  21. data/lib/vagrant-ovirt4/action/wait_til_suspended.rb +1 -1
  22. data/lib/vagrant-ovirt4/action/wait_till_down.rb +13 -2
  23. data/lib/vagrant-ovirt4/action/wait_till_up.rb +35 -6
  24. data/lib/vagrant-ovirt4/config.rb +81 -1
  25. data/lib/vagrant-ovirt4/errors.rb +20 -0
  26. data/lib/vagrant-ovirt4/plugin.rb +3 -3
  27. data/lib/vagrant-ovirt4/version.rb +1 -1
  28. data/locales/en.yml +17 -1
  29. data/spec/vagrant-ovirt4/config_spec.rb +53 -3
  30. data/templates/Vagrantfile.erb +199 -0
  31. data/tools/prepare_redhat_for_box.sh +18 -2
  32. data/vagrant-ovirt4.gemspec +3 -1
  33. metadata +35 -13
  34. data/docker-compose.yml +0 -9
  35. data/lib/vagrant-ovirt4/action/sync_folders.rb +0 -69
  36. data/lib/vagrant-ovirt4/cap/nic_mac_addresses.rb +0 -15
  37. data/test.rb +0 -3
@@ -42,7 +42,6 @@ fi
42
42
  if [[ $ATOMIC != "true" ]]; then
43
43
  yum install -y epel-release
44
44
  yum install -y ovirt-guest-agent-common
45
- for i in cloud-init ovirt-guest-agent; do chkconfig $i on; done
46
45
  if [[ $RHEL_MAJOR_VERSION -eq 5 ]]; then
47
46
  yum install -y \
48
47
  http://ftp.astral.ro/mirrors/fedora/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm \
@@ -59,12 +58,18 @@ if [[ $ATOMIC != "true" ]]; then
59
58
  echo "Is this a valid major release?"
60
59
  exit 1
61
60
  fi
61
+ else
62
+ ostree remote add --set=gpg-verify=false centos-atomic-continuous https://ci.centos.org/artifacts/sig-atomic/rdgo/centos-continuous/ostree/repo/
63
+ rpm-ostree rebase centos-atomic-continuous:centos-atomic-host/${RHEL_MAJOR_VERSION}/x86_64/devel/alpha
64
+ rpm-ostree pkg-add epel-release
65
+ rpm-ostree install ovirt-guest-agent-common
66
+ systemctl reboot
62
67
  fi
63
68
 
64
69
  # Install some required software.
65
70
  if [[ $ATOMIC != "true" ]]; then
66
71
  yum -y install openssh-server openssh-clients sudo curl \
67
- ruby ruby-devel make gcc rubygems rsync puppet ovirt-guest-agent cloud-init \
72
+ ruby ruby-devel make gcc rubygems rsync puppet ovirt-guest-agent ovirt-guest-agent-common cloud-init \
68
73
  iptables-services net-tools
69
74
  fi
70
75
 
@@ -98,7 +103,11 @@ chown -R vagrant:vagrant $vagrant_home/.ssh
98
103
 
99
104
  # Disable firewall and switch SELinux to permissive mode.
100
105
  chkconfig iptables off
106
+ chkconfig firewalld off
101
107
  chkconfig ip6tables off
108
+ for i in cloud-init ovirt-guest-agent; do chkconfig $i on; done
109
+ chkconfig NetworkManager off
110
+
102
111
  sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/sysconfig/selinux
103
112
  [ -f /etc/selinux/config ] && sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
104
113
 
@@ -111,6 +120,13 @@ rm -fr /var/lib/dhclient/*
111
120
  # Interface eth0 should always get IP address via dhcp.
112
121
  echo $'' > /etc/sysconfig/network-scripts/ifcfg-eth0
113
122
 
123
+ CLOUD_CONFIG=/etc/cloud/cloud.cfg
124
+ grep -q ' - resolv-conf' $CLOUD_CONFIG || sed -i -e 's/ - timezone/&\n - resolv-conf/' $CLOUD_CONFIG
125
+
126
+ # Chef
127
+ [[ $ATOMIC != "true" ]] && curl -L --silent https://omnitruck.chef.io/install.sh | bash
128
+
129
+
114
130
  # Do some cleanup..
115
131
  rm -f /root/.bash_history
116
132
  rm -f /root/authorized_keys
@@ -16,6 +16,8 @@ Gem::Specification.new do |gem|
16
16
  gem.require_paths = ["lib"]
17
17
  gem.version = VagrantPlugins::OVirtProvider::VERSION
18
18
 
19
- gem.add_runtime_dependency 'ovirt-engine-sdk', '~> 4.0', '>= 4.0.6'
19
+ gem.add_runtime_dependency 'ovirt-engine-sdk', '~> 4.0.1'
20
+ gem.add_runtime_dependency 'filesize', '~> 0'
21
+ gem.add_runtime_dependency 'nokogiri', '>= 1.10.8'
20
22
 
21
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-ovirt4
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcus Young
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-15 00:00:00.000000000 Z
11
+ date: 2021-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ovirt-engine-sdk
@@ -16,20 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
20
- - - ">="
19
+ version: 4.0.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 4.0.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: filesize
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
21
32
  - !ruby/object:Gem::Version
22
- version: 4.0.6
33
+ version: '0'
23
34
  type: :runtime
24
35
  prerelease: false
25
36
  version_requirements: !ruby/object:Gem::Requirement
26
37
  requirements:
27
38
  - - "~>"
28
39
  - !ruby/object:Gem::Version
29
- version: '4.0'
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 1.10.8
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
30
52
  - - ">="
31
53
  - !ruby/object:Gem::Version
32
- version: 4.0.6
54
+ version: 1.10.8
33
55
  description: Vagrant provider for oVirt and RHEV v4
34
56
  email:
35
57
  - myoung34@my.apsu.edu
@@ -37,14 +59,16 @@ executables: []
37
59
  extensions: []
38
60
  extra_rdoc_files: []
39
61
  files:
62
+ - ".github/FUNDING.yml"
63
+ - ".github/workflows/release.yml"
40
64
  - ".gitignore"
41
65
  - ".rspec"
66
+ - Dockerfile
42
67
  - Gemfile
43
68
  - Gemfile.lock
44
69
  - LICENSE
45
70
  - README.md
46
71
  - Rakefile
47
- - docker-compose.yml
48
72
  - example_box/README.md
49
73
  - example_box/Vagrantfile
50
74
  - example_box/dummy.box
@@ -55,6 +79,7 @@ files:
55
79
  - lib/vagrant-ovirt4/action/create_network_interfaces.rb
56
80
  - lib/vagrant-ovirt4/action/create_vm.rb
57
81
  - lib/vagrant-ovirt4/action/destroy_vm.rb
82
+ - lib/vagrant-ovirt4/action/disconnect_ovirt.rb
58
83
  - lib/vagrant-ovirt4/action/halt_vm.rb
59
84
  - lib/vagrant-ovirt4/action/is_created.rb
60
85
  - lib/vagrant-ovirt4/action/is_running.rb
@@ -74,11 +99,9 @@ files:
74
99
  - lib/vagrant-ovirt4/action/snapshot_save.rb
75
100
  - lib/vagrant-ovirt4/action/start_vm.rb
76
101
  - lib/vagrant-ovirt4/action/suspend_vm.rb
77
- - lib/vagrant-ovirt4/action/sync_folders.rb
78
102
  - lib/vagrant-ovirt4/action/wait_til_suspended.rb
79
103
  - lib/vagrant-ovirt4/action/wait_till_down.rb
80
104
  - lib/vagrant-ovirt4/action/wait_till_up.rb
81
- - lib/vagrant-ovirt4/cap/nic_mac_addresses.rb
82
105
  - lib/vagrant-ovirt4/cap/snapshot_list.rb
83
106
  - lib/vagrant-ovirt4/cap/snapshot_save.rb
84
107
  - lib/vagrant-ovirt4/config.rb
@@ -102,7 +125,7 @@ files:
102
125
  - spec/vagrant-ovirt4/action/read_ssh_info_spec.rb
103
126
  - spec/vagrant-ovirt4/action/read_state_spec.rb
104
127
  - spec/vagrant-ovirt4/config_spec.rb
105
- - test.rb
128
+ - templates/Vagrantfile.erb
106
129
  - tools/prepare_redhat_for_box.sh
107
130
  - vagrant-ovirt4.gemspec
108
131
  homepage: https://github.com/myoung34/vagrant-ovirt4
@@ -124,8 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
147
  - !ruby/object:Gem::Version
125
148
  version: '0'
126
149
  requirements: []
127
- rubyforge_project:
128
- rubygems_version: 2.6.10
150
+ rubygems_version: 3.0.3
129
151
  signing_key:
130
152
  specification_version: 4
131
153
  summary: This vagrant plugin provides the ability to create, control, and destroy
@@ -1,9 +0,0 @@
1
- version: '2'
2
-
3
- services:
4
- ruby:
5
- image: ruby-2.2.0
6
- container_name: ruby
7
- build: .
8
- volumes:
9
- - .:/srv
@@ -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'