Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save funkytaco/0d48fb987673599fecd4a2e8cc3d53c6 to your computer and use it in GitHub Desktop.
Save funkytaco/0d48fb987673599fecd4a2e8cc3d53c6 to your computer and use it in GitHub Desktop.
Openshift - Regenerate ose dns entries
#!/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
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