spurin / diveintoansible-lab

Dive Into Ansible Lab
788 stars 498 forks source link

windows 10: host not found in upstream "ubuntu1" on docker compose up #36

Closed cigfthomas closed 3 years ago

cigfthomas commented 3 years ago

Previously, I have been running through this class and the lab successfully. However, now when run the lab it has the error below. I have seen similar issues (17) but I'm unclear on the resolution. It feels like a permissions/elevated privilege issue. I have tried this as my domain account and using run as administrator.

Below is the error, docker version, .env file contents and a docker command showing the paths in env file will mount.

PS C:\WINDOWS\system32> cd C:\diveintoansible-lab\ PS C:\diveintoansible-lab> docker compose up [+] Running 9/0

docker version Client: Cloud integration: 1.0.14 Version: 20.10.6 API version: 1.41 Go version: go1.16.3 Git commit: 370c289 Built: Fri Apr 9 22:49:36 2021 OS/Arch: windows/amd64 Context: default Experimental: true

Server: Docker Engine - Community Engine: Version: 20.10.6 API version: 1.41 (minimum version 1.12) Go version: go1.13.15 Git commit: 8728dd2 Built: Fri Apr 9 22:44:56 2021 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.4.4 GitCommit: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e runc: Version: 1.0.0-rc93 GitCommit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec docker-init: Version: 0.19.0 GitCommit: de40ad0

.env file

sshd ports

UBUNTUC_PORT_SSHD=2221 UBUNTU1_PORT_SSHD=2222 UBUNTU2_PORT_SSHD=2223 UBUNTU3_PORT_SSHD=2224 CENTOS1_PORT_SSHD=2225 CENTOS2_PORT_SSHD=2226 CENTOS3_PORT_SSHD=2227

ttyd (web terminal) ports

UBUNTUC_PORT_TTYD=7681 UBUNTU1_PORT_TTYD=7682 UBUNTU2_PORT_TTYD=7683 UBUNTU3_PORT_TTYD=7684 CENTOS1_PORT_TTYD=7685 CENTOS2_PORT_TTYD=7686 CENTOS3_PORT_TTYD=7687

Shared config volume

CONFIG=/host_mnt/c/diveintoansible-lab/config

Shared home directories

ANSIBLE_HOME=/host_mnt/c/diveintoansible-lab/ansible_home

test mapping the locations: docker run -v /host_mnt/c/diveintoansible-lab/config:/config -v /host_mnt/c/diveintoansible-lab/ansible_home:/ansible_home --rm -p 12345:7681 --privileged -it spurin/diveintoansible:ansible ls -la /config /ansible_home /ansible_home: total 4 drwxrwxrwx 1 root root 0 Jun 9 19:02 . drwxr-xr-x 1 root root 4096 Jun 9 20:17 .. drwxrwxrwx 1 root root 0 Jun 9 19:02 shared drwxrwxrwx 1 root root 0 Jun 9 19:02 ubuntu-c

/config: total 10 drwxrwxrwx 1 root root 4096 Jun 9 19:04 . drwxr-xr-x 1 root root 4096 Jun 9 20:17 .. -rwxr-xr-x 1 root root 8 Jun 9 19:04 guest_name -rwxr-xr-x 1 root root 9 Jun 9 19:04 guest_passwd -rwxr-xr-x 1 root root 10 Jun 9 19:04 guest_shell -rwxr-xr-x 1 root root 9 Jun 9 19:04 root_passwd

cigfthomas commented 3 years ago

this something specific to my laptop. I was able to set this up on another laptop (that I am moving to) so this is not worth pursuing. :)