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 iocell provider, and jailmanager selection #35

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

RainbowHackerHorse
Copy link
Contributor

This PR will add the iocell provider, and an option to choose your preferred jail manager, between iocage legacy, py-iocage, and iocell.

I'm sure there's a better way to do it with a defined type, but the variable include seems to work just as well.

@@ -5,18 +5,17 @@
#
class jail::setup () {

package { 'iocage':
ensure => installed,
package { $jailmanager:
Copy link
Contributor

Choose a reason for hiding this comment

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

This variable is out of scope here. Instead of creating the various jail::$jailmanager classes, you could probably just include the $jailmanager variable in the setup class and set a sane default in the hiera data. I can be more specific if I'm not making sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would help; I've never used heira, and as such, I'm functioning from "Do everything in manifests and templates" land.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm sorry for being slow.

If we had a hiera.yaml file in the root of this repo that looks a bit like this one https://github.com/xaque208/puppet-unbound/blob/master/hiera.yaml then we can set jail::setup::jailmanager: 'iocage' in data/common.yaml. This implies also that we only need a common section in the hiera.yaml file. Let me know if that helps. If that can get cleaned up a bit then I think this is merge worthy. Does that all make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I'm sorry for being slow.
This seemed to have gotten hidden under all my other notifications :(

It makes sense, as far as it can to someone who's never used heira before.

I don't want to try writing one right now and fucking it all up, but I can clean up this PR so it'll work with a properly written file, if you still want to merge this :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I can handle the hiera bits, so no worry. I'll link you the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awesomepossum, thanks!
When the hiera bit is done, I'll make the appropriate change here if something needs updating :)

Copy link
Contributor

Choose a reason for hiding this comment

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

The hiera bits are in now. You should now be able to add a parameter to the jail::setup class that you can read from hiera. In data/common.yaml you could set something like jail::setup::manager: 'iocage' which would choose icoage as a default, then users would be able to override this variable in their own heira data, so you could do jail::setup::manager: 'iocell' for to select the correct package.

@@ -0,0 +1,247 @@
require 'tempfile'

Puppet::Type.type(:jail).provide(:iocell) do
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume this work is based on the current iocage provider. What other changes should I be looking out for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed. Shouldn't be any between iocage legacy and iocell, at least not as of yet. I couldn't find any real differences that would impact.

@zachfi
Copy link
Contributor

zachfi commented Apr 9, 2018

#37 should help with the hiera data.

@zachfi zachfi mentioned this pull request Apr 25, 2018
Copy link
Contributor

@zachfi zachfi left a comment

Choose a reason for hiding this comment

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

Sorry for being slow to help here. I've had too much in flight.

@@ -5,18 +5,17 @@
#
class jail::setup () {

package { 'iocage':
ensure => installed,
package { $jailmanager:
Copy link
Contributor

Choose a reason for hiding this comment

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

The hiera bits are in now. You should now be able to add a parameter to the jail::setup class that you can read from hiera. In data/common.yaml you could set something like jail::setup::manager: 'iocage' which would choose icoage as a default, then users would be able to override this variable in their own heira data, so you could do jail::setup::manager: 'iocell' for to select the correct package.

}

service { 'iocage':
enable => true,
service { $jailservice:
Copy link
Contributor

Choose a reason for hiding this comment

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

This can also be a hiera variable.

@vox-pupuli-tasks
Copy link

Dear @RainbowHackerHorse, thanks for the PR!

This is pccibot, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

@vox-pupuli-tasks
Copy link

Dear @RainbowHackerHorse, thanks for the PR!

This is pccibot, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

@vox-pupuli-tasks
Copy link

Dear @RainbowHackerHorse, thanks for the PR!

This is pccibot, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

@RainbowHackerHorse
Copy link
Contributor Author

Oh man I'm so sorry, I forgot to check back on here. It's been a while since I've had time to poke at anything FOSS.
I'll rebase and take a look at all this this week.

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.

None yet

3 participants