Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow TXT records #142

Merged
merged 5 commits into from
Sep 29, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Lint/UselessAssignment:

# Offense count: 16
Metrics/AbcSize:
Max: 67
Max: 76

# Offense count: 18
# Configuration parameters: CountComments, ExcludedMethods.
Expand All @@ -88,7 +88,7 @@ Metrics/LineLength:
# Offense count: 26
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 59
Max: 67

# Offense count: 1
# Configuration parameters: CountKeywordArgs.
Expand Down
5 changes: 5 additions & 0 deletions examples/warehouse/domain/README
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ dns.yaml:
weight: Defaults to 0 if not specified
target: Dot-terminated FQDN or hostname of target
- ...
txt:
- label: Label to attach TXT record to
text: Contents of TXT record
- ...


services.yaml:
net:
Expand Down
5 changes: 5 additions & 0 deletions examples/warehouse/domain/example.com/dns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ net:
protocol: tcp
port: 5269
target: xmpp2
txt:
- label: example.com.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repeating the domain FQDN as label is not DRY, i think we should use explicit YAML ~ or leave the label unspecified to specify a "null" label.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A ~ shows up as an empty string (which is probably yet another part of #135), but leaving the label unspecified works.

text: "v=spf1 mx"
- label: _kerberos
text: EXAMPLE.COM
9 changes: 9 additions & 0 deletions tools/lib/palletjack2zones.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ def process_forward_zone(domain)
end
end

if domain['net.dns.txt']
domain['net.dns.txt'].each do |record|
txt = DNS::Zone::RR::TXT.new
txt.label = record['label']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|| absolute_domain_name

txt.text = record['text']
zone.records << txt
end
end

domain.children(kind: 'ipv4_interface') do |interface|
a = DNS::Zone::RR::A.new
a.label = interface['net.dns.name']
Expand Down