Add machine to environment via script

I am very new to Octopus Deploy. We just now starting on our automation for deployments and configuration management. I know it is easy to automatically install Tentacle on a server that we will deploy to. What I am trying to discover if we can script the “Add Machine” to an environment as well. The situation is:

  1. Provision a new Web Server
  2. Install Tentacle
  3. Add machine to Environment (based on an environment variable on machine or something).

Can I do step 3 via script? Or am I missing something. I know it is very easy to go into Server and click the button, but I would like to be able to do this without manual user steps.


Thanks for getting in touch! Are you aware of the Tentacle.exe commands available such as register-with?
We have a documentation page on automatic Tentacle installation:
If you see the register-with command will add the machine, define the environment and roles.

Hope that helps!