Feature #1224
openDNSMadeEasy/Foreman/SmartProxy integration
Description
Now that DNSmadeeasy has REST API, we should support it http://www.dnsmadeeasy.com/enterprise-dns/rest-api/
Updated by Brian Gupta about 13 years ago
Here is some sample code https://github.com/bgupta/dnsmadeeasy
Updated by Jeremy Kitchen over 11 years ago
This seems like it's actually pretty easy, however I have a quick implementation question:
There exists a rubygem called 'dnsmadeeasy/api' which we could use. However, this is not packaged for debian, and most likely not packaged for other things as well, so would probably not be a good dependency to add.
The license for the rubygem is unknown, the gemspec file has no license information and there doesn't seem to be a github or anything for it, so I don't think we can just include it in vendor/ or something.
Since it's only 2 calls we really need to implement with dnsmadeeasy, should we just use net-http or rest-client or such to do the calls directly?
Once I get an answer on this I can have this implemented pretty quickly.
I'm also contacting the creator of the rubygem and asking about licensing information.
Thanks!
Updated by Brian Gupta over 11 years ago
Jeremy Kitchen wrote:
This seems like it's actually pretty easy, however I have a quick implementation question:
There exists a rubygem called 'dnsmadeeasy/api' which we could use. However, this is not packaged for debian, and most likely not packaged for other things as well, so would probably not be a good dependency to add.
The license for the rubygem is unknown, the gemspec file has no license information and there doesn't seem to be a github or anything for it, so I don't think we can just include it in vendor/ or something.
Since it's only 2 calls we really need to implement with dnsmadeeasy, should we just use net-http or rest-client or such to do the calls directly?Once I get an answer on this I can have this implemented pretty quickly.
I'm also contacting the creator of the rubygem and asking about licensing information.
Thanks!
I'd suggest NOT using a full gem for this as the API is dirt simple. That said, feel free to steal any of the code/examples I wrote (all GPLv2+): https://github.com/bgupta/dnsmadeeasy
This is likely the script that would be most useful example: https://github.com/bgupta/dnsmadeeasy/blob/master/ec2-set-dme-dns.rb
-Brian
Updated by Jeremy Kitchen over 11 years ago
ok, that's what I was figuring, just hack the http requests together and it should Just Work. I'll try to bang this out by the end of the week, I have a bunch of meetings tomorrow and jury duty thursday (and hopefully ONLY thursday)
thanks!
Updated by Jeremy Kitchen over 11 years ago
another design question now: with dnsmadeeasy you apparently need to RESTfully write directly to a domain's endpoint, based on ID:
POST /V2.0/dns/managed/<id>/records, for example
I could look this up every time, but in our case, we have several thousand domains managed by dnsmadeeasy and having to parse them out and figure out which domain is which every time ... oof. Also, since our foreman domain is actually a subdomain of the domain we have hosted with dnsmadeeasy, there's no 1:1 relationship so we'd have to go through each domain in the list and try to find the best match, which just doesn't sound fun.
So, I was thinking of having the proxy setup similar to dhcp where you specify a list of domains and their IDs in the proxy's settings.yml file and it'll use that to look up the domain's ID.
If Foreman gave the domain's parameters to the smart-proxy during the API call then I could just make this a parameter of the domain, so that's another route which could be taken.
Thoughts?
Updated by Brian Gupta over 11 years ago
Jeremy Kitchen wrote:
another design question now: with dnsmadeeasy you apparently need to RESTfully write directly to a domain's endpoint, based on ID:
POST /V2.0/dns/managed/<id>/records, for example
I could look this up every time, but in our case, we have several thousand domains managed by dnsmadeeasy and having to parse them out and figure out which domain is which every time ... oof. Also, since our foreman domain is actually a subdomain of the domain we have hosted with dnsmadeeasy, there's no 1:1 relationship so we'd have to go through each domain in the list and try to find the best match, which just doesn't sound fun.
So, I was thinking of having the proxy setup similar to dhcp where you specify a list of domains and their IDs in the proxy's settings.yml file and it'll use that to look up the domain's ID.
If Foreman gave the domain's parameters to the smart-proxy during the API call then I could just make this a parameter of the domain, so that's another route which could be taken.
Thoughts?
Yuck, hadn't really thought about that, but not loving the idea of configuring this in a text file. I'm starting to wonder if the proxy is the right place to do this. (IE: We are doing a lot more in Foreman directly than we did in the past, perhaps your idea to make this a parameter to the proxy call might be one way.)
I think taking this to the foreman-dev mailing list is the right path at this point.
-Brian
Updated by Stephen Benjamin over 10 years ago
- Related to Tracker #5409: DNS Proxy Improvements added
Updated by Dominic Cleal over 9 years ago
- Category set to DNS
The Smart Proxy's DNS module can now be extended by plugins, thanks to #7008. This would be a great way to start developing this feature if anybody's interested.
Here are some useful links:
- http://projects.theforeman.org/projects/foreman/wiki/How_to_Create_a_Smart-Proxy_Plugin - developer information
- https://github.com/theforeman/smart_proxy_dns_plugin_template - a near-working template to create a new DNS provider
- https://github.com/theforeman/smart_proxy_dns_route53 - a working example adding AWS Route53 support