vagrant-smartos-zones 0.0.2 → 0.0.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/README.md +22 -0
- data/lib/vagrant/smartos/locales/en.yml +12 -0
- data/lib/vagrant/smartos/zones/models/config.rb +9 -1
- data/lib/vagrant/smartos/zones/plugin.rb +1 -0
- data/lib/vagrant/smartos/zones/util/zones.rb +18 -0
- data/lib/vagrant/smartos/zones/version.rb +1 -1
- data/test/templates/bootstrap.sh +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84fc0df3970935bc53940c6a9bf1be5b825537b7
|
4
|
+
data.tar.gz: ec8eaf0b1edbc52daeecbc073d591d19ddbd7575
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc7c7632350219fade70bc11585d116149760c0a559188d4c42357ad89406805c2a5371540ae8ed5e366babdd19e821874fd4531d5ece7d71422baf090c36662
|
7
|
+
data.tar.gz: 506620ca02aa02d3f35cf4af3c9fcf7c85c594d2b1e4d3c1e89842a0d6d0d1f02529c8dee03ae0dcbb62805f74a954f7979c8e83994851801f1713b1dd3e9163
|
data/README.md
CHANGED
@@ -107,6 +107,7 @@ vagrant smartos install [platform_image]
|
|
107
107
|
Interact with zones running in a box:
|
108
108
|
|
109
109
|
```bash
|
110
|
+
vagrant zones config
|
110
111
|
vagrant zones list
|
111
112
|
vagrant zones show [name]
|
112
113
|
vagrant zones start [name]
|
@@ -244,6 +245,27 @@ bundle exec kitchen test
|
|
244
245
|
|
245
246
|
This may take a while...
|
246
247
|
|
248
|
+
## Plugin configuration
|
249
|
+
|
250
|
+
The plugin allows for local configuration through the `vagrant zones
|
251
|
+
config` command. This can be used for local overrides of zone
|
252
|
+
configuration.
|
253
|
+
|
254
|
+
```bash
|
255
|
+
vagrant zones config
|
256
|
+
vagrant zones config key value
|
257
|
+
vagrant zones config --delete key
|
258
|
+
```
|
259
|
+
|
260
|
+
### Pkgsrc mirror
|
261
|
+
|
262
|
+
```bash
|
263
|
+
vagrant zones config local.pkgsrc http://mirror.domain.com
|
264
|
+
```
|
265
|
+
|
266
|
+
This will replace the protocol and domain of the pkgsrc mirror used by
|
267
|
+
pkgin in a SmartOS zone.
|
268
|
+
|
247
269
|
## References / Alternatives
|
248
270
|
|
249
271
|
Any success of this project depends heavily on the work of others,
|
@@ -35,6 +35,18 @@ en:
|
|
35
35
|
Started zone %{name} %{uuid}
|
36
36
|
stop: |-
|
37
37
|
Stopped zone %{name} %{uuid}
|
38
|
+
config:
|
39
|
+
set: |-
|
40
|
+
Setting configuration: %{key} => %{value}
|
41
|
+
delete:
|
42
|
+
success: |-
|
43
|
+
Deleting configuration for: %{key}
|
44
|
+
failed: |-
|
45
|
+
Unable to delete configuration key: %{key}
|
46
|
+
Was key actually set?
|
47
|
+
pkgsrc:
|
48
|
+
mirror:
|
49
|
+
Configuring pkgsrc mirror for %{uuid} => %{mirror}
|
38
50
|
warning:
|
39
51
|
zone_not_found: |-
|
40
52
|
Unable to find zone with name %{name}
|
@@ -31,10 +31,18 @@ module Vagrant
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def delete(name, *_args)
|
34
|
-
hash.delete(name)
|
34
|
+
if hash.delete(name)
|
35
|
+
env.ui.info(I18n.t('vagrant.smartos.zones.config.delete.success',
|
36
|
+
key: name))
|
37
|
+
else
|
38
|
+
env.ui.info(I18n.t('vagrant.smartos.zones.config.delete.failed',
|
39
|
+
key: name))
|
40
|
+
end
|
35
41
|
end
|
36
42
|
|
37
43
|
def set(name, value)
|
44
|
+
env.ui.info(I18n.t('vagrant.smartos.zones.config.set',
|
45
|
+
key: name, value: value))
|
38
46
|
hash[name] = value
|
39
47
|
end
|
40
48
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'vagrant/smartos/zones/models/config'
|
1
2
|
require 'vagrant/smartos/zones/models/zone'
|
2
3
|
require 'vagrant/smartos/zones/util/global_zone/helper'
|
3
4
|
require 'vagrant/smartos/zones/util/zone_group'
|
@@ -30,6 +31,7 @@ module Vagrant
|
|
30
31
|
with_gz("echo '#{zone_json}' | #{sudo} vmadm create")
|
31
32
|
with_zone(name) do |zone|
|
32
33
|
create_zone_users(zone)
|
34
|
+
configure_pkgsrc_mirror(zone)
|
33
35
|
end
|
34
36
|
end
|
35
37
|
|
@@ -42,6 +44,14 @@ module Vagrant
|
|
42
44
|
|
43
45
|
private
|
44
46
|
|
47
|
+
def configure_pkgsrc_mirror(zone)
|
48
|
+
return if zone.lx_brand?
|
49
|
+
return unless pkgsrc_mirror
|
50
|
+
machine.ui.info(I18n.t('vagrant.smartos.zones.pkgsrc.mirror',
|
51
|
+
uuid: zone.uuid, mirror: pkgsrc_mirror))
|
52
|
+
zone.zlogin("sed -i -e \\'s@http://pkgsrc.joyent.com@#{pkgsrc_mirror}@\\' /opt/local/etc/pkgin/repositories.conf")
|
53
|
+
end
|
54
|
+
|
45
55
|
def create_zone_users(zone)
|
46
56
|
create_zone_vagrant_user(zone)
|
47
57
|
configure_zone_passwords(zone)
|
@@ -62,6 +72,14 @@ module Vagrant
|
|
62
72
|
zone.zlogin("sed -i -e \\'s@#{user}:.*@#{user}:#{pw}:#{ts}::::::@\\' /etc/shadow")
|
63
73
|
end
|
64
74
|
|
75
|
+
def pkgsrc_mirror
|
76
|
+
plugin_config['local.pkgsrc']
|
77
|
+
end
|
78
|
+
|
79
|
+
def plugin_config
|
80
|
+
@plugin_config ||= Models::Config.config(machine.env).hash
|
81
|
+
end
|
82
|
+
|
65
83
|
def zone_json
|
66
84
|
Util::ZoneJson.new(machine).to_json
|
67
85
|
end
|
data/test/templates/bootstrap.sh
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-smartos-zones
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Saxby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|