Ericsson / puppet-module-autofs

Other
0 stars 10 forks source link

Imbalance in usage of autofs::map key parameter in templates/master.erb #25

Closed PerHenriksson closed 2 years ago

PerHenriksson commented 6 years ago

When adding a mount using the construction:

autofs::maps:
  'auto.proj':
    mountpoint: 'proj'
    maptype: 'yp'

it results in following entry in /etc/auto.master:

/proj yp auto.proj

But if specifying that mounts should be read from a file with:

autofs::maps:
  'auto.proj':
    mountpoint: 'proj'
    file: '/path/to/file/with/mounts'

it will result in the /etc/auto.master entry:

/proj /etc/auto.auto.proj

and in the file /etc/auto.auto.proj where I expect the file name to be /etc/auto.proj.

IMHO this is an improper imbalance in the usage of the key parameter of autofs::maps originating from different usage of the key parameter in templates/master.erb on lines 14 and 16.

A workaround would be to instead specify

autofs::maps:
  'proj':
    mountpoint: 'proj'
    file: '/path/to/file/with/mounts'

but that disables the ability to override previous declared mounts when using autofs::maps_hiera_merge: 'true'.

Phil-Friderici commented 4 years ago

Hej @PerHenriksson,

@anders-larsson and I have discussed your issue. We came to the conclusion that it is need to add the possibility to specify names and paths explicitly to fix your issue. This way we can keep backward compatibility working.

I have created a branch in my fork that will allow you to specify the map path explicity to fix the automatic prefixing of auto.. By doing so you will be able to override previous declared mounts with maps_hiera_merge.

Add mappath to your given example to fix your issue:

autofs::maps:
  'auto.proj':
    mountpoint: 'proj'
    mappath: '/etc/auto.proj'
    file: '/path/to/file/with/mounts'

You can find my feature branch here: https://github.com/Phil-Friderici/puppet-module-autofs/tree/mapname/path

Phil-Friderici commented 3 years ago

Hej @PerHenriksson,

could you please test and verify if my feature branch does help to solve your problem ? I would like to get it fixed before I start to work on other tasks with this module.

Thanks

Phil

Phil-Friderici commented 2 years ago

Fixed in version v1.5.0