vagrant-dns-updater 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7ef5c73334c69ae4235f6f3841150d1b3e5c74b
4
- data.tar.gz: 57ee1101f50bf05c3cc3a2e66b44ef728f5b8cfa
3
+ metadata.gz: 5fd8f0e5b85300a0848d7f37a5d92bf34afbba58
4
+ data.tar.gz: 8cb0537eeb7c0dd392d76f9cac444baebad5b8fd
5
5
  SHA512:
6
- metadata.gz: 08cd9b3ff18bb1ce92c569b796ad788d3a17dc2b89fa7f12631c38f93f0016e8092206097ac7cd0fff3b34bd6acfcc18ec95d897e4fe53f77a1901ab7ac03574
7
- data.tar.gz: 4008f0c232ee5a39a2c7a738f405023f855cef6ebca1f96bb8572f1e5b99f40397cc4be57fad837ed3470a9c590425325f6221a139f639600fa783ce2e153a70
6
+ metadata.gz: 30bb6563feaaeba696ec2145c660234a3989dc8e7a3ab993a76fcd6f6330d3d4ce8acad5a4b1fdf666c67ea5c3285c3f4ddebd087b2dfc287002849a6125aebd
7
+ data.tar.gz: 0b786e39e58901c47786659a737c8368a069a53d100398a79947f518e4579e7997028bd5c52403199cb47b8cbb7bb1fa63a5779a5bacb235211b2448adca65cd
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # vagrant-dns-updater
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/vagrant-dns-updater.svg)](http://badge.fury.io/rb/vagrant-dns-updater)
4
+
5
+ ## Introduction
6
+
3
7
  `vagrant-dns-updater` allows you to automatically configure a subdomain with the ip of your vagrant instance using your registrar API.
4
8
 
5
9
  ## Important
@@ -10,8 +10,10 @@ module VagrantPlugins
10
10
 
11
11
  def call(env)
12
12
  config = @machine.config.dnsupdater
13
- registrar = Registrar::Registrar.load config
14
- registrar.remove_dns_record
13
+ unless config.registrar.nil?
14
+ registrar = Registrar::Registrar.load config
15
+ registrar.remove_dns_record
16
+ end
15
17
  end
16
18
 
17
19
  end
@@ -10,13 +10,15 @@ module VagrantPlugins
10
10
 
11
11
  def call(env)
12
12
  config = @machine.config.dnsupdater
13
- interface = config.interface
14
- registrar = Registrar::Registrar.load config
15
- @machine.communicate.execute("ip addr show #{interface} | awk '/inet/ && /#{interface}/{sub(/\\/.*$/,\"\",$2); print $2}'") do |type, output|
16
- raise Vagrant::Errors::VagrantError.new, output if type.to_s == 'stderr'
17
- ip = output
18
- @machine.ui.info("Pointing #{config.subdomain}.#{config.zone} to #{ip}")
19
- registrar.set_dns_record ip
13
+ unless config.registrar.nil?
14
+ interface = config.interface
15
+ registrar = Registrar::Registrar.load config
16
+ @machine.communicate.execute("ip addr show #{interface} | awk '/inet/ && /#{interface}/{sub(/\\/.*$/,\"\",$2); print $2}'") do |type, output|
17
+ raise Vagrant::Errors::VagrantError.new, output if type.to_s == 'stderr'
18
+ ip = output
19
+ @machine.ui.info("Pointing #{config.subdomain}.#{config.zone} to #{ip}")
20
+ registrar.set_dns_record ip
21
+ end
20
22
  end
21
23
  end
22
24
 
@@ -38,13 +38,12 @@ module VagrantPlugins
38
38
  def validate(machine)
39
39
  finalize!
40
40
  errors = []
41
- errors << 'registrar parameter is required with a valid value' if @registrar.nil?
42
41
  errors << 'appkey parameter is required' if @appkey.nil? && @registrar == 'ovh'
43
42
  errors << 'appsecret parameter is required' if @appsecret.nil? && @registrar == 'ovh'
44
43
  errors << 'consumerkey parameter is required' if @consumerkey.nil? && @registrar == 'ovh'
45
- errors << 'zone parameter is required' if @zone.nil?
46
- errors << 'subdomain parameter is required' if @subdomain.nil?
47
- errors << 'interface parameter is required' if @interface.nil?
44
+ errors << 'zone parameter is required' if @zone.nil? && !@registrar.nil?
45
+ errors << 'subdomain parameter is required' if @subdomain.nil? && !@registrar.nil?
46
+ errors << 'interface parameter is required' if @interface.nil? && !@registrar.nil?
48
47
 
49
48
  { "DnsUpdater" => errors }
50
49
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module DnsUpdater
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -10,7 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["nassim.kacha@blueicefield.com"]
11
11
 
12
12
  spec.description = 'A Vagrant plugin that allows you to automatically configure a subdomain' \
13
- ' with the ip of your vagrant instance using your registrar API.'
13
+ ' with the ip of your vagrant instance using your registrar API.' \
14
+ ' Only the registrar OVH is supported at the moment.'
14
15
  spec.summary = spec.description
15
16
  spec.homepage = "https://github.com/blueicefield/vagrant-dns-updater"
16
17
  spec.license = "MIT"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-dns-updater
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nassim Kacha
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-11 00:00:00.000000000 Z
11
+ date: 2015-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ovh-rest
@@ -53,7 +53,8 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '10.0'
55
55
  description: A Vagrant plugin that allows you to automatically configure a subdomain
56
- with the ip of your vagrant instance using your registrar API.
56
+ with the ip of your vagrant instance using your registrar API. Only the registrar
57
+ OVH is supported at the moment.
57
58
  email:
58
59
  - nassim.kacha@blueicefield.com
59
60
  executables: []
@@ -103,5 +104,6 @@ rubygems_version: 2.4.5
103
104
  signing_key:
104
105
  specification_version: 4
105
106
  summary: A Vagrant plugin that allows you to automatically configure a subdomain with
106
- the ip of your vagrant instance using your registrar API.
107
+ the ip of your vagrant instance using your registrar API. Only the registrar OVH
108
+ is supported at the moment.
107
109
  test_files: []