Skip to content

Added ability to set the purge behavior for node group rules #68

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

Merged
merged 3 commits into from
Apr 5, 2023

Conversation

benjamin-robertson
Copy link
Contributor

When using node_manager to manage a node_group; users lose the ability to pin nodes and modify rules via the PE console. This is inconvenient for users who wish to use node_manager to create node groups; however still require the flexibility to pin nodes and customise rules via the PE console.

This PR introduces the following behavior changes to the node_manager module.

When purge_behavior is set to "all", "data", "classes" or unset. There is no change to the behavior of this module.
When purge_behavior is set to "rule" or "none" node manager will.

  • Ensure rules set in the node_group code are enforced on the node group, while merging any existing rules and pinned nodes on the node group.
  • In the case of conflict between "Nodes must match all rules." and "Nodes may match any rule.". What is set in the PE console takes priority

Currently node_manager provides the ability to accept additional classes and data from users within the PE console by setting the purge_behavior parameter on a node_group basis. I would like to extend the module to include the ability to customise rules and pin nodes on a per node_group basis.

* First test of rule merge

* Fix typo

* don't validate

* puts values

* remove first, more puts

* Uniq array

* Check if defined, reorder

* missed?

* Added more output

* Merge rules 1st iteration

* Check b type and size

* check length instead of defined

* Fix logic

* check if values the same

* remove array matching

* array match

* this won't work

* remove super

* Added validae and munge

* check class

* ptus value

* remove validate

* remove munge

* set array match first

* test with insync

* remove sort

* Removed debug puts, replace with comments

* test travis ci

* Updated readme
* First test of rule merge

* Fix typo

* don't validate

* puts values

* remove first, more puts

* Uniq array

* Check if defined, reorder

* missed?

* Added more output

* Merge rules 1st iteration

* Check b type and size

* check length instead of defined

* Fix logic

* check if values the same

* remove array matching

* array match

* this won't work

* remove super

* Added validae and munge

* check class

* ptus value

* remove validate

* remove munge

* set array match first

* test with insync

* remove sort

* Removed debug puts, replace with comments

* test travis ci

* Updated readme

* Added debugs

* removed defaultto

* More puts

* Removed array check

* Fixed logic

* Moved return varible into if

* Return to array check

* added b temp

* more output

* Switched to btmp

* compare to resource

* borig

* update puts

* return merged

* moved insycn

* Moved inside should def

* Moved code

* puts match all

* check match all

* removed ?

* More prints

* Test with property matches

* With clone array

* return false test

* check object id

* removed false

* check class

* Print merge and orig

* Check object_id

* remove puts

* added puts

* added sort to is

* Removed insync

* sort should

* print type

* test more put

* disbale should

* everythign in insycn

* Revert "More puts"

This reverts commit a85e5d6.

* Reverted to working state

* Moved array for b merge. Missing pinned node

* added puts

* check b value

* with tmp varible

* test again

* Remove puts

* placed logic for a rule merge

* Fix logic

* Fixed merge logic

* puts

* more puts

* revert to previous code

* more logic for node groups

* with puts

* use the temp varible

* add uniq

* put identifiers

* Merge a rules

* fix syntax

* check values

* removed drop

* more puts

* a drop 1

* more puts

* Fixed return value

* removed puts

* more logic

* syntax

* fix if

* fix varible

* syntax

* check btmp

* print m ore

* puts

* try agin

* remove puts

* fix issue with override

* New features
* First test of rule merge

* Fix typo

* don't validate

* puts values

* remove first, more puts

* Uniq array

* Check if defined, reorder

* missed?

* Added more output

* Merge rules 1st iteration

* Check b type and size

* check length instead of defined

* Fix logic

* check if values the same

* remove array matching

* array match

* this won't work

* remove super

* Added validae and munge

* check class

* ptus value

* remove validate

* remove munge

* set array match first

* test with insync

* remove sort

* Removed debug puts, replace with comments

* test travis ci

* Updated readme

* Added debugs

* removed defaultto

* More puts

* Removed array check

* Fixed logic

* Moved return varible into if

* Return to array check

* added b temp

* more output

* Switched to btmp

* compare to resource

* borig

* update puts

* return merged

* moved insycn

* Moved inside should def

* Moved code

* puts match all

* check match all

* removed ?

* More prints

* Test with property matches

* With clone array

* return false test

* check object id

* removed false

* check class

* Print merge and orig

* Check object_id

* remove puts

* added puts

* added sort to is

* Removed insync

* sort should

* print type

* test more put

* disbale should

* everythign in insycn

* Revert "More puts"

This reverts commit a85e5d6.

* Reverted to working state

* Moved array for b merge. Missing pinned node

* added puts

* check b value

* with tmp varible

* test again

* Remove puts

* placed logic for a rule merge

* Fix logic

* Fixed merge logic

* puts

* more puts

* revert to previous code

* more logic for node groups

* with puts

* use the temp varible

* add uniq

* put identifiers

* Merge a rules

* fix syntax

* check values

* removed drop

* more puts

* a drop 1

* more puts

* Fixed return value

* removed puts

* more logic

* syntax

* fix if

* fix varible

* syntax

* check btmp

* print m ore

* puts

* try agin

* remove puts

* fix issue with override

* New features

* Code refactor

* Removed Puppet warning for default rule

* Update comments
@WhatsARanjit WhatsARanjit merged commit 39f437e into puppetlabs:master Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants