-
Notifications
You must be signed in to change notification settings - Fork 87
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
desginate: Add mdns as hidden master #2105
Open
sjamgade
wants to merge
1
commit into
crowbar:master
Choose a base branch
from
sjamgade:rocky_designatesimplify
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,15 +20,23 @@ | |
|
||
dns = node_search_with_cache("roles:dns-server").first | ||
dnsmaster = dns[:dns][:master_ip] | ||
dnsslaves = dns[:dns][:slave_ips].to_a | ||
dnsservers = [dnsmaster] + dnsslaves | ||
|
||
network_settings = DesignateHelper.network_settings(node) | ||
# hidden masters are designate-mdns services, in ha this service will be running on multiple | ||
# hosts and any host can be asked to update a zone on the real-master. | ||
hiddenmasters = [] | ||
# We use the vip for the cluster in case of HA | ||
if node[:designate][:ha][:enabled] | ||
hiddenmasters = [{ "host" => CrowbarPacemakerHelper.cluster_vip(node, "admin"), "port" => 5354 }] | ||
else | ||
hiddenmasters = node_search_with_cache("roles:designate-server").map do |n| | ||
{ "host" => Barclamp::Inventory.get_network_by_type(n, "admin").address, "port" => 5354 } | ||
end | ||
end | ||
|
||
# One could have multiple pools in designate. And | ||
# designate needs to have a default pool, this pools | ||
# id is hardcoded in the designate conf. By reusing that | ||
# id we let designate know how crowbar's deployement of | ||
# id we let designate know how crowbar's deployment of | ||
# dns servers looks like. | ||
# This pool id can be generated by in proposal, but this will change | ||
# with every delete/create cycle of proposal. This might mess | ||
|
@@ -41,11 +49,11 @@ | |
"attributes" => {}, | ||
"ns_records" => [{ "hostname" => "#{dns[:fqdn]}.", "priority" => 1 }], | ||
"nameservers" => dnsservers.map { |ip| { "host" => ip, "port" => 53 } }, | ||
"also_notifies" => dnsslaves.map { |ip| { "host" => ip, "port" => 53 } }, | ||
"also_notifies" => [], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. leaving this empty by default makes sense to me, however if this is integrated in another hidden master setup (like e.g. SUSE's internal DNS), you need to be able to add additional hosts here. ideally this would be a setting in the barclamp ui. |
||
"targets" => [{ | ||
"type" => "bind9", | ||
"description" => "BIND9 Server 1", | ||
"masters" => [{ "host" => network_settings[:mdns_bind_host], "port" => 5354 }], | ||
"description" => "BIND9 Server on node with role dns-server", | ||
"masters" => hiddenmasters, | ||
"options" => { | ||
"host" => dnsmaster, | ||
"port" => 53, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would need to be configurable in the barclamp.