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 LXC provider support to kitchen-vagrant #128

Closed
wants to merge 4 commits into from
Closed

Add LXC provider support to kitchen-vagrant #128

wants to merge 4 commits into from

Conversation

tknerr
Copy link
Contributor

@tknerr tknerr commented Jan 10, 2015

This PR add support for the vagrant-lxc provider customizations in the Vagrantfile.erb template.

Use it in .kitchen.yml like this (assuming that lxc is the VAGRANT_DEFAULT_PROVIDER):

---
driver:
  name: vagrant

platforms:
- name: ubuntu-12.04
  driver_config:
    box: 'fgrehm/precise64-lxc'
    customize:
      container_name: 'mysql'
      cgroup.memory.limit_in_bytes: '128M'
      cgroup.cpuset.cpus: '0,1'
      backingstore: 'lvm'
      backingstore_options: { vgname: 'schroots', fstype: 'xfs', fssize: '5G' }

It will generate a Vagrantfile like this:

Vagrant.configure("2") do |c|
  c.vm.box = "fgrehm/precise64-lxc"
  c.vm.hostname = "default-ubuntu-1204"
  c.vm.synced_folder ".", "/vagrant", disabled: true
  c.vm.provider :lxc do |p|
    p.container_name = 'mysql'
    p.customize "cgroup.memory.limit_in_bytes", "128M"
    p.customize "cgroup.cpuset.cpus", "0,1"
    p.backingstore = "lvm"
    p.backingstore_option "--vgname", "schroots"
    p.backingstore_option "--fstype", "xfs"
    p.backingstore_option "--fssize", "5G"
  end
end

Considerations:

/cc @fgrehm

@tknerr
Copy link
Contributor Author

tknerr commented Feb 3, 2015

Any news on this one? do you need something else for this PR to be merged?

Not sure whether @fgrehm might want to chime in for a review.

I'm using it here on an Ubuntu / LXC box (with KITCHEN_LOCAL_YAML=.kitchen.lxc.yml)and it works fine so far:
https://github.com/tknerr/sample-toplevel-cookbook/blob/master/.kitchen.lxc.yml
https://github.com/tknerr/sample-toplevel-cookbook/blob/master/Gemfile#L17-19

@fgrehm
Copy link

fgrehm commented Mar 3, 2015

I don't have experience with kitchen-vagrant but by the looks of the patch I'd say :shipit: 😄

@tknerr
Copy link
Contributor Author

tknerr commented Mar 18, 2015

@fnichol @sethvargo any chance this will get merged before the next release?

@fnichol
Copy link
Contributor

fnichol commented Mar 23, 2015

@tknerr Sorry this took so long--I rebased this PR and added some specs (now that we can) in 1a43f54. This will ship with the next release. Thanks!!

@fnichol fnichol closed this Mar 23, 2015
@tknerr
Copy link
Contributor Author

tknerr commented Mar 23, 2015

@fnichol awesome, thanks! 👍 👍 👍

@fnichol
Copy link
Contributor

fnichol commented Mar 26, 2015

@tknerr Thank you!!

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.

3 participants