vagrant-dnsconf 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/vagrant-dnsconf/cap/ubuntu/set_dnsconf.rb +26 -0
- data/lib/vagrant-dnsconf/config.rb +3 -2
- data/lib/vagrant-dnsconf/plugin.rb +5 -0
- data/lib/vagrant-dnsconf/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36d612790901c53ad5a87bd07889ff07cc821063
|
4
|
+
data.tar.gz: 3c2a76eed5986a63a09d2004c81adba16564325f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
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.
|
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-
|
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
|