Jira (PUP-11201) Refine when the last used environment is used

2021-09-27 Thread Dorin Pleava (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Dorin Pleava updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-11201  
 
 
  Refine when the last used environment is used   
 

  
 
 
 
 

 
Change By: 
 Dorin Pleava  
 
 
Fix Version/s: 
 PUP 6.25.0  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.139928.1632747240049%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-12 Thread Gheorghe Popescu (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gheorghe Popescu updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-11201  
 
 
  Refine when the last used environment is used   
 

  
 
 
 
 

 
Change By: 
 Gheorghe Popescu  
 
 
Fix Version/s: 
 PUP 7.10.0  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.106126.1628757660180%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-11 Thread Gabriel Nagy (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gabriel Nagy commented on  PUP-11201  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Refine when the last used environment is used   
 

  
 
 
 
 

 
 Merged to 6.x in https://github.com/puppetlabs/puppet/commit/500e5144702b7ebbccb3ae70a4c6033f3d8cd9b4 Additional test fix was merged to 6.x in https://github.com/puppetlabs/puppet/commit/c13689d9dfda6e125d0d66c5ab278bb2e530dd22  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.106085.1628744400068%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-11 Thread Ciprian Badescu (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ciprian Badescu updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-11201  
 
 
  Refine when the last used environment is used   
 

  
 
 
 
 

 
Change By: 
 Ciprian Badescu  
 
 
Sprint: 
 NW-2021-08-11 , NW-2021-08-25  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.105029.1628673660145%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-10 Thread Ciprian Badescu (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ciprian Badescu commented on  PUP-11201  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Refine when the last used environment is used   
 

  
 
 
 
 

 
 It looks that if the environment was deleted, the default classifier answers to the agent to use the production environment, this is what makes the agent run to continue with the production environment. This could be confusing for people using non-existing environment and expecting puppet-run to fail even if the classifier would classify agent to different environment    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.103803.1628582760034%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-09 Thread Molly Waggett (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Molly Waggett commented on  PUP-11201  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Refine when the last used environment is used   
 

  
 
 
 
 

 
 sure, the following r10k acceptance tests are currently failing: 
 
https://github.com/puppetlabs/r10k/blob/main/integration/tests/user_scenario/complex_workflow/multi_env_add_change_remove.rb#L161 
https://github.com/puppetlabs/r10k/blob/main/integration/tests/user_scenario/complex_workflow/multi_env_remove_re-add.rb#L87 
https://github.com/puppetlabs/r10k/blob/main/integration/tests/user_scenario/complex_workflow/multi_env_unamanaged.rb#L76 (see failing job for details) 
 These are testing cases where an environment has been deleted or was never managed in the first place, so puppet should not be able to run against these environments. We previously expected puppet runs to fail, but now they fall back to the 'production' environment. We can update our tests if need be, but I wasn't sure if this behavior was intentional or if it's a bug.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Jira (PUP-11201) Refine when the last used environment is used

2021-08-09 Thread Ciprian Badescu (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ciprian Badescu commented on  PUP-11201  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Refine when the last used environment is used   
 

  
 
 
 
 

 
 I think that the environment is specified in command line has always priority and the last server environment is not used in this case. I can see the following cases 
 
the server is authoritative and the environment requested by the agent is not existing: this was an issue and it was fixed in https://tickets.puppetlabs.com/browse/PUP-6802 and the environment to be used will be decided by server 
the agent is authoritative and the environment requested by the agent is not existing: now it will fail faster 
 Molly Waggett, can you detail your test case?    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.103513.1628536620032%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-09 Thread Gabriel Nagy (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gabriel Nagy commented on  PUP-11201  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Refine when the last used environment is used   
 

  
 
 
 
 

 
 That's the correct (new) behavior, work for that was done in https://tickets.puppetlabs.com/browse/PUP-6802  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.103477.1628535240040%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-09 Thread Molly Waggett (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Molly Waggett commented on  PUP-11201  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Refine when the last used environment is used   
 

  
 
 
 
 

 
 What is the expected behavior if a specified environment is not found? Previously, running puppet agent -t --environment test would error if the 'test' environment didn't exist. Now it falls back to a good environment ('production' in my case, but not sure if that's coming from the last-used env or just defaults to 'production' or something else). Is that the new desired behavior?   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.103453.1628533680082%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-09 Thread Gabriel Nagy (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gabriel Nagy commented on  PUP-11201  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Refine when the last used environment is used   
 

  
 
 
 
 

 
 I opened a PR with the suggested changes here: https://github.com/puppetlabs/puppet/pull/8733    
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.103164.1628522340031%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-09 Thread Gabriel Nagy (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gabriel Nagy commented on  PUP-11201  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Refine when the last used environment is used   
 

  
 
 
 
 

 
 Previous behavior (before we removed the node request) was to skip the node request if a cached catalog/catalog is given, or if strict_environment_mode is true. So the node request was always performed regardless of the CLI/config value for environment  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.102860.1628502840169%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-09 Thread Gabriel Nagy (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Gabriel Nagy assigned an issue to Gabriel Nagy  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-11201  
 
 
  Refine when the last used environment is used   
 

  
 
 
 
 

 
Change By: 
 Gabriel Nagy  
 
 
Assignee: 
 Gabriel Nagy  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.102829.1628502060046%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-09 Thread Ciprian Badescu (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ciprian Badescu updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-11201  
 
 
  Refine when the last used environment is used   
 

  
 
 
 
 

 
Change By: 
 Ciprian Badescu  
 
 
Story Points: 
 3  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.102754.1628495460029%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-09 Thread Ciprian Badescu (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ciprian Badescu updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-11201  
 
 
  Refine when the last used environment is used   
 

  
 
 
 
 

 
Change By: 
 Ciprian Badescu  
 
 
Sprint: 
 NW-2021-08-11  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.102750.1628495040064%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-09 Thread Ciprian Badescu (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ciprian Badescu updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-11201  
 
 
  Refine when the last used environment is used   
 

  
 
 
 
 

 
Change By: 
 Ciprian Badescu  
 
 
Team: 
 Night's Watch  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.102749.1628495040043%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-09 Thread Ciprian Badescu (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ciprian Badescu updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-11201  
 
 
  Refine when the last used environment is used   
 

  
 
 
 
 

 
Change By: 
 Ciprian Badescu  
 

  
 
 
 
 

 
 With the recent changes in PUP-10216, the agent stores the last used environment in {{last_run_summary.yaml}}. If the next run does not specify an environment on the CLI, then the last used environment *always* takes precedence over the environment specified in puppet.conf. For example, given:{noformat}# puppet agent -t --environment feature_branch# puppet agent -t{noformat}If the agent is allowed to specify its environment:Prior to PUP-10216, the second run would use the original configured environment from puppet.conf or default to "production".After PUP-10216, the second run uses the "feature_branch" environment. This is also true if the second run occurs in the background (systemd/cron), which is especially surprising.In cases where the agent is *not* allowed to specify its environment, the last used environment provides the same function that the node request did. So the agent's behavior before and after PUP-10216 is the same, assuming the agent pluginsync'ed the right set of facts and classification doesn't change between runs.This ticket proposes we make an exception for the agent-specified case so that the second run only uses the environment from the previous run if it was server-specified. Otherwise, the agent should start in its configured environment (from puppet.conf) or default to "production".So I think this means: # If environment specified on CLI, use it # If last environment was server-specified, use it # Otherwise use our configured environment {{Puppet[:environment]}}I think we can detect if the last environment was server-specified by saving both the initial environment and the converged environment in {{last_run_summary.yaml}}. If those are different, then the server told us to use a different environment.If they are the same, then it doesn't matter if it's agent or server-specified, just use Puppet[:environment] Initial should be initially set with the values from first run (step 1 or 3) and carried over, not overwritten with values received from server  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 
 

Jira (PUP-11201) Refine when the last used environment is used

2021-08-09 Thread Ciprian Badescu (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ciprian Badescu updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-11201  
 
 
  Refine when the last used environment is used   
 

  
 
 
 
 

 
Change By: 
 Ciprian Badescu  
 

  
 
 
 
 

 
 With the recent changes in PUP-10216, the agent stores the last used environment in {{last_run_summary.yaml}}. If the next run does not specify an environment on the CLI, then the last used environment *always* takes precedence over the environment specified in puppet.conf. For example, given:{noformat}# puppet agent -t --environment feature_branch# puppet agent -t{noformat}If the agent is allowed to specify its environment:Prior to PUP-10216, the second run would use the original configured environment from puppet.conf or default to "production".After PUP-10216, the second run uses the "feature_branch" environment. This is also true if the second run occurs in the background (systemd/cron), which is especially surprising.In cases where the agent is *not* allowed to specify its environment, the last used environment provides the same function that the node request did. So the agent's behavior before and after PUP-10216 is the same, assuming the agent pluginsync'ed the right set of facts and classification doesn't change between runs.This ticket proposes we make an exception for the agent-specified case so that the second run only uses the environment from the previous run if it was server-specified. Otherwise, the agent should start in its configured environment (from puppet.conf) or default to "production".So I think this means: # If environment specified on CLI, use it # If last environment was server-specified, use it # Otherwise use our configured environment {{Puppet[:environment]}}I think we can detect if the last environment was server-specified by saving both the initial environment and the converged environment in {{last_run_summary.yaml}}. If those are different, then the server told us to use a different environment.If they are the same, then it doesn't matter if it's agent or server-specified, just use  it.  Puppet[:environment]  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 
 

Jira (PUP-11201) Refine when the last used environment is used

2021-08-09 Thread Ciprian Badescu (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ciprian Badescu commented on  PUP-11201  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Refine when the last used environment is used   
 

  
 
 
 
 

 
 Current implementation is: 
 
If environment specified on CLI, use it 
If environment specified on puppet.conf, use it 
If last environment was server-specified, use it 
Otherwise use our default (production) 
 This should be fixed since it will be different behavior than before, when we used to do the node request.      
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.102742.1628493420038%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-06 Thread Ciprian Badescu (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Ciprian Badescu updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-11201  
 
 
  Refine when the last used environment is used   
 

  
 
 
 
 

 
Change By: 
 Ciprian Badescu  
 

  
 
 
 
 

 
 With the recent changes in PUP-10216, the agent stores the last used environment in {{last_run_summary.yaml}}. If the next run does not specify an environment on the CLI, then the last used environment *always* takes precedence over the environment specified in puppet.conf. For example, given:{noformat}# puppet agent -t --environment feature_branch# puppet agent -t{noformat}If the agent is allowed to specify its environment:Prior to PUP-10216, the second run would use the original configured environment from puppet.conf or default to "production".After PUP-10216, the second run uses the "feature_branch" environment. This is also true if the second run occurs in the background (systemd/cron), which is especially surprising.In cases where the agent is *not* allowed to specify its environment, the last used environment provides the same function that the node request did. So the agent's behavior before and after PUP-10216 is the same, assuming the agent pluginsync'ed the right set of facts and classification doesn't change between runs.This ticket proposes we make an exception for the agent-specified case so that the second run only uses the environment from the previous run if it was server-specified. Otherwise, the agent should start in its configured environment (from puppet.conf) or default to "production".So I think this means:  # If environment specified on CLI, use it# If last environment was server-specified, use it# Otherwise use our configured environment {{Puppet[:environment]}}I think we can detect if the last environment was server-specified by saving both the initial environment and the converged environment  in {{last_run_summary . yaml}}.  If those are different, then the server told us to use a different environment.If they are the same, then it doesn't matter if it's agent or server-specified, just use it.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 
 

Jira (PUP-11201) Refine when the last used environment is used

2021-08-05 Thread Josh Cooper (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Josh Cooper updated an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-11201  
 
 
  Refine when the last used environment is used   
 

  
 
 
 
 

 
Change By: 
 Josh Cooper  
 
 
Release Notes: 
 Not Needed  
 
 
Release Notes Summary: 
 This issue was introduced during development and never released.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.410096.1628208242000.100769.1628208420031%40Atlassian.JIRA.


Jira (PUP-11201) Refine when the last used environment is used

2021-08-05 Thread Josh Cooper (Jira)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Josh Cooper created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Puppet /  PUP-11201  
 
 
  Refine when the last used environment is used   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Unassigned  
 
 
Created: 
 2021/08/05 5:04 PM  
 
 
Priority: 
  Normal  
 
 
Reporter: 
 Josh Cooper  
 

  
 
 
 
 

 
 With the recent changes in PUP-10216, the agent stores the last used environment in last_run_summary.yaml. If the next run does not specify an environment on the CLI, then the last used environment always takes precedence over the environment specified in puppet.conf. For example, given:  
 
 
 
 
 # puppet agent -t --environment feature_branch  
 
 
 # puppet agent -t
  
 
 
 
  If the agent is allowed to specify its environment: Prior to PUP-10216, the second run would use the original configured environment from puppet.conf or default to "production". After PUP-10216, the second run uses the "feature_branch" environment. This is also true if the second run occurs in the background (systemd/cron), which is especially surprising. In cases where the agent is not allowed to specify its environment, the last used environment provides the same function that the node request did. So the agent's behavior before and after PUP-10216 is the same, assuming the agent pluginsync'ed the right set of facts and classification doesn't change between runs. This ticket proposes we make an exception for the agent-specified case so that the second run only uses the environment from the previous run if it was