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

Default auto.master #18

Closed
benkevan opened this issue Mar 4, 2017 · 11 comments
Closed

Default auto.master #18

benkevan opened this issue Mar 4, 2017 · 11 comments

Comments

@benkevan
Copy link
Contributor

benkevan commented Mar 4, 2017

The default /etc/auto.master differs between several supported OSs. Therefore the users experience is different without an option to make the config alike across all.

By default it'd be nice to have the following:
/misc /etc/auto.misc
/net -hosts
+dir:/etc/auto.master.d
+auto.master

Maybe the capability is already there. I haven't looked at the code yet, just reviewed README

@dhollinger
Copy link
Member

The default auto.master files are not included. this is primarily because mist use cases I've seen require a wholesale replacement of the default auto.master.

We could include a parameter that will use a different template that contains the default settings if necessary.

@benkevan
Copy link
Contributor Author

benkevan commented Mar 4, 2017 via email

@dhollinger
Copy link
Member

Are you saying that the version of autofs on Suse doesn't allow for sourcing of a master.d directory or that it's simply not the default? (NOTE: This module does not source any /etc/auto.master.d by default, that has to be set).

I'm trying to make sure I understand before going through a lot of work to add some defaults. The goal with this module is to make configuring autofs as simple and universal across OSes as possible. Currently, anything applied by this module will replace all defaults.

If autofs functionality isn't changed between OSes, then the current module defaults won't matter as autofs will know what to do.

As for those default settings, I would like more information as to why those need to be persisted before putting what could potentially be a lot of work for minimal gains. Why not just add those to your profile/hieradata if you need them to persist?

Any other thoughts?

@benkevan
Copy link
Contributor Author

benkevan commented Mar 6, 2017 via email

@dhollinger
Copy link
Member

Ok, in that case, as long as you don't specify use_dir => true or use_dir: true in the code or hieradata respectively, it won't even try to source the auto.master.d directory. Unless I'm missing something.

We could add some logic to the defined type to force use_dir to false when SLES or SUSE are being used, but even that may be a little overboard.

@dhollinger
Copy link
Member

@benkevan Did my last comment make sense or does it not solve the issue?

@benkevan
Copy link
Contributor Author

benkevan commented Mar 28, 2017 via email

@mterzo
Copy link
Contributor

mterzo commented Apr 10, 2017

I'm trying to do something similar:

I'm using this hiera content:

classes:
  - autofs

autofs::mounts:
  net:
    mount: /net
    order: 1
    mapfile: /etc/auto.net
    options: -hosts
    use_dir: false

I tried leaving out the mapfile, but now that type has an issue when it's left blank.

parameter 'mapfile' expects a match for Variant[Stdlib::Windowspath = Pattern[/^(([a-zA-Z]:[\\\/])|([\\\/][\\\/][^\\\/]+[\\\/][^\\\/]+)|([\\\/][\\\/]\?[\\\/][^\\\/]+))/], Stdlib::Unixpath = Pattern[/^\/([^\/\0]+\/*)+$/]], got '' at /etc/puppetlabs/code/environments/production/modules/autofs/manifests/init.pp:81

You put code to handle that originally:

  if $mapfile != '' {
    $contents = "${mount} ${mapfile} ${options}\n"
  } else {
    $contents = "${mount} ${options}\n"
  }

But this code will never get executed.

@clevelas
Copy link

I am needing the ability to add +auto.master to my auto_master. The use case if we get most of our automounts from LDAP. But for some machines, we have a need to specify additional custom mounts.

@dhollinger
Copy link
Member

@clevelas With the way the code is setup, you can use node definitions or hieradata to dynamically set those per-machine configurations.

@dhollinger
Copy link
Member

Closing due to age and I believe this was addressed

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

4 participants