palletjack-tools 0.6.5 → 0.7.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/exe/palletjack2knot1 +23 -0
- data/exe/palletjack2knot2 +22 -0
- data/{exe/palletjack2knot → lib/palletjack2zones.rb} +17 -17
- data/palletjack-tools.gemspec +1 -0
- metadata +9 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d92eee0a6c8dea07d29a11ee5aedfa585db1234
|
4
|
+
data.tar.gz: 9b1df758774d9d6830d98a5f3ad756a080520180
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 274e3ce6355a84fabeee3178ae3d80fd845d0033488646cd21fe65acd96a686689ed0d1fa4606f1dc25eaa0ecddfb839322ce17c9c18a30866d66bb7a92ee752
|
7
|
+
data.tar.gz: 8ea19408ea53806d5dff19e3171879be01637e5f8570f27b1222238686eda0fdc16537dc0b1520598dd69ecc44295816d2adaf048d30b496a5a839a8c1cdafc2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'palletjack2zones'
|
4
|
+
|
5
|
+
# Write DNS server zone files from a Palletjack warehouse, with
|
6
|
+
# configuration for a Knot 1.x server.
|
7
|
+
class PalletJack2Knot1 < PalletJack2Zones
|
8
|
+
def toolname
|
9
|
+
'palletjack2knot1'
|
10
|
+
end
|
11
|
+
|
12
|
+
def zone_config(zone)
|
13
|
+
"
|
14
|
+
#{zone} {
|
15
|
+
file \"zones/#{zone}.zone\";
|
16
|
+
}
|
17
|
+
"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
if PalletJack2Knot1.standalone?(__FILE__)
|
22
|
+
PalletJack2Knot1.run
|
23
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'palletjack2zones'
|
4
|
+
|
5
|
+
# Write DNS server zone files from a Palletjack warehouse, with
|
6
|
+
# configuration for a Knot 2.x server.
|
7
|
+
class PalletJack2Knot2 < PalletJack2Zones
|
8
|
+
def toolname
|
9
|
+
'palletjack2knot2'
|
10
|
+
end
|
11
|
+
|
12
|
+
def zone_config(zone)
|
13
|
+
"
|
14
|
+
zone:
|
15
|
+
- domain: #{zone}
|
16
|
+
"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
if PalletJack2Knot2.standalone?(__FILE__)
|
21
|
+
PalletJack2Knot2.run
|
22
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
# Write DNS server zone
|
3
|
+
# Write DNS server zone files from a Palletjack warehouse
|
4
4
|
#
|
5
5
|
# Data model assumptions:
|
6
6
|
# - Each domain corresponds uniquely to one IPv4 network
|
@@ -10,12 +10,24 @@
|
|
10
10
|
# "net.dns.alias", each of its interfaces will get that alias in its
|
11
11
|
# own domain. Aliases explicitly specified on a single interface will
|
12
12
|
# override this.
|
13
|
+
#
|
14
|
+
# To adapt this code to a specific DNS server, implement #zone_config
|
15
|
+
# to take the name of a zone and output the configuration block for
|
16
|
+
# telling the server about it. Also, implement #toolname to return the
|
17
|
+
# name of the running tool.
|
13
18
|
|
14
19
|
require 'palletjack/tool'
|
15
20
|
require 'dns/zone'
|
16
21
|
require 'ip'
|
17
22
|
|
18
|
-
class
|
23
|
+
class PalletJack2Zones < PalletJack::Tool
|
24
|
+
def toolname
|
25
|
+
'PalletJack2Zones base class'
|
26
|
+
end
|
27
|
+
|
28
|
+
def zone_config(zone)
|
29
|
+
end
|
30
|
+
|
19
31
|
def parse_options(opts)
|
20
32
|
opts.banner =
|
21
33
|
"Usage: #{$PROGRAM_NAME} -w <warehouse> -o <output directory>
|
@@ -30,14 +42,6 @@ Write DNS server zone files from a Palletjack warehouse"
|
|
30
42
|
required_option :output
|
31
43
|
end
|
32
44
|
|
33
|
-
def zone_config(zone)
|
34
|
-
"
|
35
|
-
#{zone} {
|
36
|
-
file \"zones/#{zone}.zone\";
|
37
|
-
}
|
38
|
-
"
|
39
|
-
end
|
40
|
-
|
41
45
|
# Generate and store forward zone data for a Pallet Jack domain
|
42
46
|
# object.
|
43
47
|
|
@@ -171,11 +175,11 @@ Write DNS server zone files from a Palletjack warehouse"
|
|
171
175
|
|
172
176
|
def output
|
173
177
|
config_file :output, 'zones.conf' do |conf_file|
|
174
|
-
conf_file << git_header(
|
178
|
+
conf_file << git_header(toolname)
|
175
179
|
|
176
180
|
@forward_zones.each do |domain, zone|
|
177
181
|
config_file :zone_dir, "#{domain}.zone" do |zonefile|
|
178
|
-
zonefile << git_header(
|
182
|
+
zonefile << git_header(toolname, comment_char: ';')
|
179
183
|
zonefile << zone.dump_pretty
|
180
184
|
conf_file << zone_config(domain)
|
181
185
|
end
|
@@ -183,7 +187,7 @@ Write DNS server zone files from a Palletjack warehouse"
|
|
183
187
|
|
184
188
|
@reverse_zones.each do |domain, zone|
|
185
189
|
config_file :zone_dir, "#{domain}.zone" do |zonefile|
|
186
|
-
zonefile << git_header(
|
190
|
+
zonefile << git_header(toolname, comment_char: ';')
|
187
191
|
zonefile << zone.dump_pretty
|
188
192
|
conf_file << zone_config(domain)
|
189
193
|
end
|
@@ -191,7 +195,3 @@ Write DNS server zone files from a Palletjack warehouse"
|
|
191
195
|
end
|
192
196
|
end
|
193
197
|
end
|
194
|
-
|
195
|
-
if PalletJack2Knot.standalone?(__FILE__)
|
196
|
-
PalletJack2Knot.run
|
197
|
-
end
|
data/palletjack-tools.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: palletjack-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karl-Johan Karlsson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
f8wtQllq82VF0AXUYeLtTh1f+DW3WW5BO1e2OCu5eOV7dbyaVPaNK/+rHjCN8kM/
|
32
32
|
DGZSwUoNADmVkQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-
|
34
|
+
date: 2017-05-11 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: palletjack
|
@@ -39,14 +39,14 @@ dependencies:
|
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.
|
42
|
+
version: 0.7.0
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.
|
49
|
+
version: 0.7.0
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: dns-zone
|
52
52
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,7 +168,8 @@ executables:
|
|
168
168
|
- create_system
|
169
169
|
- dump_pallet
|
170
170
|
- palletjack2kea
|
171
|
-
-
|
171
|
+
- palletjack2knot1
|
172
|
+
- palletjack2knot2
|
172
173
|
- palletjack2pxelinux
|
173
174
|
- palletjack2salt
|
174
175
|
- palletjack2unbound
|
@@ -182,10 +183,12 @@ files:
|
|
182
183
|
- exe/create_system
|
183
184
|
- exe/dump_pallet
|
184
185
|
- exe/palletjack2kea
|
185
|
-
- exe/
|
186
|
+
- exe/palletjack2knot1
|
187
|
+
- exe/palletjack2knot2
|
186
188
|
- exe/palletjack2pxelinux
|
187
189
|
- exe/palletjack2salt
|
188
190
|
- exe/palletjack2unbound
|
191
|
+
- lib/palletjack2zones.rb
|
189
192
|
- palletjack-tools.gemspec
|
190
193
|
homepage: https://github.com/saab-simc-admin/palletjack
|
191
194
|
licenses:
|
metadata.gz.sig
CHANGED
Binary file
|