Project

General

Profile

Bug #7517

Puppet class parameter not removed from environment after an import

Added by Anthony Lapenna almost 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Puppet integration
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Here is a description of my problem:

I've a Puppet class class_A and 2 environments env_A and env_B.

Here is a description of my class present in env_A AND env_B:

class class_A ($param_A) {
...
}

I want to upgrade the definition of the class in env_B only with the following:

class class_A ($param_B, $param_C) {
...
}

So I upload my new module definition to the puppetmaster and trigger an import on Foreman.

Now, if I check in Configure > Puppet classes > class_A > Smartclass parameters I can see that:

  • My new parameters param_B and param_C are present for the environment env_B only
  • The parameter param_A is still present in env_B

It is annoying because if I try to a Puppet run on a host from env_B, it can't run saying unable to locate parameter param_A.

I had to delete the param_A from my Puppet classe, which also removed the parameter from the environment env_A causing error in the puppet runs for that environment.


Related issues

Related to Foreman - Bug #2369: Paramaterized classes persist through import after parameters have been removedNew2013-04-02
Has duplicate Foreman - Bug #10377: Re-importing an environment where class parameters were removed does not remove those parameters in Foreman's class signaturesDuplicate2015-05-05
Has duplicate Foreman - Bug #12579: Class Parameters are not separated for different environmentsDuplicate2015-11-24
Has duplicate Foreman - Bug #3086: Import puppet classes fails to update classesDuplicate2013-09-13

Associated revisions

Revision e13c79fc (diff)
Added by Dominic Cleal over 3 years ago

fixes #7517 - remove overridden class parameters from envs on import

When a class parameter is overridden and the class import indicates it
should be removed, now delete the EnvironmentClass association.

This also changes behaviour when an overridden parameter is removed from
all environments as it and any LookupValues will now be deleted too.
Previously only non-overridden parameters would be deleted. This
matches the behaviour of classes being removed from all environments.

Revision b74a8cc2 (diff)
Added by Dominic Cleal over 3 years ago

fixes #7517 - remove overridden class parameters from envs on import

When a class parameter is overridden and the class import indicates it
should be removed, now delete the EnvironmentClass association.

This also changes behaviour when an overridden parameter is removed from
all environments as it and any LookupValues will now be deleted too.
Previously only non-overridden parameters would be deleted. This
matches the behaviour of classes being removed from all environments.

(cherry picked from commit e13c79fcec32cae0c1e5573a9d4fdef264d66f19)

History

#1 Updated by Dominic Cleal almost 5 years ago

  • Category set to Puppet integration

#2 Updated by Dominic Cleal almost 5 years ago

  • Related to Bug #2369: Paramaterized classes persist through import after parameters have been removed added

#3 Updated by Dominic Cleal over 3 years ago

  • Has duplicate Bug #10377: Re-importing an environment where class parameters were removed does not remove those parameters in Foreman's class signatures added

#4 Updated by Dominic Cleal over 3 years ago

  • Has duplicate Bug #12579: Class Parameters are not separated for different environments added

#5 Updated by Dominic Cleal over 3 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal

This happens when the parameter is overridden, Foreman won't remove it from any environment when the override flag is set. I suspect this is intended as a safety mechanism so that parameters with data attached aren't accidentally deleted, and/or possibly that early Puppet versions with parameterised class support didn't mind the extra parameters.

#6 Updated by The Foreman Bot over 3 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2932 added

#7 Updated by Dominic Cleal over 3 years ago

  • Has duplicate Bug #3086: Import puppet classes fails to update classes added

#8 Updated by Dominic Cleal over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#9 Updated by Dominic Cleal over 3 years ago

  • Legacy Backlogs Release (now unused) set to 104

Also available in: Atom PDF