Client Setup
Client Setup
Summary
Once you have your Chocolatey for Business environment deployed, you’ll need to get clients talking to it.
To do that, you’ll need to do the following on the clients:
- Ensure the client machine can access the Chocolatey Central Management service on port 24020, and the Sonatype Nexus service on 8443 (by default).
- If your certificate is self-signed: Install the SSL/TLS certificate.
- Install Chocolatey components and configure the client for Chocolatey for Business (C4B) deployments and management.
Client Setup
You will need the following values ready when running this script:
FQDN
: The fully qualified domain name used to access your environment.ccm_client_salt
: This is the client-side salt additive. More information about this can be found in the Config Settings docs. The value will have been provided during the deployment of the Chocolatey for Business environment.ccm_service_salt
: This is the service salt additive. More information about this can be found in the Config Settings docs. The value will have been provided during the deployment of the Chocolatey for Business environment.nexus_password
: The password for thechocouser
account which is used by the client to access your environments’ Sonatype Nexus service. The value will have been provided during the deployment of the Chocolatey for Business environment.
The values generated during the deployment are available in the CCM.html
file provided in the credentials
directory within the deployment repository.
To install the Chocolatey components and on-board clients, you could run an Ansible playbook.
ClientSetup Playbook
After saving the example playbook to a file, e.g. client-setup.yml
, you can run it with one of the following commands:
You will be prompted to enter the values mentioned above, but you can pass them in using --extra-vars
instead. Please see the Ansible documentation “Defining Variables At Runtime” for further details and examples.
WARNING
This playbook will install Dotnet 4.8 to target hosts that don’t have a compatible version installed.
This will cause machines that have the dependency installed to reboot.
To install the Chocolatey components and on-board clients, you could run the ClientSetup.ps1
script provided with your Chocolatey for Business Ansible Environment. By default, this script is stored in the newly created choco-install
repository.
NOTE
You can set default values for the parameters and remove the Mandatory flag if you prefer to run the script without being prompted for input.
PowerShell Script
When you’re ready, run the following script on the client from an elevated (Run as Administrator) PowerShell terminal:
For example, to run this locally, save the script to an accessible location (in the example below shown as ~\Downloads\ChocoOnboarding.ps1
) and run:
You will then be prompted for each parameter value.
Alternatively, you could run the ClientSetup.ps1 script with Ansible.
Ansible Script
An example of what to add to your Ansible tasks is shown below:
This will not be as predictable as running Ansible tasks, and will report a change regardless of the result of the script.
To install the Chocolatey components and on-board clients, you could add the example Ansible roles to a playbook.
To do this, copy the roles
directory from the C4B-Ansible Repository to the directory your playbook is saved, or to a roles_path
.
You will then be able to reference the role(s) in your playbook, as shown below:
Ansible Roles
For further information on the roles and available parameters, please refer to the readmes:
This script will accomplish the following on your client:
- Install Chocolatey CLI from the installation script hosted in your internal raw Sonatype Nexus Repository.
- Add the
ChocolateyInternal
source, and enable it for self-service. - Disable the default
chocolatey
source. - Install your Chocolatey license using the
chocolatey-license
package. - Install the Chocolatey Licensed Extension (without context menus for Package Builder).
- Install the
ChocolateyGUI
package on the endpoint, for self-service support. - Install the
chocolatey-agent
package, which supports self-service and Chocolatey Central Management communication. - Enable and disable features related to configuring self-service access on the endpoint.
- Setup the communication channel between the endpoint and Chocolatey Central Management, using the correct URL and salts.
- Enable Chocolatey Central Management Deployments.