test(e2e): Update module to account for docker image changes (#5295)

There were some directory changes made to the openssh server docker container. These changes were made to account for that update.
pull/5298/head
Michael Li 1 year ago committed by GitHub
parent 088564c385
commit ae0ca0c5aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2,13 +2,13 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
cp /ca/ca-key.pub /etc/ssh/ca-key.pub
chown 1000:1000 /etc/ssh/ca-key.pub
chmod 644 /etc/ssh/ca-key.pub
echo TrustedUserCAKeys /etc/ssh/ca-key.pub >> /etc/ssh/sshd_config
echo PermitTTY yes >> /etc/ssh/sshd_config
sed -i 's/X11Forwarding no/X11Forwarding yes/' /etc/ssh/sshd_config
echo "X11UseLocalhost no" >> /etc/ssh/sshd_config
cp /ca/ca-key.pub /config/sshd/ca-key.pub
chown 1000:1000 /config/sshd/ca-key.pub
chmod 644 /config/sshd/ca-key.pub
echo TrustedUserCAKeys /config/sshd/ca-key.pub >> /config/sshd/sshd_config
echo PermitTTY yes >> /config/sshd/sshd_config
sed -i 's/X11Forwarding no/X11Forwarding yes/' /config/sshd/sshd_config
echo "X11UseLocalhost no" >> /config/sshd/sshd_config
apk update
apk add xterm util-linux dbus ttf-freefont xauth firefox

@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
sed -i 's/AllowTcpForwarding no/AllowTcpForwarding yes/' /config/sshd/sshd_config

@ -61,9 +61,14 @@ locals {
ca_public_key = data.tls_public_key.ca_key.public_key_openssh
}
data "docker_registry_image" "openssh" {
name = var.image_name
}
resource "docker_image" "openssh_server" {
name = var.image_name
keep_locally = true
name = var.image_name
keep_locally = true
pull_triggers = [data.docker_registry_image.openssh.sha256_digest]
}
resource "docker_container" "openssh_server" {
@ -75,6 +80,7 @@ resource "docker_container" "openssh_server" {
"TZ=US/Eastern",
"USER_NAME=${var.target_user}",
"PUBLIC_KEY=${local.ssh_public_key}",
"SUDO_ACCESS=true",
]
network_mode = "bridge"
dynamic "networks_advanced" {

Loading…
Cancel
Save