Skip to content

Commit

Permalink
Merge pull request #2135 from OctopusDeploy/briggs-octo-patch-1
Browse files Browse the repository at this point in the history
Updating Linux Tentacle install commands to remove deprecated command
  • Loading branch information
briggs-octo authored Jan 11, 2024
2 parents fbdc9ec + 43f948c commit 8635e3e
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 55 deletions.
7 changes: 7 additions & 0 deletions dictionary-octopus.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ALLUSERSPROFILE
apikey
approot
appsettings
Expand All @@ -10,14 +11,17 @@ bootstrap
bootstrapped
bootstrapper
childelement
choco
cicd
classiclink
cloudapi
Cloudsmith
Cmdn
combinational
comms
COMPUTERNAME
Conjur
cooldown
createartifact
creds
cscfg
Expand All @@ -27,6 +31,7 @@ Datacenter
datetime
deallocate
deallocated
dearmor
deployers
deploymentannotation
deploymentprocess
Expand All @@ -46,6 +51,7 @@ groff
healthcheck
HKEY
HKLM
hostnames
hotfix
hotfixes
HSTS
Expand All @@ -60,6 +66,7 @@ Istio
istioctl
ITSM
jwks
keyrings
Kubelet
kustomization
kustomize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,26 @@ Many of the steps described below require elevated permissions, or must be run a
<summary>Debian/Ubuntu repository</summary>

```bash
apt-key adv --fetch-keys https://apt.octopus.com/public.key
sudo apt update && sudo apt install --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
sudo install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://apt.octopus.com/public.key | sudo gpg --dearmor -o /etc/apt/keyrings/octopus.gpg && \
sudo chmod a+r /etc/apt/keyrings/octopus.gpg && \
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/octopus.gpg] https://apt.octopus.com/ \
stable main" | \
sudo tee /etc/apt/sources.list.d/octopus.list > /dev/null && \
sudo apt update && sudo apt install tentacle

# for legacy Ubuntu/Debian (< 18.04) use
# sudo apt update && sudo apt install --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
# curl -sSfL https://apt.octopus.com/public.key | sudo apt-key add - && \
# sudo sh -c "echo deb https://apt.octopus.com/ stable main > /etc/apt/sources.list.d/octopus.com.list" && \
# sudo apt update && sudo apt install tentacle

add-apt-repository "deb https://apt.octopus.com/ stretch main"
# for Raspbian use
# sh -c "echo 'deb https://apt.octopus.com/ buster main' >> /etc/apt/sources.list"

apt-get update
apt-get install tentacle
# apt-get update
# apt-get install tentacle
```

</details>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ AWS CloudFormation is a great tool to use to provisions resources, however, it d

The following example will use Terraform to dynamically create worker machines based on auto-scaling rules. Instead of defining the Terraform template directly in the step template, this example will make use of a package. The package will consist of the following files:
- autoscaling.tf
- autoscalingpolicy.tf
- autoscaling-policy.tf
- backend.tf
- installTentacle.sh
- provider.tf
Expand All @@ -30,24 +30,24 @@ This file contains the definitions for creating the auto-scaling configuration i
<p>

```
resource "aws_launch_configuration" "dynamic-linux-worker-launchconfig" {
name_prefix = "dynamic-linux-worker-launchconfig"
resource "aws_launch_configuration" "dynamic-linux-worker-launch-config" {
name_prefix = "dynamic-linux-worker-launch-config"
image_id = "${var.LINUX_AMIS}"
instance_type = "t2.micro"
security_groups = ["${aws_security_group.allow-octopusserver.id}"]
security_groups = ["${aws_security_group.allow-octopus-server.id}"]
# script to run when created
user_data = "${file("installTentacle.sh")}"
}
resource "aws_launch_configuration" "dynamic-windows-worker-launchconfig" {
name_prefix = "dynamic-windows-worker-launchconfig"
resource "aws_launch_configuration" "dynamic-windows-worker-launch-config" {
name_prefix = "dynamic-windows-worker-launch-config"
image_id = "${var.WINDOWS_AMIS}"
instance_type = "t2.micro"
security_groups = ["${aws_security_group.allow-octopusserver.id}"]
security_groups = ["${aws_security_group.allow-octopus-server.id}"]
user_data = <<-EOT
<script>
Expand Down Expand Up @@ -76,7 +76,7 @@ choco install octopusdeploy.tentacle -y
resource "aws_autoscaling_group" "dynamic-linux-worker-autoscaling" {
name = "dynamic-linux-worker-autoscaling"
vpc_zone_identifier = ["${aws_subnet.worker-public-1.id}", "${aws_subnet.worker-public-2.id}", "${aws_subnet.worker-public-3.id}"]
launch_configuration = "${aws_launch_configuration.dynamic-linux-worker-launchconfig.name}"
launch_configuration = "${aws_launch_configuration.dynamic-linux-worker-launch-config.name}"
min_size = 2
max_size = 3
health_check_grace_period = 300
Expand All @@ -93,7 +93,7 @@ resource "aws_autoscaling_group" "dynamic-linux-worker-autoscaling" {
resource "aws_autoscaling_group" "dynamic-windows-worker-autoscaling" {
name = "dynamic-windows-worker-autoscaling"
vpc_zone_identifier = ["${aws_subnet.worker-public-1.id}", "${aws_subnet.worker-public-2.id}", "${aws_subnet.worker-public-3.id}"]
launch_configuration = "${aws_launch_configuration.dynamic-windows-worker-launchconfig.name}"
launch_configuration = "${aws_launch_configuration.dynamic-windows-worker-launch-config.name}"
min_size = 2
max_size = 3
health_check_grace_period = 300
Expand All @@ -110,12 +110,12 @@ resource "aws_autoscaling_group" "dynamic-windows-worker-autoscaling" {
</p>
</details>

## autoscalingpolicy.tf
## autoscaling-policy.tf

This file contains the policy definition that goes with the auto-scaling definition:

<details>
<summary>autoscalingpolicy.tf</summary>
<summary>autoscaling-policy.tf</summary>
<p>

```
Expand Down Expand Up @@ -150,18 +150,18 @@ resource "aws_cloudwatch_metric_alarm" "linux-worker-cpu-alarm" {
}
# scale down alarm
resource "aws_autoscaling_policy" "linux-worker-cpu-policy-scaledown" {
name = "linux-worker-cpu-policy-scaledown"
resource "aws_autoscaling_policy" "linux-worker-cpu-policy-scale-down" {
name = "linux-worker-cpu-policy-scale-down"
autoscaling_group_name = "${aws_autoscaling_group.dynamic-linux-worker-autoscaling.name}"
adjustment_type = "ChangeInCapacity"
scaling_adjustment = "-1"
cooldown = "300"
policy_type = "SimpleScaling"
}
resource "aws_cloudwatch_metric_alarm" "linux-worker-cpu-alarm-scaledown" {
alarm_name = "linux-worker-cpu-alarm-scaledown"
alarm_description = "linux-worker-cpu-alarm-scaledown"
resource "aws_cloudwatch_metric_alarm" "linux-worker-cpu-alarm-scale-down" {
alarm_name = "linux-worker-cpu-alarm-scale-down"
alarm_description = "linux-worker-cpu-alarm-scale-down"
comparison_operator = "LessThanOrEqualToThreshold"
evaluation_periods = "2"
metric_name = "CPUUtilization"
Expand All @@ -175,7 +175,7 @@ resource "aws_cloudwatch_metric_alarm" "linux-worker-cpu-alarm-scaledown" {
}
actions_enabled = true
alarm_actions = ["${aws_autoscaling_policy.linux-worker-cpu-policy-scaledown.arn}"]
alarm_actions = ["${aws_autoscaling_policy.linux-worker-cpu-policy-scale-down.arn}"]
}
resource "aws_autoscaling_policy" "windows-worker-cpu-policy" {
Expand Down Expand Up @@ -207,18 +207,18 @@ resource "aws_cloudwatch_metric_alarm" "windows-worker-cpu-alarm" {
}
# scale down alarm
resource "aws_autoscaling_policy" "windows-worker-cpu-policy-scaledown" {
name = "windows-worker-cpu-policy-scaledown"
resource "aws_autoscaling_policy" "windows-worker-cpu-policy-scale-down" {
name = "windows-worker-cpu-policy-scale-down"
autoscaling_group_name = "${aws_autoscaling_group.dynamic-windows-worker-autoscaling.name}"
adjustment_type = "ChangeInCapacity"
scaling_adjustment = "-1"
cooldown = "300"
policy_type = "SimpleScaling"
}
resource "aws_cloudwatch_metric_alarm" "windows-worker-cpu-alarm-scaledown" {
alarm_name = "windows-worker-cpu-alarm-scaledown"
alarm_description = "windows-worker-cpu-alarm-scaledown"
resource "aws_cloudwatch_metric_alarm" "windows-worker-cpu-alarm-scale-down" {
alarm_name = "windows-worker-cpu-alarm-scale-down"
alarm_description = "windows-worker-cpu-alarm-scale-down"
comparison_operator = "LessThanOrEqualToThreshold"
evaluation_periods = "2"
metric_name = "CPUUtilization"
Expand All @@ -232,7 +232,7 @@ resource "aws_cloudwatch_metric_alarm" "windows-worker-cpu-alarm-scaledown" {
}
actions_enabled = true
alarm_actions = ["${aws_autoscaling_policy.windows-worker-cpu-policy-scaledown.arn}"]
alarm_actions = ["${aws_autoscaling_policy.windows-worker-cpu-policy-scale-down.arn}"]
}
```
</p>
Expand Down Expand Up @@ -278,10 +278,21 @@ workerPool="#{Project.Octopus.Server.WorkerPool}"
machinePolicy="#{Project.Octopus.Server.MachinePolicy}"
space="#{Project.Octopus.Server.Space}"

sudo apt-key adv --fetch-keys "https://apt.octopus.com/public.key"
sudo add-apt-repository "deb https://apt.octopus.com/ stretch main"
sudo apt-get update
sudo apt-get install tentacle
sudo apt update && sudo apt install -y --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
sudo install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://apt.octopus.com/public.key | sudo gpg --dearmor -o /etc/apt/keyrings/octopus.gpg && \
sudo chmod a+r /etc/apt/keyrings/octopus.gpg && \
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/octopus.gpg] https://apt.octopus.com/ \
stable main" | \
sudo tee /etc/apt/sources.list.d/octopus.list > /dev/null && \
sudo apt update && sudo apt install -y tentacle

# for legacy Ubuntu/Debian (< 18.04) use
# sudo apt update && sudo apt install -y --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
# curl -sSfL https://apt.octopus.com/public.key | sudo apt-key add - && \
# sudo sh -c "echo deb https://apt.octopus.com/ stable main > /etc/apt/sources.list.d/octopus.com.list" && \
# sudo apt update && sudo apt install -y tentacle

sudo /opt/octopus/tentacle/Tentacle create-instance --config "$configFilePath" --instance "$name"
sudo /opt/octopus/tentacle/Tentacle new-certificate --if-blank
Expand Down Expand Up @@ -310,10 +321,10 @@ This contains the security group information for AWS:
<p>

```
resource "aws_security_group" "allow-octopusserver" {
resource "aws_security_group" "allow-octopus-server" {
vpc_id = "${aws_vpc.worker_vpc.id}"
name = "allow-octopusserver"
description = "Security group that allows traffic to the worker from the Octpus Server"
name = "allow-octopus-server"
description = "Security group that allows traffic to the worker from the Octopus Server"
egress {
from_port = 0
to_port = 0
Expand Down Expand Up @@ -343,15 +354,15 @@ resource "aws_security_group" "allow-octopusserver" {
}
tags = {
Name = "allow-octopusserver"
Name = "allow-octopus-server"
}
}
```
</p>
</details>

## vars.tf
This contains the variables that are referenced in other files. Note there are Octostache (Octopus variable syntax) to make use of Octopus variables:
This contains the variables that are referenced in other files. Note there are Octostache (Octopus variable syntax) to make use of Octopus variables:

<details>
<summary>vars.tf</summary>
Expand All @@ -373,11 +384,11 @@ variable "WINDOWS_AMIS"{
}
variable "PATH_TO_PRIVATE_KEY" {
default = "mykey"
default = "my_key"
}
variable "PATH_TO_PUBLIC_KEY" {
default = "mykey.pub"
default = "my_key.pub"
}
variable "INSTANCE_USERNAME" {
Expand Down
76 changes: 60 additions & 16 deletions src/shared-content/infrastructure/quickstart-debian.include.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,21 @@ role="web server" # The role to assign to the Tentacle
configFilePath="/etc/octopus/default/tentacle-default.config"
applicationPath="/home/Octopus/Applications/"

apt-key adv --fetch-keys https://apt.octopus.com/public.key
add-apt-repository "deb https://apt.octopus.com/ stretch main"
apt-get update
apt-get install tentacle
sudo apt update && sudo apt install --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
sudo install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://apt.octopus.com/public.key | sudo gpg --dearmor -o /etc/apt/keyrings/octopus.gpg && \
sudo chmod a+r /etc/apt/keyrings/octopus.gpg && \
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/octopus.gpg] https://apt.octopus.com/ \
stable main" | \
sudo tee /etc/apt/sources.list.d/octopus.list > /dev/null && \
sudo apt update && sudo apt install tentacle

# for legacy Ubuntu/Debian (< 18.04) use
# sudo apt update && sudo apt install --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
# curl -sSfL https://apt.octopus.com/public.key | sudo apt-key add - && \
# sudo sh -c "echo deb https://apt.octopus.com/ stable main > /etc/apt/sources.list.d/octopus.com.list" && \
# sudo apt update && sudo apt install tentacle

/opt/octopus/tentacle/Tentacle create-instance --config "$configFilePath"
/opt/octopus/tentacle/Tentacle new-certificate --if-blank
Expand All @@ -43,10 +54,21 @@ role="web server" # The role to assign to the Tentacle
configFilePath="/etc/octopus/default/tentacle-default.config"
applicationPath="/home/Octopus/Applications/"

apt-key adv --fetch-keys https://apt.octopus.com/public.key
add-apt-repository "deb https://apt.octopus.com/ stretch main"
apt-get update
apt-get install tentacle
sudo apt update && sudo apt install --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
sudo install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://apt.octopus.com/public.key | sudo gpg --dearmor -o /etc/apt/keyrings/octopus.gpg && \
sudo chmod a+r /etc/apt/keyrings/octopus.gpg && \
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/octopus.gpg] https://apt.octopus.com/ \
stable main" | \
sudo tee /etc/apt/sources.list.d/octopus.list > /dev/null && \
sudo apt update && sudo apt install tentacle

# for legacy Ubuntu/Debian (< 18.04) use
# sudo apt update && sudo apt install --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
# curl -sSfL https://apt.octopus.com/public.key | sudo apt-key add - && \
# sudo sh -c "echo deb https://apt.octopus.com/ stable main > /etc/apt/sources.list.d/octopus.com.list" && \
# sudo apt update && sudo apt install tentacle

/opt/octopus/tentacle/Tentacle create-instance --config "$configFilePath"
/opt/octopus/tentacle/Tentacle new-certificate --if-blank
Expand All @@ -70,10 +92,21 @@ workerPool="Default Worker Pool" # The worker pool to register the Tentacle i
configFilePath="/etc/octopus/default/tentacle-default.config"
applicationPath="/home/Octopus/Applications/"

apt-key adv --fetch-keys https://apt.octopus.com/public.key
add-apt-repository "deb https://apt.octopus.com/ stretch main"
apt-get update
apt-get install tentacle
sudo apt update && sudo apt install --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
sudo install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://apt.octopus.com/public.key | sudo gpg --dearmor -o /etc/apt/keyrings/octopus.gpg && \
sudo chmod a+r /etc/apt/keyrings/octopus.gpg && \
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/octopus.gpg] https://apt.octopus.com/ \
stable main" | \
sudo tee /etc/apt/sources.list.d/octopus.list > /dev/null && \
sudo apt update && sudo apt install tentacle

# for legacy Ubuntu/Debian (< 18.04) use
# sudo apt update && sudo apt install --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
# curl -sSfL https://apt.octopus.com/public.key | sudo apt-key add - && \
# sudo sh -c "echo deb https://apt.octopus.com/ stable main > /etc/apt/sources.list.d/octopus.com.list" && \
# sudo apt update && sudo apt install tentacle

/opt/octopus/tentacle/Tentacle create-instance --config "$configFilePath"
/opt/octopus/tentacle/Tentacle new-certificate --if-blank
Expand All @@ -98,10 +131,21 @@ workerPool="Default Worker Pool" # The worker pool to register the Tentacle i
configFilePath="/etc/octopus/default/tentacle-default.config"
applicationPath="/home/Octopus/Applications/"

apt-key adv --fetch-keys https://apt.octopus.com/public.key
add-apt-repository "deb https://apt.octopus.com/ stretch main"
apt-get update
apt-get install tentacle
sudo apt update && sudo apt install --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
sudo install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://apt.octopus.com/public.key | sudo gpg --dearmor -o /etc/apt/keyrings/octopus.gpg && \
sudo chmod a+r /etc/apt/keyrings/octopus.gpg && \
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/octopus.gpg] https://apt.octopus.com/ \
stable main" | \
sudo tee /etc/apt/sources.list.d/octopus.list > /dev/null && \
sudo apt update && sudo apt install tentacle

# for legacy Ubuntu/Debian (< 18.04) use
# sudo apt update && sudo apt install --no-install-recommends gnupg curl ca-certificates apt-transport-https && \
# curl -sSfL https://apt.octopus.com/public.key | sudo apt-key add - && \
# sudo sh -c "echo deb https://apt.octopus.com/ stable main > /etc/apt/sources.list.d/octopus.com.list" && \
# sudo apt update && sudo apt install tentacle

/opt/octopus/tentacle/Tentacle create-instance --config "$configFilePath"
/opt/octopus/tentacle/Tentacle new-certificate --if-blank
Expand Down

0 comments on commit 8635e3e

Please sign in to comment.