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

Allow multiple "include" statements in LXC configuration #230

Merged
merged 1 commit into from
Jan 5, 2017

Conversation

alexmv
Copy link

@alexmv alexmv commented May 20, 2016

LXC configuration allows for including files with common settings (see
lxc.container.conf(5)). This is lxc.include directive differs
from other settings, in that multiple settings of the same key makes
sense. Previously, a configuration of the form:

driver:
  name: vagrant
  provider: lxc
  customize:
    include: '/usr/share/lxc/config/ubuntu.common.conf'
    include: '/usr/share/lxc/config/nesting.conf'

...would necessarily only include one of the files, as duplicate keys
are collapsed during YAML loading. Since the existing code assumes
that all values are scalar, it was likewise impossible to set
include to an array.

Extend the supported syntax to allow:

driver:
  name: vagrant
  provider: lxc
  customize:
    include:
     - '/usr/share/lxc/config/ubuntu.common.conf'
     - '/usr/share/lxc/config/nesting.conf'

...which produces an LXC configuration of:

lxc.include=/usr/share/lxc/config/ubuntu.common.conf
lxc.include=/usr/share/lxc/config/nesting.conf

LXC configuration allows for including files with common settings (see
`lxc.container.conf(5)`).  This is `lxc.include` directive differs
from other settings, in that multiple settings of the same key makes
sense.  Previously, a configuration of the form:

    driver:
      name: vagrant
      provider: lxc
      customize:
        include: '/usr/share/lxc/config/ubuntu.common.conf'
        include: '/usr/share/lxc/config/nesting.conf'

...would necessarily only include one of the files, as duplicate keys
are collapsed during YAML loading.  Since the existing code assumes
that all values are scalar, it was likewise impossible to set
`include` to an array.

Extend the supported syntax to allow:

    driver:
      name: vagrant
      provider: lxc
      customize:
        include:
         - '/usr/share/lxc/config/ubuntu.common.conf'
         - '/usr/share/lxc/config/nesting.conf'

...which produces an LXC configuration of:

    lxc.include=/usr/share/lxc/config/ubuntu.common.conf
    lxc.include=/usr/share/lxc/config/nesting.conf
@ccope
Copy link
Contributor

ccope commented Oct 11, 2016

ping?

@cheeseplus
Copy link
Contributor

This looks good to me!

@cheeseplus cheeseplus self-requested a review January 5, 2017 16:14
@cheeseplus cheeseplus added this to the 0.20.2 milestone Jan 5, 2017
@cheeseplus cheeseplus merged commit 0f69f00 into test-kitchen:master Jan 5, 2017
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.

3 participants