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

fixes #15244 - provide a CNAME api to the DNSCMD provider #436

Closed

Conversation

pikelly
Copy link
Member

@pikelly pikelly commented Jun 17, 2016

This is similar to a part of a solution that is used in my organization. There is a rake task that scans all hosts for a cnames host parameter and pushes out these aliases into the Microsoft DHCP servers scattered across the world.

This implementation is not optimal as the collision checks for A, AAAA and CNAME entries should all check for the other types as an A and CNAME entry can collide. I would argue that cname management is an ancillary function so does not need so much attention. In addition the names given to aliases tend to be specialized so will generally not be given to an ordinary machine. The rake task also does additional collision detection to ensure that A and CNAME entries are not already present.

@@ -27,6 +27,8 @@ class Api < ::Sinatra::Base
when 'AAAA'
ip = IPAddr.new(value, Socket::AF_INET6).to_s
server.create_aaaa_record(fqdn, ip)
when 'CNAME'
server.create_cname_record(fqdn, value)
Copy link
Member

Choose a reason for hiding this comment

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

We'll need a default implementation for create_cname_record (probably returning an error "This provider doesn't support creation of CNAME records" or something similar), as it's going to take some time for other providers to catch up...

This allows all common DNS operations to be handled from within the
Foreman infrastructure. The requirement for assistance from a Microsoft
colleague is no longer required.
@pikelly
Copy link
Member Author

pikelly commented Jun 22, 2016

I have added the tests that you requested and the base class methods that call an exception.

@dmitri-d
Copy link
Member

Merged as 2b498a4. Thanks, @pikelly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants