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

Merge group arrays instead of rightmost precedence #65

Merged
merged 4 commits into from
Apr 5, 2019

Conversation

kobybr
Copy link
Contributor

@kobybr kobybr commented Nov 16, 2018

No description provided.

@raphink
Copy link
Contributor

raphink commented Nov 19, 2018

Could you provide an example of what you're trying to achieve here, or ideally a collection of unit tests this PR allows to pass?

@kobybr
Copy link
Contributor Author

kobybr commented Nov 19, 2018

Yes, I can add some unit tests.

Basically, I have two yaml files. One managed locally and one acquired via hiera-http backend. Hashes are merged via hiera lookup function.

The end result I am looking for is that user1 is created and added to groups group1 and group2. With the existing code, user1 is only added to group2 to due to the merge functions right order precedence

hiera1.yaml

profile::core::groups:
  group1:
    gid: 30000

profile::core::users:
  user1:
    groups: 
      - group1

hiera2.yaml

profile::core::groups:
  group2:
    gid: 30001

profile::core::users:
  user1:
     comments: User 1
  user2:
     comments: User 2

profile::core::usergroups:
    groupsofusers:
       - user1
       - user2
  
profile::core::accounts:
    '@groupsofusers':
         groups:
           - group2

@kobybr
Copy link
Contributor Author

kobybr commented Nov 27, 2018

Unit test added.

manifests/account.pp Outdated Show resolved Hide resolved
@raphink
Copy link
Contributor

raphink commented Dec 11, 2018

OK I get the idea. Could you separate the system parameter in a different PR and add some doc maybe?

@raphink
Copy link
Contributor

raphink commented Dec 20, 2018

Thanks. @mcanevet care to give me a second opinion?

@raphink raphink requested a review from mcanevet December 20, 2018 15:28
@kobybr
Copy link
Contributor Author

kobybr commented Jan 29, 2019

Any word on this?

@raphink raphink merged commit 08412bf into camptocamp:master Apr 5, 2019
nettucu added a commit to nettucu/puppet-accounts that referenced this pull request Aug 9, 2019
* upstream/master: (21 commits)
  Release 1.11.1
  Allow augeasproviders_shellvar 4
  Fix tests on Puppet 6
  msync
  Prepare release 1.11.0
  Allow stdlib 5 & 6
  Correcting issue camptocamp#15 (camptocamp#56)
  Fix puppet error if the account is not yet created (camptocamp#41)
  Allow augeasproviders_shellvar 3.x
  Add additional prerequisite (camptocamp#53)
  added expiry parameter (camptocamp#55)
  Merge group arrays instead of rightmost precedence (camptocamp#65)
  Allow ssh_options for accounts being created through accounts::usergroups as well (camptocamp#66)
  Use loop instead of recursion
  Fixes camptocamp#61 - Pass through managehome on absent
  Do not use legacy puppet-lint-absolute_classname-check plugin
  Fix beaker version to ~>3.13
  Update to add the system option to account.pp
  Update with modulesync
  Release 1.10.0
  ...
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 this pull request may close these issues.

2 participants