Affects Version/s: PUP 5.5.10, PUP 5.5.12, PUP 5.5.13, PUP 5.5.14
Fix Version/s: None
Puppet Agent 5.5.x (5.5.8 and earlier works, 5.5.10 through 5.5.14 does not).
Template:PUP Bug Template customfield_10700 312177
Method Found:Needs Assessment
QA Risk Assessment:Needs Assessment
Puppet Version: 5.5.10 - 5.5.14 (5.5.8 works correctly)
Puppet Server Version: 5.3.6
OS Name/Version: Centos 7
Note that this probably affects at least some versions of Puppet 6.x, though I don't have the setup to verify that personally.
Steps to reproduce:
- Install Puppet Agent 5.5.10 or later
- Configure a Device node in devices.conf and set up a certificate for it
- Configure the ENC on the Master to supply an environment other than production for the device node
- Run `puppet device --target <node> --verbose`
The application switches to the ENC-supplied environment before performing a plugin sync. This behavior can be observed under 5.5.8; the logs show "Notice: Local environment 'production' doesn't match server specified node environment 'foo', switching agent to 'foo'." prior to "Retrieving pluginfacts".
The application remains in the production environment during pluginsync (and possibly after) unless a `–environment` flag is explicitly passed. No environment-switching occurs. If the module containing the device transport code is not present in the production environment, then the device transport files will be removed and the subsequent run will fail.
This seems likely to be related to
PUP-8766, which changed the way that the puppet device application handles environments, and was incorporated into 5.5.10 as well as 6.0.5. Prior to PUP-8766, only ENC-supplied environments were honored by the Puppet Device application, and the --environment flag did not function; now, the reverse situation is true.