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

Nested roles support #29

Open
pradels opened this issue Sep 30, 2014 · 2 comments
Open

Nested roles support #29

pradels opened this issue Sep 30, 2014 · 2 comments
Milestone

Comments

@pradels
Copy link
Contributor

pradels commented Sep 30, 2014

In some cases can be usefull to assign some roles configuration to another role - add together their functionality.

For example, when I use vagrant-libvirt plugin, there are a lot common arguments, but some arguments are specific depending on the role. Config with nested roles can look like this:

roles:
  base:
    providers:
      - type: libvirt
        driver: qemu
        host: localhost
        connect_via_ssh: true
        username: root
        storage_pool_name: default
        nested: true

  puppetmaster:
    providers:
      - type: libvirt
        cpus: 2
        memory: 1024
    roles: base

  puppetagent:
    providers:
      - type: libvirt
        cpus: 1
        memory: 512
    roles: base

Thanks
Lukas

@adrienthebo
Copy link
Member

Nested roles would be a really neat feature, but unfortunately they get complex quickly - what happens if you have role that is included multiple times, or what happens if there is a cycle in role requirement?

@Sharpie
Copy link
Member

Sharpie commented Oct 8, 2014

What we would need to do is come up with a sane, well-defined deep merge strategy. It might be possible given that most data structures in config_builder only run so deep and we have some knowledge of which keys should be arrays.

@Sharpie Sharpie added this to the 1.0.0 milestone Sep 26, 2015
@Sharpie Sharpie modified the milestones: 1.0.0, 1.x Mar 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants