spurin/diveintoansible-lab

not able to login to ansible-c

Closed this issue · 15 comments

not able to login to ansible-c

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/users/Goutham/diveintoansible-lab/config

Shared home directories

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

Hi @j2goutham,

Sorry to hear you’re having problems. Could you please try the Goutham in lowercase and then, follow this with the following commands from the c:\Users\Goutham directory -

docker-compose rm
docker-compose up

Then see if it’s accessible as the ansible user.

Some questions otherwise, did you install Docker Desktop or was it already installed?

Hi Spurin,

i tried using goutham in lower-case and then ran the docker command but unable to login to ansible-c getting it as incorrect password.

did you install Docker Desktop or was it already installed? - I installed the docker desktop

`# 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/users/goutham/diveintoansible-lab/config

Shared home directories

ANSIBLE_HOME=/host_mnt/c/users/goutham/diveintoansible-lab/ansible_home
`

yes i'm on windows10 and downloaded the repo

Thanks Spruin, please let me know the further steps as I'm stuck with learning activity

Hi @j2goutham

Could you please run the following command from a command prompt, and share the output please -

docker run -v /host_mnt/c:/test --rm spurin/diveintoansible:ubuntu ls /test

This command, will start a container, pass the volume mount of your C drive as /test to the image, the container will then list /test and afterwards, it's going to remove the container so it doesn't linger on your system (--rm)

I want to verify, that at a basic level, volume mounting is working as expected for you.

`C:\Users\Goutham\diveintoansible-lab\diveintoansible-lab>docker run -v /host_mnt/c:/test --rm spurin/diveintoansible:ubuntu ls /test
$Recycle.Bin
Bigdata-Documnets
Documents and Settings
Drivers
Intel
OneDriveTemp
One_plus
PerfLogs
Program Files
Program Files (x86)
ProgramData
Recovery
System Volume Information
Users
Windows
hiberfil.sys
pagefile.sys
swapfile.sys

C:\Users\Goutham\diveintoansible-lab\diveintoansible-lab>`

Okay, so this is positive, let's incrementally go through this with each command -

docker run -v /host_mnt/c/users:/test --rm spurin/diveintoansible:ubuntu ls /test
docker run -v /host_mnt/c/users/goutham:/test --rm spurin/diveintoansible:ubuntu ls /test
docker run -v /host_mnt/c/users/goutham/diveintoansible-lab:/test --rm spurin/diveintoansible:ubuntu ls /test

`C:\Users\Goutham\diveintoansible-lab\diveintoansible-lab>docker run -v /host_mnt/c/users:/test --rm spurin/diveintoansible:ubuntu ls /test
All Users
Default
Default User
Goutham
Public
desktop.ini
gj

C:\Users\Goutham\diveintoansible-lab\diveintoansible-lab>docker run -v /host_mnt/c/users/goutham:/test --rm spurin/diveintoansible:ubuntu ls /test
3D Objects
AppData
Application Data
Contacts
Cookies
Desktop
Documents
Downloads
EurekaLog
Favorites
IntelGraphicsProfiles
Links
Local Settings
MicrosoftEdgeBackups
Music
My Documents
NTUSER.DAT
NTUSER.DAT{2bdbd08b-e662-11ea-aa5f-9c2976daf123}.TM.blf
NTUSER.DAT{2bdbd08b-e662-11ea-aa5f-9c2976daf123}.TMContainer00000000000000000001.regtrans-ms
NTUSER.DAT{2bdbd08b-e662-11ea-aa5f-9c2976daf123}.TMContainer00000000000000000002.regtrans-ms
NetHood
OneDrive
Pictures
PrintHood
Recent
Saved Games
Searches
SendTo
Start Menu
Templates
Videos
diveintoansible-lab
ntuser.dat.LOG1
ntuser.dat.LOG2
ntuser.ini
ntuser.pol

C:\Users\Goutham\diveintoansible-lab\diveintoansible-lab>docker run -v /host_mnt/c/users/goutham/diveintoansible-lab:/test --rm spurin/diveintoansible:ubuntu ls /test
ansible_home
config
diveintoansible-lab

C:\Users\Goutham\diveintoansible-lab\diveintoansible-lab>`

Hi @j2goutham

I can see what the issue is. Annoyingly, when you extract the zip file on windows. You can end up with two directories depending on how you unzipped it. So for example, you have your main docker-compose.yaml file and the others in -

c:\Users\Goutham\diveintoansible-lab\diveintoansible-lab

Where as, it needs to be in -

c:\Users\Goutham\diveintoansible-lab

Can you please do the following -

  1. Inside c:\Users\Goutham\diveintoansible-lab\diveintoansible-lab (which should be the directory where your docker-compose.yaml file is, at the moment) run -
docker-compose rm
  1. Remove c:\Users\Goutham\diveintoansible-lab and all of it's contents

  2. Open the zip file again but, this time copy the directory so that are all of the files in the repo are structured like the following, i.e.

c:\Users\Goutham\diveintoansible-lab\.env
c:\Users\Goutham\diveintoansible-lab\config
c:\Users\Goutham\diveintoansible-lab\docker-compose.yaml

  1. Edit the c:\Users\Goutham\diveintoansible-lab\.env file and re-apply your configuration udates that you had above, i.e.
CONFIG=/host_mnt/c/users/goutham/diveintoansible-lab/config
ANSIBLE_HOME=/host_mnt/c/users/goutham/diveintoansible-lab/ansible_home
  1. From the directory, c:\Users\Goutham\diveintoansible-lab run the following -
docker-compose up

This time, I believe you should be able to log in as ansible

@j2goutham I've just updated the README.md in the repo to make these instructions more implicit, also.

thanks a lot Spruin.
it worked!!!!

Wonderful. Thanks @j2goutham for your patience and apologies that you had to encounter this issue. I'm going to also update the video to ensure that going forward, this doesn't happen.

Closing the issue