Skip to content

Commit

Permalink
AL1 changes (aws#6)
Browse files Browse the repository at this point in the history
- make separate config variables for AL1 docker and ecs versions
- install ecs-init package from AL yum repos
- overwrite the AL login banner with ecs's banner
  • Loading branch information
sparrc authored Oct 28, 2021
1 parent 17cab40 commit de4e9c1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
11 changes: 3 additions & 8 deletions al1.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ build {
provisioner "shell" {
inline_shebang = "/bin/sh -ex"
inline = [
"sudo mv /tmp/ecs-custom-motd /etc/update-motd.d/ecs-custom-motd",
"sudo chmod 755 /etc/update-motd.d/ecs-custom-motd"
"sudo mv /tmp/ecs-custom-motd /etc/update-motd.d/30-banner",
"sudo chmod 755 /etc/update-motd.d/30-banner"
]
}

Expand All @@ -79,15 +79,10 @@ build {
provisioner "shell" {
inline_shebang = "/bin/sh -ex"
inline = [
"sudo yum install -y docker-${var.docker_version} ${local.packages} docker-storage-setup"
"sudo yum install -y docker-${var.docker_version_al1} ecs-init-${var.ecs_version_al1} ${local.packages} docker-storage-setup"
]
}

provisioner "shell" {
script = "scripts/install-ecs-init.sh"
environment_vars = ["REGION=${var.region}", "AGENT_VERSION=${var.ecs_agent_version}", "INIT_REV=${var.ecs_init_rev}", "AL_NAME=amzn1"]
}

provisioner "shell" {
script = "scripts/install-additional-packages.sh"
}
Expand Down
2 changes: 1 addition & 1 deletion files/al1/ecs-custom-motd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
echo -e "
__| __| __|
_| ( \__ \ Amazon ECS-Optimized
_| ( \__ \ Amazon ECS-Optimized Amazon Linux AMI
____|\___|____/

For documentation, visit http://aws.amazon.com/documentation/ecs"
12 changes: 12 additions & 0 deletions variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ variable "source_ami_al1" {
description = "Amazon Linux 1 source AMI to build from."
}

variable "docker_version_al1" {
type = string
description = "Docker version to build AL1 AMI with."
default = "20.10.7"
}

variable "ecs_version_al1" {
type = string
description = "ECS version to build AL1 AMI with."
default = "1.51.0"
}

variable "air_gapped" {
type = string
description = "If this build is for an air-gapped region, set to 'true'"
Expand Down

0 comments on commit de4e9c1

Please sign in to comment.