vagrant-dnsconf 0.1.1 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f141a3498fa51d8fe751dbb15d2d9df3192693b
4
- data.tar.gz: 0ee0b40a79cbedce2f1aee0853956e7607de78e2
3
+ metadata.gz: 36d612790901c53ad5a87bd07889ff07cc821063
4
+ data.tar.gz: 3c2a76eed5986a63a09d2004c81adba16564325f
5
5
  SHA512:
6
- metadata.gz: 76b1dfa0b0ffd5fd1bb974aba352f9e9c113093e83d256c6ab1a5b8a461e62376bc1d6a46d0ff7372a7b347a4c3c7d38de7a76010f4074fe52168ab018220226
7
- data.tar.gz: 37bc6350bacd4c41541e801886e1cc70c1d25ed3ac73f3780df2ca5ed0e5d046201ffedf3f82bc6632ad79860acb1a1a56462a59ac91dcb32a1a634cd0afbd65
6
+ metadata.gz: 9b89ae003152d0b1bc44b03662cf8f2aa532d8fdde096c6a6f2b941a5cbebd9581d59f95cefbf627bbe55bdffb4300ddb0224f6412e5d43b2b41f19caa00f0dd
7
+ data.tar.gz: 6cfe6d87e9325d3c63cfcbb7913d3b81950a5c33a3c96149240504d91ba0bd78de42faab744afe78091a1eca0f74412436c63c1efc929aaa801c58a3a090124a
data/README.md CHANGED
@@ -2,7 +2,10 @@
2
2
 
3
3
  a vagrant plugin that set guest dns configuration, e.g. interfaces
4
4
 
5
- confirmed on generic/debian9, generic/debian10
5
+ confirmed on
6
+ - generic/debian9, generic/debian10
7
+ - generic/ubuntu1804
8
+
6
9
  ## Installation
7
10
 
8
11
  ```sh
@@ -21,6 +24,7 @@ Vagrant.configure("2") do |config|
21
24
  config.dnsconf.deletes = [
22
25
  "208.67.220.220"
23
26
  ]
27
+ config.dnsconf.dnssec = false # option
24
28
  # ... other stuff
25
29
  end
26
30
  ```
@@ -0,0 +1,26 @@
1
+ require "vagrant"
2
+
3
+ module VagrantPlugins
4
+ module DnsConf
5
+ module Cap
6
+ module Ubuntu
7
+ module SetDnsConf
8
+
9
+ def self.set_dnsconf(m, opts)
10
+ #sed -i -e "s/4.2.2.1 4.2.2.2 208.67.220.220/192.168.16.10 192.168.16.11/" /etc/systemd/resolved.conf -e "s/DNSSEC=yes/DNSSEC=no/"
11
+ file = "/etc/systemd/resolved.conf"
12
+ opts[:deletes].each do |delete|
13
+ m.communicate.sudo("sed -i -e \"s/#{delete}//\" #{file}")
14
+ end
15
+ opts[:replaces].each do |replace|
16
+ m.communicate.sudo("sed -i -e \"s/#{replace[:before]}/#{replace[:after]}/\" #{file}")
17
+ end
18
+
19
+ m.communicate.sudo("sed -i -e \"s/DNSSEC=yes/DNSSEC=no/\" #{file}") unless opts[:dnssec]
20
+ m.communicate.sudo("systemctl restart systemd-resolved")
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -3,11 +3,12 @@ require "vagrant"
3
3
  module VagrantPlugins
4
4
  module DnsConf
5
5
  class Config < Vagrant.plugin('2', :config)
6
- attr_accessor :replaces, :deletes
6
+ attr_accessor :replaces, :deletes, :dnssec
7
7
 
8
8
  def initialize
9
9
  @replaces = UNSET_VALUE
10
- @deletes = UNSET_VALUE
10
+ @deletes = UNSET_VALUE
11
+ @dnssec = true
11
12
  end
12
13
 
13
14
  def is_set?
@@ -26,6 +26,11 @@ module VagrantPlugins
26
26
  require_relative 'cap/debian/set_dnsconf.rb'
27
27
  Cap::Debian::SetDnsConf
28
28
  end
29
+
30
+ guest_capability('ubuntu', 'set_dnsconf') do
31
+ require_relative 'cap/ubuntu/set_dnsconf.rb'
32
+ Cap::Ubuntu::SetDnsConf
33
+ end
29
34
  end
30
35
  end
31
36
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module DnsConf
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-dnsconf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kawawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-28 00:00:00.000000000 Z
11
+ date: 2020-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,6 +70,7 @@ files:
70
70
  - lib/vagrant-dnsconf.rb
71
71
  - lib/vagrant-dnsconf/action.rb
72
72
  - lib/vagrant-dnsconf/cap/debian/set_dnsconf.rb
73
+ - lib/vagrant-dnsconf/cap/ubuntu/set_dnsconf.rb
73
74
  - lib/vagrant-dnsconf/config.rb
74
75
  - lib/vagrant-dnsconf/plugin.rb
75
76
  - lib/vagrant-dnsconf/version.rb