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

autofs::map has issues when order not set #59

Closed
dhollinger opened this issue Jun 13, 2017 · 3 comments · Fixed by #61
Closed

autofs::map has issues when order not set #59

dhollinger opened this issue Jun 13, 2017 · 3 comments · Fixed by #61
Assignees

Comments

@dhollinger
Copy link
Member

dhollinger commented Jun 13, 2017

The autofs::map defined type will completely replace the contents of the target concat file if the order parameter is not set. This is because the concat::fragment set within both autofs::mount and autofs::map default to 1, which will cause concat to replace the content in that location (in the case of autofs::map it will replace the entire array that was laid down in autofs::mount).

My suggestion to @traylenator is that autofs::map should be a wholly separate defined type that does not interact with anything laid down by autofs::mount, otherwise we end up with redundant code and functionality.

If the concern is adding additional lines to an existing file, updating the array in the code or, better yet, in the hieradata is the appropriate place to do so.

If the concern is the ability to manage a mapfile outside of the autofs::mount block, then let's make the autofs::map file a completely separate define type meant to be called standalone.

Additionally, we could completely remove mapfile concat code in autofs::mount and instead have autofs::mount call autofs::map

@dhollinger
Copy link
Member Author

@traylenator if you don't have time to work this, I can update the code as well.

@dhollinger dhollinger self-assigned this Jun 13, 2017
dhollinger pushed a commit that referenced this issue Jun 13, 2017
Moved all mapfile generation to the map defined type provided by
@traylenator and instead have the mount defined type calling and passing
values to the map defined type (if mapfile is not empty).

This allows all current functionality to continue working, as well as,
allowing the map defined type to be used standalone AND maintain the
existing mapfile generation feature set.

Tests and templates have been updated to account for the changes.
dhollinger pushed a commit that referenced this issue Jun 13, 2017
bastelfreak added a commit that referenced this issue Jun 14, 2017
Update map and mount defined types to address #59
@traylenator
Copy link
Contributor

As a comment, having two concat::fragments with the same order is just fine, loads of stuff would not work.

@jcbollinger
Copy link
Contributor

jcbollinger commented Mar 22, 2018

It was a fine idea to make autofs::map a separate defined type, but it seems not to have been a good idea to put responsibility for overall map file management there. That opened up an avenue for inconsistency to be introduced, both between different autofs::map instances, and between autofs::mounts and autofs::maps. As it ended up being implemented, such inconsistencies actually arise under relatively mundane circumstances.

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 a pull request may close this issue.

3 participants