Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Replace params.pp with data in modules #50

Open
ggeldenhuis opened this issue Aug 20, 2018 · 2 comments
Open

Replace params.pp with data in modules #50

ggeldenhuis opened this issue Aug 20, 2018 · 2 comments

Comments

@ggeldenhuis
Copy link

This ticket is more meant as a todo item. For future compatibility it would great to get rid of the params.pp class in favour of data in modules. It means we can get rid of inheritance and make it easier and cleaner to adapt the module for multiple platforms.

@vinzent
Copy link

vinzent commented Aug 30, 2018

@ggeldenhuis how would you structure the hierarchy in hiera for conditionals like: https://github.com/kemra102/puppet-auditd/blob/master/manifests/params.pp#L39-L53

@ggeldenhuis
Copy link
Author

ggeldenhuis commented Aug 30, 2018

@vinzent I would probably do something like the following:

---
version: 5

defaults:
  datadir: 'data'
  data_hash: 'yaml_data'

hierarchy:
  - name: 'Full Version'
    path: '%{facts.os.name}-%{facts.os.release.full}.yaml'

  - name: 'Major Version'
    path: '%{facts.os.name}-%{facts.os.release.major}.yaml'

  - name: 'Distribution Name'
    path: '%{facts.os.name}.yaml'

  - name: 'Operating System Family'
    path: '%{facts.os.family}.yaml'

  - name: 'common'
    path: 'common.yaml'

You would need to create an extra level to catch the amazon OS though.
Its a bit of a rushed answer but I am sure it would be achievable with some careful thought. It is a big change but I do believe ultimately worth the extra effort. Will try and craft a workable solution and update the ticket.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants