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

resource node_group parent not determined properly #52

Open
vchepkov opened this issue Jan 25, 2020 · 2 comments
Open

resource node_group parent not determined properly #52

vchepkov opened this issue Jan 25, 2020 · 2 comments
Assignees
Labels

Comments

@vchepkov
Copy link
Contributor

Noticed this on PE2019.2.2. Attribute override_environment seems been renamed to environment_trumps, but more importantly, parents are not determined properly.

Here is partial diff between node_group and pe_node_group output:

--- nodes.txt   2020-01-25 18:45:21.705108222 +0000
+++ pe_nodes.txt        2020-01-25 18:45:32.762794571 +0000
@@ -1,41 +1,41 @@
-node_group { 'All Environments':
+pe_node_group { 'All Environments':
   ensure               => 'present',
   description          => 'Environment group parent and default',
   environment          => 'production',
+  environment_trumps => true,
   id                   => 'fcb5ce16-ef2b-41d8-adab-c80f67d1d76c',
-  override_environment => 'true',
   parent               => 'All Nodes',
   rule                 => ['and',
   ['~', 'name', '.*']],
 }
-node_group { 'All Nodes':
+pe_node_group { 'All Nodes':
   ensure               => 'present',
   environment          => 'production',
+  environment_trumps => false,
   id                   => '00000000-0000-4000-8000-000000000000',
-  override_environment => 'false',
   parent               => 'All Nodes',
   rule                 => ['and',
   ['~', 'name', '.*']],
 }
-node_group { 'Development environment':
+pe_node_group { 'Development environment':
   ensure               => 'present',
   description          => 'Development nodes',
   environment          => 'development',
+  environment_trumps => true,
   id                   => '456b842d-742a-49d4-8261-395fd5cee8db',
-  override_environment => 'true',
-  parent               => 'All Environments',
+  parent             => 'All Nodes',
   rule                 => ['and',
   ['=',
     ['trusted', 'extensions', 'pp_environment'],
     'development']],
 }
@WhatsARanjit
Copy link
Contributor

So node_group is my code and pe_node_group is Puppet's opinionated implementation of my module. I intentionally replaced environment_trumps with override_environment because the PE Console at the time read "Override Environment" so to fall inline with that, I decidedly replaced that.
https://github.com/WhatsARanjit/puppet-node_manager/blob/master/lib/puppet/provider/node_group/https.rb#L30

It seems there are some ramifications present from that now that usage is increased. What is your particular usecase @vchepkov ? Thanks.

@WhatsARanjit WhatsARanjit self-assigned this Mar 17, 2020
@vchepkov
Copy link
Contributor Author

I use it to create classification groups in the console.
for example:

  node_group { 'PE Primary Master Agent':
    ensure  => 'present',
    classes => {
      'puppet_enterprise::profile::agent' => {
        'server_list' => ['primary.localdomain:8140']
      }
    },
    parent  => 'PE Infrastructure Agent',
    rule    => ['or', ['=', 'name', 'primary.localdomain']],
  }

As a workaround for bug in PE, since if puppetserver is down on HA master and agent fails over to replica - "bad things happen"

I suppose to I can use pe_node_group instead, but then I would have to somehow supply PE code to my validation tool and I'd rather not do it. If these resources won't conflict with each other, I am fine with the way it is now, it was more of an FYI ticket.

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

No branches or pull requests

2 participants