Skip to content

Should we autogroup two files with the same name but compatible params? #848

@purpleidea

Description

@purpleidea

If you had:

file "/tmp/foo" {
        state => "exists",
        mode => "ug=rw,o=",
}

file "/tmp/foo" {
        state => "exists",
        owner => "james",
}

What should happen? Should it error because they're not CompatibleRes or should it merge them and use both params?

What about?

file "/tmp/foo" {
        state => "exists",
        mode => "u=rw", # note the user mode
}

file "/tmp/foo" {
        state => "exists",
        mode => "g=rw", # note the group mode
}

Should even the mode parameter be merged?

Perhaps the solution is to error, perhaps the solution is to merge, and perhaps the solution is to even have a resource-specific param that sets how flexible we are with merging?

In any case we won't proceed before we:

  1. Have a legitimate, non-xy use-case that would benefit from this.
  2. Double check and add tests that when we merge we combine both the sets of edges into the new grouped resource correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions