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

Add initial FreeBSD support #210

Merged
merged 7 commits into from
Feb 1, 2017
Merged

Add initial FreeBSD support #210

merged 7 commits into from
Feb 1, 2017

Conversation

zachfi
Copy link
Contributor

@zachfi zachfi commented Jan 22, 2017

Without this change, there is no support for FreeBSD. Here we add the
basic params data, and update the unit tests for the icinga2 class to
ensure that we have the expected results. Also here, we extend the
metadata to include FreeBSD so that the unit tests are run.

$lib_dir = '/usr/local/lib/icinga2'
$constants = {
'PluginDir' => "${lib_dir}/nagios/plugins",
'PluginContribDir' => "${lib_dir}/nagios/plugins",
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be wrong in terms of another ports location

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right @lazyfrosch, that does look wrong.

What files are supposed to live in the PluginContribDir? In the monitoring-plugins port, I see /usr/local/libexec/nagios where the check_* scripts live, and in the icinga2 port I see /usr/local/share/icinga2/include/plugins-contrib.d/ which contains a bunch of config files that define commands and such. I'll adjust accordingly.

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant both PluginDir statements, from what I understand of ports (not a FreeBSD user) the location would be:

/usr/local/libexec/nagios/....

https://svnweb.freebsd.org/ports/head/net-mgmt/monitoring-plugins/Makefile?view=markup&pathrev=431254#l58

We should validate the paths of net-mgmt/monitoring-plugins, maybe also test the module on FreeBSD...

PluginContribDir is meant for other plugins, that are not included in monitoring-plugins.

But by default the path is set to the same: https://github.com/Icinga/icinga2/blob/8fd454fbb1457a34031a53baa16d2bacc77bba1b/etc/icinga2/constants.conf.cmake#L17

@zachfi
Copy link
Contributor Author

zachfi commented Jan 23, 2017

@lazyfrosch Thank you for the review. I've just pushed what I believe are the correct paths for those constants. Reading over the constants.conf.cmake that you linked helped. The paths were validated using pkg info -l icinga and pkg info -l monitoring-plugins to determine which files were in the packages. Let me know if other adjustments need to be made.

I'm still working to get a functional deployment in my environment, so I cannot as yet confirm that this is working, but I believe what I have here is correct.

@lazyfrosch
Copy link
Contributor

We should make sure it's actually working on FreeBSD before merging 😉

@zachfi
Copy link
Contributor Author

zachfi commented Jan 25, 2017

I've made a few more updates around the IDO package installation. FreeBSD doesn't have these packages, and the modules are included with the icinga2 package. I'm working my way through my existing manifests from the old module, which is a bit slow going. I'm unsure of the couple of the test failures on SLES.

@zachfi
Copy link
Contributor Author

zachfi commented Jan 25, 2017

Is this module intended to be supported on Windows for the master portion of Icinga, or just the agent? I've added the IDO packages to what was installed by default in the windows section, but I suspect this is not actually the desired change. If only the agent is intended to be supported on Windows, I'll set those packages to undef, and the tests should (might) pass.

@dnsmichi
Copy link

Master/satellite instances on Windows generally remain unsupported by Icinga 2 itself, only the clients are meant to be installed on Windows. Might need an addition to the Readme file if not already existing.

Without this change, there is no support for FreeBSD.  Here we add the
basic params data, and update the unit tests for the icinga2 class to
ensure that we have the expected results.  Also here, we extend the
metadata to include FreeBSD so that the unit tests are run.
@zachfi
Copy link
Contributor Author

zachfi commented Jan 25, 2017

Thank you @dnsmichi, I've set the windows packages for the IDO modules to undef, which should result in passing tests now, and the desired behavior.

Also, I can confirm this module works on FreeBSD with this change. I've converted all my internal manifests to use this module for one of my environments. Review welcome.

@bobapple
Copy link
Contributor

I created a vbox for FreeBSD 10.3:
http://boxes.icinga.com/vagrant/freebsd/freebsd-10.3-amd64-virtualbox.box
MD5: 68c708200667c6fd075d24a3f8e29061

Can you add everything necessary for integration testing to the serverspec/ directory?

If you are short in time, I can give it a try (not a freebsd user). Just let me know how we should proceed.

I'll create another box for FreeBSD 11.0 when this is working

@zachfi
Copy link
Contributor Author

zachfi commented Jan 30, 2017

@bobapple Thank you for the note. I've not used serverspec, but looking over the code and patterns, I believe I've put the items in place correctly. Let me know if something needs to be adjusted.

Vagrant does not support mounting directories via VBox Guest Additions.
This commits provides a workaround to use RSync instead.
@bobapple
Copy link
Contributor

Looks good already. Apparently Vagrant does not support mounting a directory with VBox Guest Additions on FreeBSD. We can workaround this by using RSync for BSD machines. I patched this in your branch, hope this is fine with you.

There is currently no repo management for FreeBSD, can you add this as well?

@zachfi
Copy link
Contributor Author

zachfi commented Jan 31, 2017

@bobapple thanks for the review. The icinga2 package is in the default repo, so nothing special is required. Users can build and host their own repo (as I do), but the configuration of such should belong outside this module.

@bobapple bobapple merged commit 2575ba0 into voxpupuli:master Feb 1, 2017
@zachfi zachfi deleted the freebsdsupport branch February 1, 2017 17:23
@zachfi
Copy link
Contributor Author

zachfi commented Feb 1, 2017

Thanks folks!

@bobapple bobapple added this to the v1.1.0 milestone Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants