Plugin for Bluecat DHCP

i want to contribute a smart proxy dhcp plugin for bluecat dhcp to the project.

i have written the plugin with basic ruby knowlege, but i runs stable on foreman proxy 1.18.0

whats the best way to contribute code to the project?

thanks Matthias

1 Like

I’d read How to Create a Smart-Proxy Plugin - Foreman and in particular the DHCP section. You can also take a look at an implementation (smart_proxy_dhcp_infoblox for example).

I recall someone did look at bluecat in the past but getting access to the actual API proved hard as a non-customer. That means we can help you with the smart proxy part, but not with the bluecat part. If the plugin would be open source, it’s much easier for us to help you though :slight_smile:

the plugin is fully functional already.
as i mentioned i want to contribute the code and looking for the best/correct way to do so

I assume you developed a standalone plugin? Can you point us to the repo?
Ideally we would transfer it to the foreman github namespace. @Gwmngilfen should be able to help with this.

Getting a repo transferred is indeed possible, and is the preferred method, as it ensures the support of the plugin into the future. We do, of course, give admin rights on the transferred repo back to the author :slight_smile:

Let us know if that’s what you’d like to do! Thanks!

the plugin is now availible here:

i am not an experienced developer and this is also my first ruby project.
as i mentiond the plugin is fully functional, but i think there are a lot of things that could be done better.
ive used the basic structure form the device42 plugin. cause i didnt needed them, i didnt update the integration tests. they will propably need a rework

1 Like

Nice, for starters you can add your plugin to List of Smart-Proxy Plugins - Foreman.

alright! ive added the plugin to the list :slight_smile:

can you clone the repo? or can i transfer it to the foreman Organisation?

I can add you to the org so that you can transfer, yes. I’ll do that now. Let me know when done so I can clean up :wink:

If there’s an associated Rubygem, then it’d be great if you could add as an author, so that we can push releases to the same gem in the event that you decide to move on :slight_smile:

The code looks good overall, couple of observations:

  • Prefer underscore naming scheme ( hello_there ) to camel-case ( helloThere ) for settings. I have created a note in How to Create a Smart-Proxy Plugin - Foreman
  • You drop password and token in multiple places in proxy log, it’s considered a security vulnerability. Even usernames should not be logged, but that’s probably not that serious if they are in the DEBUG level which must be explicitly enabled by users.
  • Consider enabling Rubocop - you need to use Rubocop 0.50.x series because Smart Proxy still runs on Ruby 2.0 and Rubocop upstream dropped 2.0 last year. You can copy .rubocop.yaml from smart-proxy repo just like I did here:
  • Tests, tests, tests, tests, tests, tests, tests, tests…
  • Enable Travis CI for Rubocop and/or more unit/functional tests

Thanks for your contribution, that is appreciated. Be prepared to co-maintain the project tho, our community can help with occasional bugfixes, packaging and shipping it in the main repository but you still will be the one who understands the codebase the most :slight_smile:

the transfer is complete, ive added the additonal address. but I haven’t uploaded the gem yet anyway. :slight_smile:

1 Like

cool, thanks for the hints! ill look into it over the next couple of days and keep you posted

1 Like

Thanks! I’ve created a Bluecat team and added you as an admin, so you can easily add more collaborators as needed. Next steps are fixing up @lzap’s points and then speaking to our @packaging team to get it into the repos :slight_smile:

If you want to try to prepare packages here is our repo:

Switch over to rpm/develop and read the README, find infoblox dhcp plugin and copy*paste it. Trial and error should do it, just file PR and our jenkins will perform test builds for you. I can assist you if you are stuck.

Please don’t copy paste it. We have scripts to generate it fresh: ./ smart_proxy_plugin smart_proxy_dhcp_bluecat foreman-plugins-nightly-nonscl-rhel7


Sorry I still live in the pre-automated world. Our rel-eng team rocks!