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

Jail defaults does not respect path paramater #2

Open
zachfi opened this issue Jan 25, 2015 · 6 comments
Open

Jail defaults does not respect path paramater #2

zachfi opened this issue Jan 25, 2015 · 6 comments

Comments

@zachfi
Copy link

zachfi commented Jan 25, 2015

    class { 'jails':
      defaults             => {
        'interface'        => $default_interface,
        'allow_mount'      => true,
        'exec_start'       => '/bin/sh /etc/rc',
        'exec_stop'        => '/bin/sh /etc/rc.shutdown',
        'exec_clean'       => true,
        'mount_devfs'      => true,
        'mount.zfs'        => true,
        'enforce_statfs'   => 1,
        'path'             => '/jails/$name',
      }
    }

The above jails class does not seem to respect the path option here, which should default to its name. For example, the following line in jail.conf will allow wildcard jail roots.

path = "/jails/$name";
@skoef
Copy link
Owner

skoef commented Jan 25, 2015

What is the result in your jail config when setting path to '/jails/$name' then?

@skoef
Copy link
Owner

skoef commented Jan 25, 2015

When I define the following:

jails::defaults:
  path:              '/jails/$name'
jails::jails:
  test:
    host_hostname: 'foo.bar.org'

I end up with a /etc/jail.d/test.conf looking like this:

# File managed by Puppet
# Do not edit manualy as your changes will be overwritten
# and might cause this jail to restart!

# jail definition for test
test {
    path = "/jails/$name";
    host.hostname = "foo.bar.org";
    exec.start = "/bin/sh /etc/rc";
    exec.stop = "/bin/sh /etc/rc.shutdown";
}

I think I don't understand the actual issue right here :)

@zachfi
Copy link
Author

zachfi commented Jan 27, 2015

Well you are getting something different than I am getting, and while I am not using hiera, I conceptually have a similar thing that you do. I will take a harder look at the code. I'm in the middle of converting all my jails to this module. I don't see other defaults at all that I am expecting either. For example, the default interface. I have

    class { 'jails':
      defaults => {
        'interface'   => $default_interface,
        'allow_mount' => true,
        'exec_start'  => '/bin/sh /etc/rc',
        'exec_stop'   => '/bin/sh /etc/rc.shutdown',
        'exec_clean'  => true,
        'mount_devfs' => true,
      }
    }

But in my jails I am missing the mount_devfs, exec_clean, and interface configs. Still digging, but thats what I'm seeing.

@zachfi
Copy link
Author

zachfi commented Jan 27, 2015

    class { 'jails':
      defaults             => {
        'interface'        => $default_interface,
        'allow_mount'      => true,
        'exec_start'       => '/bin/sh /etc/rc',
        'exec_stop'        => '/bin/sh /etc/rc.shutdown',
        'exec_clean'       => true,
        'mount_devfs'      => true,
        'mount.zfs'        => true,
        'enforce_statfs'   => 1,
        'path'             => '/jails/$name',
        #'allow.socket_af' => true,
      }
    }
  jails::jail { 'graphite1':
    host_hostname => 'graphite1.example',
    ip6_addr      => 'fc00::123',
    ip4_addr      => '192.168.1.10'
  }

Yields the following in /etc/jail.d/graphite1.conf:

graphite1 {
    path = "/jails/$name";
    ip4.addr = "192.168.1.10";
    ip6.addr = "fc00::123";
    host.hostname = "graphite1.example";
    exec.start = "/bin/sh /etc/rc";
    exec.stop = "/bin/sh /etc/rc.shutdown";
}

In this example $path is recognized but not the rest of the options in default. Perhaps there is some parse thing going on here. This is odd.

@zachfi
Copy link
Author

zachfi commented Feb 2, 2015

I think I've just learned that defaults are not actually default for anything other than the hiera jails.

@zachfi
Copy link
Author

zachfi commented Feb 2, 2015

See #4

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

No branches or pull requests

2 participants