fix: Change Docker provider from TCP to SSH connection
All checks were successful
Code Quality & Security Scan / TFLint (push) Successful in 20s
Code Quality & Security Scan / Terraform Destroy (push) Has been skipped
Code Quality & Security Scan / Tfsec Security Scan (push) Successful in 26s
Code Quality & Security Scan / Checkov Security Scan (push) Successful in 40s
Code Quality & Security Scan / Terraform Validate (push) Successful in 30s
Code Quality & Security Scan / SonarQube Scan (push) Successful in 43s
Code Quality & Security Scan / Terraform Plan (push) Successful in 1m16s
Code Quality & Security Scan / Terraform Apply (push) Successful in 3m27s

Updated Docker provider configuration:
- Changed from tcp://192.168.2.170:2376 to ssh://ansible@wbyc-srv-docker01.bsdserver.lan:22
- Added ssh_opts with path to SSH key and StrictHostKeyChecking=no
- Removed cert_path configuration (not needed for SSH)

This matches the working configuration from terraform-docker-eda module
and uses the SSH key retrieved from Vault via setup-ssh.sh script.
This commit is contained in:
Patrick de Ruiter 2025-11-18 03:56:41 +01:00
parent bb54c5bf5b
commit eaab76901a
Signed by: pderuiter
GPG Key ID: 5EBA7F21CF583321

View File

@ -29,11 +29,9 @@ provider "dns" {
# Configure the Docker Provider
provider "docker" {
host = "tcp://192.168.2.170:2376"
host = "ssh://ansible@wbyc-srv-docker01.bsdserver.lan:22"
# Use cert_path only if certificates exist (local development)
# For CI/CD, use DOCKER_HOST environment variable instead
cert_path = fileexists(pathexpand("~/.docker/ca.pem")) ? pathexpand("~/.docker") : null
ssh_opts = ["-i", "${path.module}/.ssh/id_rsa", "-o", "StrictHostKeyChecking=no"]
}
# Configure the Vault Provider