Ask Your Question

# Specifiy Environment Parameters

Hi, I'm very new to PE, and trying to define the environment the node should belong to in the power shell script. So i'm appending this parameter "agent:environment=<dev>" to the end of the scrip, but for some reason in the puppet.conf file for the agent seems to be defaulting to production? Any help would be appreciated TommyQ

edit retag close merge delete

## 2 Answers

Sort by » oldest newest most voted

Where do you want to set the Environment parameters? You can set either on PE, on your node group classification ( default as you noticed is Production). You may also set it on agent puppet.conf on environment = < env > parameter.

more

I'm installing the agent using the powershell command after setting the class in PE.. within the powershell command you can pass agent parameters to customise the agent conf, but for some reason the environment param doesn't seem to be applied. By using the powershell command I was hoping to automate the deployment of the agent for nodes into specific environments.

This is the command i've been running:

 [Net.ServicePointManager]::ServerCertificateValidationCallback = {$true};$webClient = New-Object System.Net.WebClient; \$webClient.DownloadFile('https://<PUPPET MASTER FQDN>:8140/packages/current/install.ps1', 'install.ps1'); .\install.ps1 agent:environment=<dev>


Thanks

Tommy

more

## Comments

So on your agent puppet.conf did the entry for environment is set?

( 2016-11-25 16:26:19 -0600 )edit

On the node agent it's set, but as production and not dev which is the parameter I passed in the script

( 2016-11-26 01:46:20 -0600 )edit

What does insta..ps1 contain? It that suppose to modify the entry of puppet.conf base on the parameter that you pass? You need to fix that somehow so that the environment entry on puppet.conf reflect the change that you want.

( 2016-11-26 13:30:04 -0600 )edit

Thanks Lupin, I found the issue. I needed to put a space between the environment= "agent:environment = dev" Thanks

( 2016-11-27 04:58:24 -0600 )edit

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2016-11-25 09:04:43 -0600

Seen: 45 times

Last updated: Nov 26 '16