-
-
Save funkytaco/0d48fb987673599fecd4a2e8cc3d53c6 to your computer and use it in GitHub Desktop.
Openshift - Regenerate ose dns entries
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
#!/usr/bin/env oo-ruby | |
require "/var/www/openshift/broker/config/environment" | |
Rails.configuration.analytics[:enabled] = false | |
Mongoid.raise_not_found_error = false | |
class Regenerate | |
def self.run | |
entries = [] | |
Application.all.each do |app| | |
app.group_instances.each do |group_instance| | |
group_instance.gears.each do |gear| | |
if app.scalable and not gear.app_dns | |
entries |= ["#{gear.uuid}-#{app.domain_namespace}\tCNAME\t#{gear.server_identity}"] | |
else | |
entries |= ["#{app.name}-#{app.domain_namespace}\tCNAME\t#{gear.server_identity}"] | |
end | |
end | |
end | |
end | |
entries.each do |entry| | |
puts entry | |
end | |
end | |
end | |
if __FILE__ == $0 | |
Regenerate.run | |
end |
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
https://access.redhat.com/solutions/1391253 | |
How can DNS entries be re-created in OpenShift Enterprise? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment