How would you automate adding a machine to a tenant?

The documentation shows how to register a machine and assign it roles and environments.

How would you automate adding a machine to a tenant?

Hi,

Thanks for getting in touch! You’re in the right place, but the mention of tenants is buried in a tip on that page:

When configuring your tentacle you can configure advanced options, like proxies, machine policies and tenants, which can also be automated. Use the setup wizard to configure the Tentacle, and click the Show Script link which will show you the command-line equivalent to configure the Tentacle.

My recommendation would be to use the Tentacle Manager to configure the tenant(s) for the machine and then use the Show Script link to see the command line it generates.

Hope that helps!
Mike

Solution

-- tenant "foo" --tenant "bar"
-- tenanttag "foo" --tenant "bar"
"C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" register-with --instance "Tentacle" --server "https://octopus.example.com/" --name "xxxxx" --username "xxxxxxxx" --password "xxxxxxxx" --comms-style "TentacleActive" --server-comms-port "10943" --force --environment "dev" --tenanttag "foo" --tenanttag "bar" --tenant "developers" --tenant "testers" --role "web-default" --policy "Default Machine Policy"

"C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" service --instance "Tentacle" --install --start

Hi,

I’m glad to see you’ve got it working!

Don’t hesitate to reach out if we can help with anything else.

Happy Deployments!
Mike