Last active
August 7, 2017 04:19
-
-
Save hnrkndrssn/b0c3152cda9de3bb0f96 to your computer and use it in GitHub Desktop.
Revisions
-
hnrkndrssn revised this gist
Jan 10, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,7 @@ Write-Host "Add this value to the 'Tentacle.Communication.TrustedOctopusServers' $server = [ordered]@{ "Thumbprint" = ""; # Your Octopus Server Thumbprint "CommunicationStyle" = 2; "Address" = "https://octopus.url:10943"; # Your Octopus Server URL and Communications port (10943 by default) "Squid" = ""; "SubscriptionId" = $tentacleEndpoint.Uri; } -
hnrkndrssn created this gist
Jan 10, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ # Step 1 - Run this on the Tentacle server to create the new Tentacle $tentacleName = 'P1' $tentaclePort = 10933 & "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" create-instance --instance $tentacleName --config "C:\Octopus\$tentacleName\Tentacle-$tentacleName.config" & "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" new-certificate --instance $tentacleName --if-blank & "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" configure --instance $tentacleName --reset-trust & "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" configure --instance $tentacleName --home "C:\Octopus\$tentacleName" --app "C:\Octopus\Applications\$tentacleName" --port $tentaclePort --noListen "True" & "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.exe" service --instance $tentacleName --install --start This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ # Step 2 - Run this on your Octopus Server Add-Type -Path 'C:\Program Files\Octopus Deploy\Tentacle\Octopus.Client.dll' $apikey = 'API-XXXXXXXXXXXXXXXXXXXXXXXXX' # Get this from your profile $octopusURI = 'http://octopus.url' # Your Octopus Server address $tentacleThumbprint = "" # Your Tentacle thumbprint $environmentId = "Environments-1" # Get this from /api/environments $role = "tentacle-role" # The role of the machine $machineName = "YourTentacleName" # The name of the machine $endpoint = New-Object Octopus.Client.OctopusServerEndpoint $octopusURI,$apikey $repository = New-Object Octopus.Client.OctopusRepository $endpoint $tentacleEndpoint = New-Object Octopus.Client.Model.Endpoints.PollingTentacleEndpointResource $tentacleEndpoint.Thumbprint = $tentacleThumbprint $tentacleEndpoint.Uri = "poll://" + (([char[]]([char]'A'..[char]'Z') | sort {get-random})[0..20] -Join '') + "/" $tentacle = New-Object Octopus.Client.Model.MachineResource $tentacle.Endpoint = $tentacleEndpoint $tentacle.EnvironmentIds.Add($environmentId) $tentacle.Roles.Add($role) $tentacle.Name = $machineName $repository.Machines.Create($tentacle) Write-Host "Add this value to the 'Tentacle.Communication.TrustedOctopusServers' key in Tentacle-${machineName}.config" $server = [ordered]@{ "Thumbprint" = ""; # Your Octopus Server Thumbprint "CommunicationStyle" = 2; "Address" = "http://octopus.url:10943"; # Your Octopus Server URL and Communications port (10943 by default) "Squid" = ""; "SubscriptionId" = $tentacleEndpoint.Uri; } $server | ConvertTo-Json -Compress This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ - Open the Tentacle configuration file of your new Tentacle (specified when you registered the Tentacle in step 1) - Add the JSON output by step 2 above to the Tentacle.Communication.TrustedOctopusServers (within the []) - Save the config file - Restart the Tentacle service This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ - Perform a health check and if everything is right, the new polling Tentacle should report back successfully.