| 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`
Desired Behavior: 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". Actual Behavior: 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. Notes ****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. |