Jira (PUP-11214) Environments get ignored via node_terminus exec

8 views
Skip to first unread message

Josh Cooper (Jira)

unread,
Aug 20, 2021, 3:28:02 PM8/20/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Puppet / Bug PUP-11214
Environments get ignored via node_terminus exec
Change By: Josh Cooper
Affects Version/s: PUP 7.10.0
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Aug 20, 2021, 3:28:03 PM8/20/21
to puppe...@googlegroups.com
Josh Cooper moved an issue
Change By: Josh Cooper
Fix Version/s: puppet-agent 7.9.0
Fix Version/s: PUP 7.10.0
Key: PA PUP - 3924 11214
Affects Version/s: puppet-agent 7.10.0
Project: Puppet Agent

Josh Cooper (Jira)

unread,
Aug 20, 2021, 3:28:03 PM8/20/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.10.0

Josh Cooper (Jira)

unread,
Aug 20, 2021, 4:49:03 PM8/20/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11214
 
Re: Environments get ignored via node_terminus exec

Hi Sebastian I can't reproduce the issue. I installed the latest version of puppet-hiera-enc and adapted it for puppet 7 pathing:

# tail -2 /etc/puppetlabs/puppet/puppet.conf 
node_terminus = exec
external_nodes = /etc/puppetlabs/hiera-enc/enc
# head /etc/puppetlabs/hiera-enc/hiera-enc.yaml
---
:backends:
  - yaml
:yaml:
  :datadir: /etc/puppetlabs/hiera-enc/nodes
:hierarchy:
  - "%{clientcert}"
  - "%{fqdn}"
  - "%{hostname}"
  - "default"
# head /etc/puppetlabs/hiera-enc/nodes/demo.example.com.yaml 
---
environment: customer1

If you delete the last_run_summary.yaml (which contains the last used environment), then the next agent run starts up in production but switches to customer1 as expected:

# rm -rf /opt/puppetlabs/puppet/public/
# puppet agent -t --certname demo.example.com
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Notice: Local environment: 'production' doesn't match server specified environment 'customer1', restarting agent run with environment 'customer1'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for demo.example.com
Info: Applying configuration version '1629491794'
Notice: Applied catalog in 0.01 seconds

The run after that starts off in the environment the server told it to use last time:

# puppet agent -t --certname demo.example.com
Info: Using environment 'customer1'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for demo.example.com
Info: Applying configuration version '1629491805'

I also had to install the hiera gem into system ruby since the enc script hard codes the shebang line:

# head -3 /etc/puppetlabs/hiera-enc/enc 
#!/usr/bin/env ruby
#
# Copyright 2014 Peter van Zetten

It sounds like there's something in your classification logic that relied on retrieving the fact value from the previous run... What does your /etc/puppetlabs/hiera-enc/hiera-enc.yaml contain? Are you defining hierarchies based on agent facts?

Are you overriding where Puppet[:last_run_summary] is stored or modifying the file between runs?

Sebastian (Jira)

unread,
Aug 25, 2021, 3:54:02 AM8/25/21
to puppe...@googlegroups.com
Sebastian commented on Bug PUP-11214

tested several scenarios today again. seems to be the error goes away after updating puppetserver from puppetserver-7.2.1-1.el7.noarch to puppetserver.noarch 0:7.3.0-1.el7.

thanks for your time.

Reply all
Reply to author
Forward
0 new messages