vagrant-libvirt 0.0.11 → 0.0.12
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.
- data/CHANGELOG.md +11 -0
- data/README.md +5 -2
- data/example_box/README.md +6 -0
- data/lib/vagrant-libvirt/action.rb +4 -0
- data/lib/vagrant-libvirt/action/connect_libvirt.rb +6 -3
- data/lib/vagrant-libvirt/action/create_network_interfaces.rb +2 -1
- data/lib/vagrant-libvirt/action/read_ssh_info.rb +2 -0
- data/lib/vagrant-libvirt/action/sync_folders.rb +2 -1
- data/lib/vagrant-libvirt/config.rb +10 -0
- data/lib/vagrant-libvirt/errors.rb +3 -3
- data/lib/vagrant-libvirt/version.rb +1 -1
- data/tools/prepare_redhat_for_box.sh +0 -1
- metadata +8 -3
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
# 0.0.12 (Dec. 03, 2013)
|
2
|
+
|
3
|
+
* Proxy ssh through libvirt host, if libvirt is connected via ssh(by @erik-smit)
|
4
|
+
* Fix wrong nfs methods call (by rosario.disomma@dreamhost.com)
|
5
|
+
* adding the nfs share on start (by @cp16net)
|
6
|
+
* Mention vagrant-mutate (by Brian Pitts <brian@polibyte.com>)
|
7
|
+
* Fix box metadata error keys (by Brian Pitts <brian@polibyte.com>)
|
8
|
+
* Fix selinux should working
|
9
|
+
* Mention compatibility with sahara (by Brian Pitts <brian@polibyte.com>)
|
10
|
+
* Add default network and ssh key file parameters (by Mathilde Ffrench <ffrench.mathilde@gmail.com>)
|
11
|
+
|
1
12
|
# 0.0.11 (Oct. 20, 2013)
|
2
13
|
|
3
14
|
* BUG FIX close #70 undefine machine id should be after all operations
|
data/README.md
CHANGED
@@ -19,6 +19,8 @@ welcome and can help a lot :-)
|
|
19
19
|
* Setup hostname and network interfaces.
|
20
20
|
* Provision domains with any built-in Vagrant provisioner.
|
21
21
|
* Synced folder support via `rsync` or `nfs`.
|
22
|
+
* Snapshots via [sahara](https://github.com/jedi4ever/sahara)
|
23
|
+
* Use boxes from other Vagrant providers via [vagrant-mutate](https://github.com/sciurus/vagrant-mutate)
|
22
24
|
|
23
25
|
## Future work
|
24
26
|
|
@@ -95,8 +97,9 @@ This provider exposes quite a few provider-specific configuration options:
|
|
95
97
|
* `connect_via_ssh` - If use ssh tunnel to connect to Libvirt.
|
96
98
|
* `username` - Username and password to access Libvirt.
|
97
99
|
* `password` - Password to access Libvirt.
|
98
|
-
* `
|
99
|
-
|
100
|
+
* `id_ssh_key_file` - The id ssh key file name to access Libvirt (eg: id_dsa or id_rsa or ... in the user .ssh directory)
|
101
|
+
* `storage_pool_name` - Libvirt storage pool name, where box image and instance snapshots will be stored.
|
102
|
+
* `default_network` - Libvirt default network name. If not specified default network name is 'default'.
|
100
103
|
|
101
104
|
### Domain Specific Options
|
102
105
|
|
data/example_box/README.md
CHANGED
@@ -21,3 +21,9 @@ Libvirt box should define at least three data fields in `metadata.json` file.
|
|
21
21
|
* format - Currently supported format is qcow2.
|
22
22
|
* virtual_size - Virtual size of image in GBytes.
|
23
23
|
|
24
|
+
## Converting Boxes
|
25
|
+
|
26
|
+
Instead of creating a box from scratch, you can use
|
27
|
+
[vagrant-mutate](https://github.com/sciurus/vagrant-mutate)
|
28
|
+
to take boxes created for other Vagrant providers and use them
|
29
|
+
with vagrant-libvirt.
|
@@ -59,6 +59,10 @@ module VagrantPlugins
|
|
59
59
|
# VM is not running or suspended. Start it.. Machine should gain
|
60
60
|
# IP address when comming up, so wait for dhcp lease and store IP
|
61
61
|
# into machines data_dir.
|
62
|
+
b3.use NFS
|
63
|
+
b3.use PrepareNFSSettings
|
64
|
+
b3.use ShareFolders
|
65
|
+
|
62
66
|
b3.use StartDomain
|
63
67
|
b3.use WaitTillUp
|
64
68
|
end
|
@@ -53,9 +53,12 @@ module VagrantPlugins
|
|
53
53
|
|
54
54
|
uri << virt_path
|
55
55
|
uri << '?no_verify=1'
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
|
57
|
+
if config.id_ssh_key_file
|
58
|
+
# set ssh key for access to libvirt host
|
59
|
+
home_dir = `echo ${HOME}`.chomp
|
60
|
+
uri << "&keyfile=#{home_dir}/.ssh/"+config.id_ssh_key_file
|
61
|
+
end
|
59
62
|
|
60
63
|
conn_attr = {}
|
61
64
|
conn_attr[:provider] = 'libvirt'
|
@@ -16,6 +16,7 @@ module VagrantPlugins
|
|
16
16
|
|
17
17
|
def initialize(app, env)
|
18
18
|
@logger = Log4r::Logger.new('vagrant_libvirt::action::create_network_interfaces')
|
19
|
+
@default_network = env[:machine].provider_config.default_network;
|
19
20
|
@app = app
|
20
21
|
end
|
21
22
|
|
@@ -151,7 +152,7 @@ module VagrantPlugins
|
|
151
152
|
end
|
152
153
|
|
153
154
|
# TODO Network default can be missing or named different.
|
154
|
-
return
|
155
|
+
return @default_network;
|
155
156
|
end
|
156
157
|
end
|
157
158
|
end
|
@@ -47,6 +47,8 @@ module VagrantPlugins
|
|
47
47
|
:forward_agent => machine.config.ssh.forward_agent,
|
48
48
|
:forward_x11 => machine.config.ssh.forward_x11,
|
49
49
|
}
|
50
|
+
|
51
|
+
ssh_info[:proxy_command] = "ssh '#{machine.provider_config.host}' -l '#{machine.provider_config.username}' nc %h %p" if machine.provider_config.connect_via_ssh
|
50
52
|
|
51
53
|
if not ssh_info[:username]
|
52
54
|
ssh_info[:username] = machine.config.ssh.default.username
|
@@ -19,6 +19,7 @@ module VagrantPlugins
|
|
19
19
|
|
20
20
|
env[:machine].config.vm.synced_folders.each do |id, data|
|
21
21
|
next if data[:nfs]
|
22
|
+
proxycommand = "-o ProxyCommand='#{ssh_info[:proxy_command]}'" if ssh_info[:proxy_command]
|
22
23
|
hostpath = File.expand_path(data[:hostpath], env[:root_path])
|
23
24
|
guestpath = data[:guestpath]
|
24
25
|
|
@@ -39,7 +40,7 @@ module VagrantPlugins
|
|
39
40
|
command = [
|
40
41
|
"rsync", "--del", "--verbose", "--archive", "-z",
|
41
42
|
"--exclude", ".vagrant/",
|
42
|
-
"-e", "ssh -p #{ssh_info[:port]} -o StrictHostKeyChecking=no -i '#{ssh_info[:private_key_path]}'",
|
43
|
+
"-e", "ssh -p #{ssh_info[:port]} #{proxycommand} -o StrictHostKeyChecking=no -i '#{ssh_info[:private_key_path]}'",
|
43
44
|
hostpath,
|
44
45
|
"#{ssh_info[:username]}@#{ssh_info[:host]}:#{guestpath}"]
|
45
46
|
|
@@ -18,10 +18,16 @@ module VagrantPlugins
|
|
18
18
|
# Password for Libvirt connection.
|
19
19
|
attr_accessor :password
|
20
20
|
|
21
|
+
# ID SSH key file
|
22
|
+
attr_accessor :id_ssh_key_file
|
23
|
+
|
21
24
|
# Libvirt storage pool name, where box image and instance snapshots will
|
22
25
|
# be stored.
|
23
26
|
attr_accessor :storage_pool_name
|
24
27
|
|
28
|
+
# Libvirt default network
|
29
|
+
attr_accessor :default_network
|
30
|
+
|
25
31
|
# Domain specific settings used while creating new domain.
|
26
32
|
attr_accessor :memory
|
27
33
|
attr_accessor :cpus
|
@@ -34,7 +40,9 @@ module VagrantPlugins
|
|
34
40
|
@connect_via_ssh = UNSET_VALUE
|
35
41
|
@username = UNSET_VALUE
|
36
42
|
@password = UNSET_VALUE
|
43
|
+
@id_ssh_key_file = UNSET_VALUE
|
37
44
|
@storage_pool_name = UNSET_VALUE
|
45
|
+
@default_network = UNSET_VALUE
|
38
46
|
|
39
47
|
# Domain specific settings.
|
40
48
|
@memory = UNSET_VALUE
|
@@ -49,7 +57,9 @@ module VagrantPlugins
|
|
49
57
|
@connect_via_ssh = false if @connect_via_ssh == UNSET_VALUE
|
50
58
|
@username = nil if @username == UNSET_VALUE
|
51
59
|
@password = nil if @password == UNSET_VALUE
|
60
|
+
@id_ssh_key_file = 'id_rsa' if @id_ssh_key_file == UNSET_VALUE
|
52
61
|
@storage_pool_name = 'default' if @storage_pool_name == UNSET_VALUE
|
62
|
+
@default_network = 'default' if @default_network == UNSET_VALUE
|
53
63
|
|
54
64
|
# Domain specific settings.
|
55
65
|
@memory = 512 if @memory == UNSET_VALUE
|
@@ -35,15 +35,15 @@ module VagrantPlugins
|
|
35
35
|
end
|
36
36
|
|
37
37
|
class NoBoxVirtualSizeSet < VagrantLibvirtError
|
38
|
-
error_key(:
|
38
|
+
error_key(:no_box_virtual_size)
|
39
39
|
end
|
40
40
|
|
41
41
|
class NoBoxFormatSet < VagrantLibvirtError
|
42
|
-
error_key(:
|
42
|
+
error_key(:no_box_format)
|
43
43
|
end
|
44
44
|
|
45
45
|
class WrongBoxFormatSet < VagrantLibvirtError
|
46
|
-
error_key(:
|
46
|
+
error_key(:wrong_box_format)
|
47
47
|
end
|
48
48
|
|
49
49
|
|
@@ -96,7 +96,6 @@ chmod 600 ~vagrant/.ssh/authorized_keys
|
|
96
96
|
# Disable firewall and switch SELinux to permissive mode.
|
97
97
|
chkconfig iptables off
|
98
98
|
chkconfig ip6tables off
|
99
|
-
sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/sysconfig/selinux
|
100
99
|
|
101
100
|
|
102
101
|
# Networking setup..
|
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.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-12-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: fog
|
@@ -156,12 +156,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
156
|
- - ! '>='
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '0'
|
159
|
+
segments:
|
160
|
+
- 0
|
161
|
+
hash: -2155802617992067651
|
159
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
163
|
none: false
|
161
164
|
requirements:
|
162
165
|
- - ! '>='
|
163
166
|
- !ruby/object:Gem::Version
|
164
167
|
version: '0'
|
168
|
+
segments:
|
169
|
+
- 0
|
170
|
+
hash: -2155802617992067651
|
165
171
|
requirements: []
|
166
172
|
rubyforge_project:
|
167
173
|
rubygems_version: 1.8.25
|
@@ -169,4 +175,3 @@ signing_key:
|
|
169
175
|
specification_version: 3
|
170
176
|
summary: Vagrant provider for libvirt.
|
171
177
|
test_files: []
|
172
|
-
has_rdoc:
|