New Plugin: foreman_phpipam

Frankly I am surprised that Foreman starts on MacOS. I know either smart proxy or foreman was not starting last time I tried.

You can either try start digging or just ignore these tests - your work will very unlikely affect them.

One more idea: try to migrate and reseed the database, admin is being assigned with some permissions which you might run twice?

I tried re-migrating and seeding the database, and still getting the same 4 failures.

Funny thing is that when I run the two roles and permissions test files individually, they are green, but fail when running the whole test suite.

bundle exec rails test test/controllers/api/v2/locations_controller_test.rb
bundle exec rails test test/controllers/api/v2/roles_controller_test.rb

Perhaps there are some tests that donā€™t clean up properly prior to these running?

I will try to dig a little more.

@lzap @tbrisker

I checked out the latest develop branch, and it seems the same 4 tests are failing there as well. Iā€™m not sure if this has to do with my local setup or not, but I have proceeded with the PR anyway.

I have pushed the latest changes and submitted the PR for the phpIPAM Integration with Foreman in a new branch called plugin/foreman_ipam.

Here are the links to the Foreman Plugin repos, and published gems:

foreman_ipam(v0.0.3)
Git: GitHub - grizzthedj/foreman_ipam: Foreman plugin for integration with External IPAM providers
Gem: foreman_ipam | RubyGems.org | your community gem host

smart_proxy_ipam(v0.0.4)
Git: GitHub - grizzthedj/smart_proxy_ipam: Foreman Smart Proxy plugin for integration with External IPAM providers
Gem: smart_proxy_ipam | RubyGems.org | your community gem host

There are more details on the features and functionality in the PR itself, but had a few questions regarding next steps.

Questions:

  1. How does one integrate the install/setup of these plugins with the foreman-installer?
  2. How can we get this added to the list of supported Foreman/Proxy plugins?
  3. In terms of integration testing, is there a project that has integration tests for Foreman? There are some tests, but none that test the actual phpIPAM integration.
  4. Is there any available infrastructure(in the cloud or otherwise) where we can setup a small phpIPAM instance for integration testing purposes?

Feel free to reach out if I have missed anything here!

Cheers,

Chris

1 Like

This is a two step process:

  1. adding the plugins to the puppet-foreman and puppet-foreman_proxy modules. Examples can be seen here for foreman and here for proxy.
  2. once the modules are updated, adding them as installer options requires adding them to the answers file and creating a migration. example here

List of Plugins - Foreman is a wiki page that can be edited to add it, if you donā€™t have permission to do that send me a private message with your redmine username and Iā€™ll fix it.
If you wish to transfer the plugin to the official theforeman organization under github, please reach out to me or one of the other org admins (preferably @ekohl (ewoud on irc) or @ehelms, though @ohadlevy and @Gwmngilfen may also be able to help if they have time) on IRC to facilitate it. We can also open a project on redmine for tracking issues if you prefer that to github.

We have a jenkins instance that is used to test many projects. The configuration for it is maintained under https://github.com/theforeman/foreman-infra/tree/master/puppet/modules/jenkins_job_builder and should be hopefully not be too complicated to add jobs for the plugin based on examples from other plugins. @infra team should be able to help guide you here towards the best practices.

Iā€™m not sure what it entails to spin up an instance, but we do have some tests that run vms as part of the testing process on our infra. If itā€™s something that can be automatically spun up in a vm or container as part of the testing process thatā€™s likely possible. Deffering to @infra team again for further guidance.

2 Likes

Well then it smells, if you checkout develop locally do you see the same four tests failing?

Iā€™ve reviewed your initial patch, keep it going. You are defining brand new Smart Proxy API (feature) here which is great, we like this design as it really paied off so far.

I checked out the latest develop branch locally, and the same 4 tests are failing there as well. Not sure if it is related to my local environment or not.

Thanks @lzap and @tbrisker for the feedback on the PR, and for answering the other questions. I will get cracking on those changes!

Probably a new thread with better subject could help, there are lot more devs here who might know.

For the record, the Foreman core part has been merged and will be in Foreman 2.1:

3 Likes