Giter VIP home page Giter VIP logo

diveintoansible-lab's Introduction

Dive Into Ansible Course Lab

Follow GitHub Stars

✨ This repository provides a local lab configuration for DiveInto.com's 'Dive Into Ansible' course ✨

The related code repository is available at - https://github.com/spurin/diveintoansible

The full video course relating to this lab is available on -

🆘 If you experience any problems with the lab or the course, please reach out to me direct, James Spurin, or flag an issue in the repositories. I'd much rather know about an issue and in doing so, help yourself and others who encounter similar problems, Thanks!

🚀 New Update: The diveintoansible-lab can now also be executed in the cloud using Google's Free Cloud Shell Tier. For this, a standard Google account is required. The lab setup process in Cloud Shell can be started with a single click and a setup tutorial will appear on the right hand side. Please see https://diveinto.com/p/playground

The steps that follow below are for a local running lab instance which is the recommend approach. Whilst the new Google Cloud Shell based lab is convenient and is great for spinning up an Ansible lab in a matter of minutes or for adhoc experimentation, a locally running lab has improved latency and you'll also benefit from data persistence (any custom playbooks you create will remain on your system between lab restarts) -

Installation of Docker and Docker-Compose

The lab environment, makes use of Docker with Docker Compose. If you're on Windows, Mac or a Linux Desktop, you can install the convenient Docker Desktop to make both Docker and Docker-Compose available.

Non Desktop based Linux Environments, will require a manual installation of Docker and Docker Compose. Be aware, installing docker-compose via apt or yum/dnf, you may result in the installation of an older version that is incompatible with the lab. It is recommended that you install the latest version. A standalone binary can be downloaded from the Github releases page.

Download and Preparation

I recommend that the lab environment is downloaded to your respective home directory, i.e. -

  • Mac - /Users/james/diveintoansible-lab
  • Windows - C:\Users\james\diveintoansible-lab
  • Linux - /home/james/diveintoansible-lab

Mac or Linux

You should be able to clone the repository accordingly from a terminal whilst in your home directory with the following command -

git clone https://github.com/spurin/diveintoansible-lab.git

Windows

If you don't have git installed, the lab can be downloaded using the following url - https://github.com/spurin/diveintoansible-lab/archive/master.zip

After unzipping the archive, you must ensure that a single diveintoansible-lab folder is copied into your home directory (not multiple folders, i.e. diveintoansible-lab-master/diveintoansible-lab or diveintoansible-lab/diveintoansible-lab). See the next section on Validation.

Validation (IMPORTANT)

Please verify that all of the lab files, are in the expected locations after either cloning, or extracting the zip file, for your corresponding OS and User. They should be similar to the following and all files should exist (the config files are required to setup the ansible user upon startup) -

Mac OS X

/Users/james/diveintoansible-lab/.env
/Users/james/diveintoansible-lab/DiveIntoAnsible_Cover.png
/Users/james/diveintoansible-lab/README.md
/Users/james/diveintoansible-lab/docker-compose.yaml
/Users/james/diveintoansible-lab/config/guest_name
/Users/james/diveintoansible-lab/config/guest_passwd
/Users/james/diveintoansible-lab/config/guest_shell
/Users/james/diveintoansible-lab/config/root_passwd

Windows

C:\Users\James\diveintoansible-lab\.env
C:\Users\James\diveintoansible-lab\DiveIntoAnsible_Cover.png
C:\Users\James\diveintoansible-lab\README.md
C:\Users\James\diveintoansible-lab\docker-compose.yaml
C:\Users\James\diveintoansible-lab\config\guest_name
C:\Users\James\diveintoansible-lab\config\guest_passwd
C:\Users\James\diveintoansible-lab\config\guest_shell
C:\Users\James\diveintoansible-lab\config\root_passwd

Linux

/home/james/diveintoansible-lab/.env
/home/james/diveintoansible-lab/DiveIntoAnsible_Cover.png
/home/james/diveintoansible-lab/README.md
/home/james/diveintoansible-lab/docker-compose.yaml
/home/james/diveintoansible-lab/config/guest_name
/home/james/diveintoansible-lab/config/guest_passwd
/home/james/diveintoansible-lab/config/guest_shell
/home/james/diveintoansible-lab/config/root_passwd

Running the lab

If you're running a modern version of Docker as supplied via Docker Desktop, you should use compose as a subcommand, for example - docker compose.

If you're running Docker via Linux and have downloaded the docker-compose binary direct, please use docker-compose.

You will then be able to run the equivalent in your command prompt or terminal, directly from the diveintoansible-lab directory.

docker compose up

If all goes well, it should start the lab environment. The lab is ready for use when you see text similar to the following -

Attaching to docker, centos1, ubuntu2, ubuntu3, centos2, centos3, ubuntu-c, ubuntu1, portal

Keep this terminal open and running whilst using the course. In your browser, then browse to http://localhost:1000 and you should get the lab interface. If you find that you cannot login to the Ansible control host (ubuntu-c) as ansible and the password of password, then there is a fault with your configuration. If this is the case, it is important to perform the following actions before troubleshooting or changing your configuration. Press CTRL-C, then run the following -

docker compose rm

Lab commands

To refresh the images with the latest course images -

docker compose pull

To remove the lab

docker compose rm

Container Sources for the Lab Images

The Dockerfiles used for the creation of these lab images are available from the following -


DiveIntoAnsible Cover

diveintoansible-lab's People

Contributors

ardillo avatar spurin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diveintoansible-lab's Issues

ansible/password not worked defaults after pulling the images from diveinto.io

i have checked my .env and it has correct config & ansible_home dir also ~/guest_name, guest_password has setup for ansible/password as suggested but it is taking the defaults user name and password in the images from the hub diveinto.io .

it is worked defaults with root/root and there were no users in the ansible controls host (ubuntu-c) node after logged in by root user.

Can't restart nging in Ansible Playbooks- Creating and Executing

I'm trying execute nginx_playbook.yaml from ~/diveintoansible/Ansible Playbooks, Introduction/Ansible Playbooks, Creating and Executing/solution/04 whit no changes and I got this output:

TASK [Restart Nginx] *****************************************************************************************************************************************************************************************************************************
fatal: [ubuntu1]: FAILED! => {"changed": false, "msg": "Service is in unknown state", "status": {}}
fatal: [centos2]: FAILED! => {"changed": false, "msg": "Service is in unknown state", "status": {}}
fatal: [centos3]: FAILED! => {"changed": false, "msg": "Service is in unknown state", "status": {}}
fatal: [centos1]: FAILED! => {"changed": false, "msg": "Service is in unknown state", "status": {}}
fatal: [ubuntu2]: FAILED! => {"changed": false, "msg": "Service is in unknown state", "status": {}}
fatal: [ubuntu3]: FAILED! => {"changed": false, "msg": "Service is in unknown state", "status": {}}

I don't know what is wrong. I tried start the service manually and it's work whit no issue

SSH key issue

I am having an SSH key issue with the setup. For some days after the Initial setup I had no issues with the lab but lately, I started getting Key related issues. Last time I cleaned up the keys and created a new key and distributed it across all the nodes. Then it went fine for few days again I am getting the same key error.

Any workaround for this issue?

==========================================
Warning: the ECDSA host key for 'ubuntu1' differs from the key for the IP address '172.18.0.8'
Offending key for IP in /home/ansible/.ssh/known_hosts:12
Matching host key in /home/ansible/.ssh/known_hosts:1
Warning: the ECDSA host key for 'ubuntu2' differs from the key for the IP address '172.18.0.9'
Offending key for IP in /home/ansible/.ssh/known_hosts:8
Matching host key in /home/ansible/.ssh/known_hosts:3
Warning: the ECDSA host key for 'centos1' differs from the key for the IP address '172.18.0.5'
Offending key for IP in /home/ansible/.ssh/known_hosts:6
Matching host key in /home/ansible/.ssh/known_hosts:7
Warning: the ECDSA host key for 'centos2' differs from the key for the IP address '172.18.0.3'
Offending key for IP in /home/ansible/.ssh/known_hosts:2
Matching host key in /home/ansible/.ssh/known_hosts:9
Are you sure you want to continue connecting (yes/no)? ubuntu3 | SUCCESS => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"},"changed": false,"ping": "pong"}
Warning: the ECDSA host key for 'centos3' differs from the key for the IP address '172.18.0.4'
Offending key for IP in /home/ansible/.ssh/known_hosts:4
Matching host key in /home/ansible/.ssh/known_hosts:11
Are you sure you want to continue connecting (yes/no)?

ssh still requesting pwd after sharing public keys

Hello James,

I'm using docker in Windows 10. I've deployed the lab environment as described and it looks working fine.
Nevertheless after copying the public key from ubuntu-c to the authorized_keys file of ubuntu1 when doing ssh the pwd is still being requested:

ansible@ubuntu-c:$ ssh ansible@ubuntu1
ansible@ubuntu1's password:
Last login: Mon Dec 21 09:39:51 2020 from 172.18.0.9
ansible@ubuntu1:
$ cd .ssh/
ansible@ubuntu1:/.ssh$ ll
total 5
drwxrwxrwx 1 ansible ansible 0 Dec 21 09:59 ./
drwxrwxrwx 1 root root 4096 Dec 21 10:57 ../
-rwxr-xr-x 1 ansible ansible 570 Dec 21 09:39 authorized_keys*
ansible@ubuntu1:
/.ssh$ cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDP1bpGcNM+M0BuX+jFYQdpHPdJev9IlnWt14JxAqLulpgAumxTTG2NYrx6XaWYmUUyq1x10uLHX6QGLS5rqcvttOU/rQLlCVLdoB/ATWJa+k9x71Y5ocfvp7uMMz8VMdPitOEojcFoF6EK+Few08ArYduN5O51LZmbDAFvIKEDUr3vBWdorSk+xwS3dXnDQvdu3tL0Kj+xum3rGyurl9QqWmtWaqdueKFO1C9okOcLjwGy6+72yIJ1QOVr6hcrEyMbhbytIIXmqaQHvdKbxvoNLqJsWlJ0If/QNqdVko/WFc/ll27m2Bevh8aas6MNjdrP0H7vatjvEB4Crt6/U+Fr2XOlwzF9FlJDIxIX6w4ouvRUKiwOXNpCkhOZj4AuMeoiYnWVBzV0J2AZh3ltb+E7bUnmlrPVDTveJA9QumlKslR8UxSrBMp9mSof8dywo6WgM+oDbgJkXBpZkKdy9V+ToHSRzWBdwgHmMv82axoKLsujQGD3Hdyb8SFzmP6/nls= ansible@ubuntu-c
ansible@ubuntu1:/.ssh$ exit
logout
Connection to ubuntu1 closed.
ansible@ubuntu-c:
$ cd .ssh/
ansible@ubuntu-c:/.ssh$ ll
total 13
drwxrwxrwx 1 ansible ansible 4096 Dec 21 09:39 ./
drwxrwxrwx 1 root root 4096 Jan 12 10:58 ../
-rwxr-xr-x 1 ansible ansible 2602 Dec 21 09:37 id_rsa*
-rwxr-xr-x 1 ansible ansible 570 Dec 21 09:37 id_rsa.pub*
-rwxr-xr-x 1 ansible ansible 444 Dec 21 09:39 known_hosts*
ansible@ubuntu-c:
/.ssh$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDP1bpGcNM+M0BuX+jFYQdpHPdJev9IlnWt14JxAqLulpgAumxTTG2NYrx6XaWYmUUyq1x10uLHX6QGLS5rqcvttOU/rQLlCVLdoB/ATWJa+k9x71Y5ocfvp7uMMz8VMdPitOEojcFoF6EK+Few08ArYduN5O51LZmbDAFvIKEDUr3vBWdorSk+xwS3dXnDQvdu3tL0Kj+xum3rGyurl9QqWmtWaqdueKFO1C9okOcLjwGy6+72yIJ1QOVr6hcrEyMbhbytIIXmqaQHvdKbxvoNLqJsWlJ0If/QNqdVko/WFc/ll27m2Bevh8aas6MNjdrP0H7vatjvEB4Crt6/U+Fr2XOlwzF9FlJDIxIX6w4ouvRUKiwOXNpCkhOZj4AuMeoiYnWVBzV0J2AZh3ltb+E7bUnmlrPVDTveJA9QumlKslR8UxSrBMp9mSof8dywo6WgM+oDbgJkXBpZkKdy9V+ToHSRzWBdwgHmMv82axoKLsujQGD3Hdyb8SFzmP6/nls= ansible@ubuntu-c

I've read that the issue could be regarding the .ssh/ permissions. When trying to change them in ubuntu-c and ubuntu1 hosts, the command didn't product any effect on the files:

ansible@ubuntu-c:/.ssh$ chmod 700 id_rsa
ansible@ubuntu-c:
/.ssh$ ll
total 13
drwxrwxrwx 1 ansible ansible 4096 Dec 21 09:39 ./
drwxrwxrwx 1 root root 4096 Jan 12 10:58 ../
-rwxr-xr-x 1 ansible ansible 2602 Dec 21 09:37 id_rsa*
-rwxr-xr-x 1 ansible ansible 570 Dec 21 09:37 id_rsa.pub*
-rwxr-xr-x 1 ansible ansible 444 Dec 21 09:39 known_hosts*

I tried to find a solution for the permissions issue but after reading in many places I'm stuck here.

Could you please help me?

Thanks a lot for your time.

Unable to login to ubuntu-c

Hi There,

I have tried all the user name password combination of ansible and password but I am unable to login. Below attached is my env file. I have also run and modified the env file after running docker-compose rm and docker-compose up but still no luck. Any assistance would be appreaciated.
image

README Windows config needs clarification

In the below, there are a couple of items that can use some clarification.

  1. What does n.b. stand for??
  2. The windows CONFIG and ANSIBLE_HOME values are confusing. What is /host_mnt? From the course video I understand that host_mnt is just an incantation used by Ansible, but it would be great if this could be explained in the readme, since it was mentioned to refer to the readme in case the video becomes out of date. Something like

Note: Ansible requires these entries to be Unix style paths, beginning with /host_mnt/

Windows (**n.b.** 'users' and the username (in my case this is james) are in lowercase, this is important) -
# Shared config volume
CONFIG=/**host_mnt**/c/users/james/diveintoansible-lab/config

# Shared home directories
ANSIBLE_HOME=/**host_mnt**/c/users/james/diveintoansible-lab/ansible_home

Downloading "dind" gets hanging (waiting stage)

$ docker-compose up -d ;
Docker Compose is now in the Docker CLI, try `docker compose up`

Pulling docker (spurin/diveintoansible:dind)...
dind: Pulling from spurin/diveintoansible
ba3557a56b15: Pull complete
94caa5d1da70: Pull complete
a10a29983da5: Pull complete
3d6ccddb7fa4: Pull complete
ed1bef566495: Pull complete
201a9d1142eb: Pull complete
0806b78d1f4d: Pull complete
7487d64c1d39: Pull complete
3803ba42d066: Waiting

Problem trying to login into ubuntu-c

I have done all of the steps and even checked the config file to make sure that I am typing the user name and password correctly but I have had no success. I have also done the docker-compose rm command and updated the configuration and re-ran the docker-compose up command. I created an ansible_home folder as well but i am still unable to login into ubuntu-c. Please assist.

docker-compose up needs port 1000 (privileged port)

People will get an error as i did on Ubuntu 20 LTS. What they need to do is:

Exposing privileged ports
To expose privileged ports (< 1024), set CAP_NET_BIND_SERVICE on rootlesskit binary.

sudo setcap cap_net_bind_service=ep $HOME/bin/rootlesskit
Or add net.ipv4.ip_unprivileged_port_start=0 to /etc/sysctl.conf (or /etc/sysctl.d) and run sudo sysctl --system.

portal | 2021/03/14 10:09:21 [emerg] 72#72: io_setup() failed (38: Function not implemented)

Hii James,
I am facing issues while running docker-compose up.

(base) rohitraj@Rohits-MacBook-Air diveintoansible-lab % docker-compose up
Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/
Starting ubuntu-c ... done
Starting centos3 ... done
Starting ubuntu1 ... done
Starting centos1 ... done
Starting docker ... done
Starting centos2 ... done
Starting ubuntu2 ... done
Starting ubuntu3 ... done
Starting portal ... done
Attaching to centos3, centos2, ubuntu1, ubuntu3, docker, centos1, ubuntu-c, ubuntu2, portal
portal | 2021/03/14 10:09:21 [emerg] 72#72: io_setup() failed (38: Function not implemented)
docker exited with code 1

Details regarding docker and docker-compose version
(base) rohitraj@Rohits-MacBook-Air ~ % docker --version
Docker version 20.10.3, build 48d30b5
(base) rohitraj@Rohits-MacBook-Air ~ % docker-compose --version
docker-compose version 1.28.2, build 67630359
(base) rohitraj@Rohits-MacBook-Air ~ % docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e4f572cf10f6 spurin/diveintoansible:portal "/docker-entrypoint.…" 8 minutes ago Up 4 minutes 0.0.0.0:1000->80/tcp portal
ccd46ef78678 spurin/diveintoansible:centos "/usr/lib/systemd/sy…" 8 minutes ago Up 4 minutes 0.0.0.0:2226->22/tcp, 0.0.0.0:7686->7681/tcp centos2
76b87ad5babf spurin/diveintoansible:ubuntu "/lib/systemd/systemd" 8 minutes ago Up 4 minutes 0.0.0.0:2224->22/tcp, 0.0.0.0:7684->7681/tcp ubuntu3
1b4af57350b8 spurin/diveintoansible:ubuntu "/lib/systemd/systemd" 8 minutes ago Up 4 minutes 0.0.0.0:2222->22/tcp, 0.0.0.0:7682->7681/tcp ubuntu1
8f700ae3f960 spurin/diveintoansible:centos "/usr/lib/systemd/sy…" 8 minutes ago Up 4 minutes 0.0.0.0:2225->22/tcp, 0.0.0.0:7685->7681/tcp centos1
e1027e4870ad spurin/diveintoansible:ubuntu "/lib/systemd/systemd" 8 minutes ago Up 4 minutes 0.0.0.0:2223->22/tcp, 0.0.0.0:7683->7681/tcp ubuntu2
8fad1784bd43 spurin/diveintoansible:centos "/usr/lib/systemd/sy…" 8 minutes ago Up 4 minutes 0.0.0.0:2227->22/tcp, 0.0.0.0:7687->7681/tcp centos3
68bd6d92d6f2 spurin/diveintoansible:ansible "/lib/systemd/systemd" 8 minutes ago Up 4 minutes 0.0.0.0:7681->7681/tcp, 0.0.0.0:2221->22/tcp ubuntu-c
(base) rohitraj@Rohits-MacBook-Air ~ %

Kindly help.
Thanks

Unable to Login with user:ubuntu password:password

Hello Spurin,

I tried changing the path within .env to one instructed in README but was again unable to login, with username ansible and the password as password

Sharing the details of my system below for your perusal:

  • Host OS - Windows 10
  • Guest Os - Ubuntu20.04 (WSL2 aka Windows Subsystem Linux 2)

Previously I had cloned the repo within my WSL2 Ubuntu20.04 OS but made the below changes to the .env file

WSL_ Ubuntu-20 04 -VisualStudioCode

But still getting login error as shared below:
FailedLoginUbuntu-c

In my next attempt, I cloned the repo to
diveintoansible-lab

and

made the following changes to the .env file

Shared config volume

CONFIG=/mnt/c/Users/demo_user/diveintoansible-lab/ansible_home

Shared home directories

ANSIBLE_HOME=/mnt/c/Users/demo_user/diveintoansible-lab/ansible_home

But still no luck. Requesting you to help me out to resolve this issue, please. Thanks

Cannot browse to http://localhost:1000

Hello again,

I'm reaching out as I was able to the run of the lab but only partially. I am unable to reach the website http://localhost:1000 when attempted and receive an error that the page cannot be found.

felixmajor@Felixs-MacBook-Pro diveintoansible-lab % docker-compose up
[+] Running 11/11
⠿ Network diveinto.io Created 3.8s
⠿ Network diveintoansible-lab_default Created 3.8s
⠿ Container ubuntu1 Created 1.1s
⠿ Container centos1 Created 1.1s
⠿ Container ubuntu-c Created 1.0s
⠿ Container docker Created 1.2s
⠿ Container centos2 Created 0.9s
⠿ Container ubuntu2 Created 1.1s
⠿ Container ubuntu3 Created 1.1s
⠿ Container centos3 Created 1.1s
⠿ Container portal Created 0.6s
Attaching to centos1, centos2, centos3, docker, portal, ubuntu-c, ubuntu1, ubuntu2, ubuntu3

After confirming that this step should look as the guide provides, I figured I'd circle back to see if there is anything I need to do to initiate the resolution to this.

Thank you,

Flex

portal | nginx: [emerg] host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46

Hi James,

The docker-compose is failing with :

[kb@x1 diveintoansible-lab]$ docker-compose up
Building with native build. Learn about native build in Compose here: https://docs.docker.com/go/compose-native-build/
Creating centos3 ... done
Creating ubuntu3 ... done
Creating centos2 ... done
Creating ubuntu2 ... done
Creating ubuntu-c ... done
Creating docker ... done
Creating ubuntu1 ... done
Creating centos1 ... done
Creating portal ... done
Attaching to centos3, centos2, ubuntu2, centos1, ubuntu3, docker, ubuntu-c, ubuntu1, portal
ubuntu2 exited with code 255
ubuntu-c exited with code 255
ubuntu3 exited with code 255
ubuntu1 exited with code 255
portal | 2021/01/31 18:42:07 [emerg] 1#1: host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
portal | nginx: [emerg] host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
portal exited with code 1

Version of docker and docker-compose :

[kb@x1 diveintoansible-lab]$ docker version
Client: Docker Engine - Community
 Version:           20.10.2
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        2291f61
 Built:             Mon Dec 28 16:18:28 2020
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.2
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8891c58
  Built:            Mon Dec 28 16:15:41 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

[kb@x1 diveintoansible-lab]$ docker-compose version
docker-compose version 1.28.2, build 67630359
docker-py version: 4.4.1
CPython version: 3.7.9
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

The docker compose setup seems to never be completed.

~ ansible (master *=) $ docker-compose up ;
Docker Compose is now in the Docker CLI, try `docker compose up`

Creating network "diveinto.io" with the default driver
Pulling ubuntu-c (spurin/diveintoansible:ansible)...
ansible: Pulling from spurin/diveintoansible
5d3b2c2d21bb: Pull complete
3fc2062ea667: Pull complete
75adf526d75b: Pull complete
e339760bac62: Pull complete
8ad8c7b7fa7b: Pull complete
3bb6a137e325: Pull complete
6532536d6bc2: Pull complete
9a9c0eb2ea70: Pull complete
4137c2b32ea4: Pull complete
e48f12d1dc21: Pull complete
0d3b4350af8a: Pull complete
3a75fb0366e3: Pull complete
4c107a58d19e: Pull complete
7c640152e81a: Pull complete
6cf44857584d: Pull complete
3a34c2528018: Pull complete
f894ffefa016: Pull complete
232302f36bf7: Pull complete
6c992b5ac2d4: Pull complete
bb3d24d53ab8: Pull complete
9adcb890eee6: Pull complete
22d5107aa0e5: Pull complete
ff2c1289b326: Pull complete
e528502cdd79: Pull complete
72aa8134d01d: Pull complete
Digest: sha256:1f6c2140403cd5b16a774c7f84e1eb94bb0eb55a10d0aa34c0df3af4673e6fc5
Status: Downloaded newer image for spurin/diveintoansible:ansible
Pulling ubuntu1 (spurin/diveintoansible:ubuntu)...
ubuntu: Pulling from spurin/diveintoansible
5d3b2c2d21bb: Already exists
3fc2062ea667: Already exists
75adf526d75b: Already exists
e339760bac62: Already exists
8ad8c7b7fa7b: Already exists
3bb6a137e325: Already exists
6532536d6bc2: Already exists
9a9c0eb2ea70: Already exists
4137c2b32ea4: Already exists
e48f12d1dc21: Already exists
0d3b4350af8a: Already exists
3a75fb0366e3: Already exists
4c107a58d19e: Already exists
7c640152e81a: Already exists
6cf44857584d: Already exists
3a34c2528018: Already exists
f894ffefa016: Already exists
a9cf06fa295f: Pull complete
0e74c8266ab6: Pull complete
238a3e65ef4c: Pull complete
408e1bbc82ec: Pull complete
f4c3c9fcf327: Pull complete
570a11145e41: Pull complete
Digest: sha256:298fbe61ecd8a64befade9eca6d3c4f25e3456610b6a8d1089bbc1bb3204ea17
Status: Downloaded newer image for spurin/diveintoansible:ubuntu
Pulling centos1 (spurin/diveintoansible:centos)...
centos: Pulling from spurin/diveintoansible
7a0437f04f83: Pull complete
cf83964885fa: Pull complete
f4744ad0a4ea: Pull complete
4ba305f74535: Pull complete
02fa94a92434: Pull complete
6ce61af718a6: Pull complete
c66795ead3c6: Pull complete
8b43e21f63a5: Pull complete
de112777223f: Pull complete
9ccfe64c4750: Pull complete
fd1752c8a3ce: Pull complete
803d902310ce: Pull complete
db2e3b4e6fb9: Pull complete
b79a8c79c185: Pull complete
2b2d9c5c665f: Pull complete
dcde7528f057: Pull complete
f7ea90ee9b0b: Pull complete
05215915c7a4: Pull complete
b55deb2f7b84: Pull complete
6848c5120027: Pull complete
c806c1eb0cad: Pull complete
1e7898b3f2d0: Pull complete
60f557c24918: Pull complete
Digest: sha256:feacec0a3f62489e086021c2184f0398360cb85795ef039502fcba2155e5cec4
Status: Downloaded newer image for spurin/diveintoansible:centos
Pulling docker (spurin/diveintoansible:dind)...
dind: Pulling from spurin/diveintoansible
ba3557a56b15: Pull complete
94caa5d1da70: Pull complete
a10a29983da5: Pull complete
3d6ccddb7fa4: Pull complete
ed1bef566495: Pull complete
201a9d1142eb: Pull complete
0806b78d1f4d: Pull complete
7487d64c1d39: Pull complete
3803ba42d066: Pull complete
3b73e0fabdc0: Pull complete
5243cc195ad1: Pull complete
79d36018d4a9: Pull complete
c4fbbab13042: Pull complete
Digest: sha256:13df3e0405efac005143305fef876e4071067ece61495eac92f3f0bd407cd49d
Status: Downloaded newer image for spurin/diveintoansible:dind
Pulling portal (spurin/diveintoansible:portal)...
portal: Pulling from spurin/diveintoansible
75646c2fb410: Pull complete
6128033c842f: Pull complete
71a81b5270eb: Pull complete
b5fc821c48a1: Pull complete
da3f514a6428: Pull complete
3be359fed358: Pull complete
e929c3b67e96: Pull complete
ff591297d60d: Pull complete
2ebe35a09969: Pull complete
Digest: sha256:7836d47176865e0314caaa6ecff920f5b923daac1d5f45d105c5eb2cf60a076e
Status: Downloaded newer image for spurin/diveintoansible:portal
Creating ubuntu3  ... done
Creating docker   ... done
Creating centos2  ... done
Creating centos3  ... done
Creating ubuntu2  ... done
Creating ubuntu-c ... done
Creating centos1  ... done
Creating ubuntu1  ... done
Creating portal   ... done
Attaching to docker, centos1, centos3, ubuntu1, ubuntu-c, ubuntu2, centos2, ubuntu3, portal
...

[Enh Req] Open Terminals in new browser tab!

Quite a simple request here... request pretty much explains it!

Would be nice to have the terminal sessions, listed on the portal 'home page', open in different web tabs. That way when\if i want to navigate back to the portal for any reason (maybe course links & resources), I don't have to disconnect from my existing terminal session.

While I know I could just open the portal in a new tab itself... this is more of a 'quality of life' tweak.

Thanks.

://mk

Ubuntu containers exit with error 255 on Windows 10

I have attempted to deploy the Ansible Lab under Windows 10 with Docker Desktop 3.5.2.

When executing docker-compose up on WSL2 all Ubuntu containers fail with error code 255.
All CentOS containers start successfully.
If I attempt to run the Ubuntu container with docker run it starts without issues.

Unfortunately docker-compose does not provide any additional output other than the error codes.

Ubuntu Linux credentials

My .env file has been modified to match my username and I have docker and docker compose installed. I'm able to make it to the Ansible lab screen when I browse to http://localhost:1000 but when I attempt to log into ubuntu-c with ansible and password, the credentials don't work. Any assistance would be greatly appreciated.
2020-12-16_17-45
2020-12-16_17-47

Destination /shared not writable

James, great video series! I ran into this problem in the third lab for Docker with Ansible:

ansible@ubuntu-c:~/diveintoansible/Using Ansible with Cloud Services and Containers/Docker with Ansible/03$ ansible-playbook docker_playbook.yaml

...

TASK [Create a customised Dockerfile] ********************************************************************************************************************************************************************************
fatal: [ubuntu-c]: FAILED! => {"changed": false, "checksum": "df46ab11fcbec01158f33fc1e3b2dcf7b8d326c8", "msg": "Destination /shared not writable"}

I did not do a lot of debugging to see if I'd messed up along the way. I simply 'chmod 777 /shared' and kept moving. Not sure if this is really a problem or if anyone else has encountered the same thing.

--Regards, Jeff

Cannot login into the ubuntu-c when run on a Docker-Desktop on windows 10.

Hi,

I have installed Docker Desktop on Windows 10. When I run the "docker compose up" command, the containers start as usual, I am able to launch the portal at http://localhost:1000/ However when I try to login to ubuntu-c, it says that the credentials are incorrect. I am using user as "ansible" and password as "password".

My Docker desktop is running on wsl2. When I launch WSL it drops me in to an Ubuntu shell. Below are the steps that I performed.

  1. Clone the repo at /mnt/c/Users/Administrator/
  2. drop into the folder diveintoansible-lab/ and make a new directory "/mnt/c/Users/Administrator/diveintoansible-lab/ansible_home"
  3. edit the .env file as shown below.

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=/mnt/c/Users/Administrator/diveintoansible-lab/config

Shared home directories

ANSIBLE_HOME=/mnt/c/Users/Administrator/diveintoansible-lab/ansible_home

  1. Open an elevated PowerShell session and drop into the folder "C:\Users\Administrator\diveintoansible-lab"
  2. Run "docker compose up"
  3. Once the containers are up and running, I launch http://localhost:1000 but the login always fails.
    <#
    ubuntu-c login: ansible
    Password:

Login incorrect
ubuntu-c login:
#>

I have also tried the same procedure without creating ansible_home folder but it yields same failures.

Please assist.

I cannot start the portal, docker-up returns host not found in upstream ubuntu1, Debian Bullseye

anshad666@debian:~/diveintoansible-lab$ docker-compose up
Recreating ubuntu-c ... done
Recreating centos1  ... done
Recreating centos2  ... done
Recreating ubuntu1  ... done
Recreating centos3  ... done
Recreating ubuntu2  ... done
Recreating docker   ... done
Recreating ubuntu3  ... done
Recreating portal   ... done
Attaching to ubuntu3, ubuntu2, ubuntu-c, ubuntu1, docker, centos2, centos3, centos1, portal
ubuntu-c exited with code 255
ubuntu1 exited with code 255
ubuntu2 exited with code 255
portal      | 2021/05/11 07:54:01 [emerg] 1#1: host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
portal      | nginx: [emerg] host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
ubuntu3 exited with code 255
portal exited with code 1

Section 5.19, part 6

From all indications Nginx was not installed on Ubuntu3 nor Centos3. Did I miss a step to install them?

I installed it manually, and then it worked

  • I use zsh for my shell, so it looks a bit different

image

Idea: Accessing Portal / Terminals not from localhost

Hey James, great course so far, thanks for this.

Would it be possible to make the Terminals in the portal accessible even If you dont access it via localhost, e.g. from an IP? I run the docker compose in a linux vm without desktop GUI!

Regards,
Dominik

ERROR: Head https://registry-1.docker.io/v2/spurin/diveintoansible/manifests/ansible: unauthorized: incorrect username or password

Issues with the docker compose up
vi .env:

`# Shared config volume
CONFIG=/Users/igor.marinho/diveintoansible-lab/config

Shared home directories

ANSIBLE_HOME=/Users/igor.marinho/diveintoansible-lab/ansible_home
~ `

igor.marinho@mac config % pwd /Users/igor.marinho/diveintoansible-lab/config igor.marinho@mac config %

`igor.marinho@mac config % ls -ltr

-rwxrwxr-x 1 igor.marinho staff 8 19 Mar 14:57 guest_name
-rwxrwxr-x 1 igor.marinho staff 9 19 Mar 14:57 guest_passwd
-rwxrwxr-x 1 igor.marinho staff 10 19 Mar 14:57 guest_shell
-rwxrwxr-x 1 igor.marinho staff 9 19 Mar 14:57 root_passwd

igor.marinho@mac config % `

ERROR: Head https://registry-1.docker.io/v2/spurin/diveintoansible/manifests/ansible: unauthorized: incorrect username or password

If you upgrade Docker on a Mac - you may get some odd issues with the docker-compose up

Here were my initial results:


docker-compose up

Creating network "diveinto.io" with the default driver
Pulling ubuntu-c (spurin/diveintoansible:ansible)...
Traceback (most recent call last):
  File "site-packages/docker/credentials/store.py", line 80, in _execute
  File "subprocess.py", line 411, in check_output
  File "subprocess.py", line 512, in run
subprocess.CalledProcessError: Command '['/usr/local/bin/docker-credential-desktop', 'get']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "site-packages/docker/auth.py", line 264, in _resolve_authconfig_credstore
  File "site-packages/docker/credentials/store.py", line 35, in get
  File "site-packages/docker/credentials/store.py", line 93, in _execute
docker.credentials.errors.StoreError: Credentials store docker-credential-desktop exited with "No stored credential for https://index.docker.io/v1/".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose/cli/main.py", line 67, in main
  File "compose/cli/main.py", line 126, in perform_command
  File "compose/cli/main.py", line 1070, in up
  File "compose/cli/main.py", line 1066, in up
  File "compose/project.py", line 615, in up
  File "compose/service.py", line 356, in ensure_image_exists
  File "compose/service.py", line 1267, in pull
  File "compose/progress_stream.py", line 99, in get_digest_from_pull
  File "compose/service.py", line 1234, in _do_pull
  File "site-packages/docker/api/image.py", line 396, in pull
  File "site-packages/docker/auth.py", line 48, in get_config_header
  File "site-packages/docker/auth.py", line 324, in resolve_authconfig
  File "site-packages/docker/auth.py", line 235, in resolve_authconfig
  File "site-packages/docker/auth.py", line 281, in _resolve_authconfig_credstore
docker.errors.DockerException: Credentials store error: StoreError('Credentials store docker-credential-desktop exited with "No stored credential for https://index.docker.io/v1/".')
[96158] Failed to execute script docker-compose

I upgraded Docker Desktop to this build. I was on a v2 build before this. v3 release now...
Screenshot 2021-01-13 at 14 51 37

I read about things in this related post
https://github.com/shin-/dockerpy-creds/issues/13

And similar stuff here
docker/for-mac#3785

Initially my ~/.docker/config.json looked like this:

Screenshot 2021-01-13 at 13 20 42

I tried running docker logout and docker login, thinking there were some caching issues.
When I tried to login again initially I got some bizarre exception:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x46742b4]

so I renamed ~/.docker/config.json to ~/.docker/config.json-old

Then when I tried docker login again I was prompted for credentials:
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.

So I did that. It appears there's a free subscription for pull requests:

When I reran docker-compose up this time everything worked fine.
I'll also note, a ~/.docker/config.json was recreated with the following content

Screenshot 2021-01-13 at 15 07 54

You will notice the auths and credsStore key/value pairs look quite different now!

Hope this helps anyone else caught in the Mac/Docker upgrade (I was on Mojave 10.14.6 - and all the Docker App Contents and usr/local/bin symlinks were fine (you may see this in other posts)

WSL2 docker for windows / docker-compose up issues

Hi!

this is my .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=/home/{{user}}/diveintoansible-lab

# Shared home directories
ANSIBLE_HOME=/home/{{user}}/.ansible`

This is the output of docker-compose up command:

`docker-compose up
Creating network "diveinto.io" with the default driver
Creating ubuntu-c ... done
Creating centos3  ... done
Creating ubuntu1  ... done
Creating ubuntu2  ... done
Creating centos2  ... done
Creating docker   ... done
Creating centos1  ... done
Creating ubuntu3  ... done
Creating portal   ... done
Attaching to centos3, ubuntu-c, centos2, ubuntu1, ubuntu2, docker, ubuntu3, centos1, portal
ubuntu-c exited with code 255
ubuntu1 exited with code 255
ubuntu2 exited with code 255
ubuntu3 exited with code 255
portal      | 2020/12/18 17:51:29 [emerg] 1#1: host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
portal      | nginx: [emerg] host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
portal exited with code 1

Given that the autocreate dirs feature for bind volumes is deprecated, I created dirs manually just in case, with these commands:
docker/compose#2781

`mkdir -p ~/.ansible/ubuntu[1,2,3]
mkdir -p ~/.ansible/centos[1,2,3]
mkdir -p ~/.ansible/ubuntu-c
mkdir -p ~/.ansible/shared

ls -la ~/.ansible/
total 40
drwxr-xr-x  4 root  root  4096 Dec 18 18:16 centos1
drwxr-xr-x  4 root  root  4096 Dec 18 18:16 centos2
drwxr-xr-x  4 root  root  4096 Dec 18 18:16 centos3
drwxr-xr-x  2 root  root  4096 Dec 18 18:16 shared
drwxr-xr-x  4 root  root  4096 Dec 18 18:16 ubuntu-c
drwxr-xr-x  4 root  root  4096 Dec 18 18:16 ubuntu1
drwxr-xr-x  4 root  root  4096 Dec 18 18:16 ubuntu2
drwxr-xr-x  4 root  root  4096 Dec 18 18:16 ubuntu3
`
Client: Docker Engine - Community
 Cloud integration: 1.0.2
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 17:02:36 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:07:04 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

lsb_release -d
Description:    Ubuntu 20.04.1 LTS

docker-compose --version
docker-compose version 1.27.4, build 40524192

Still I couldn't make it work. Any suggestions?, centos images run but ubuntu ones don't. I also checked the layers but I really couldn't find what is happening.
https://hub.docker.com/layers/spurin/diveintoansible/ubuntu/images/sha256-3ee94e9bffdb108bc1c34b78558a415a0690779082d8edb15b59b952f0691b76?context=explore

Thanks in advance, and hope this helps others.

Facing with exceptions while running docker-compose up in windows command prompt

C:\Users\miriyala\diveintoansible-lab>docker-compose up
Traceback (most recent call last):
File "docker\api\client.py", line 214, in _retrieve_server_version
File "docker\api\daemon.py", line 181, in version
File "docker\utils\decorators.py", line 46, in inner
File "docker\api\client.py", line 237, in _get
File "requests\sessions.py", line 543, in get
File "requests\sessions.py", line 530, in request
File "requests\sessions.py", line 643, in send
File "requests\adapters.py", line 439, in send
File "urllib3\connectionpool.py", line 670, in urlopen
File "urllib3\connectionpool.py", line 392, in _make_request
File "http\client.py", line 1255, in request
File "http\client.py", line 1301, in _send_request
File "http\client.py", line 1250, in endheaders
File "http\client.py", line 1010, in _send_output
File "http\client.py", line 950, in send
File "docker\transport\npipeconn.py", line 32, in connect
File "docker\transport\npipesocket.py", line 23, in wrapped
File "docker\transport\npipesocket.py", line 72, in connect
File "docker\transport\npipesocket.py", line 52, in connect
pywintypes.error: (2, 'CreateFile', 'The system cannot find the file specified.')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "docker-compose", line 3, in
File "compose\cli\main.py", line 81, in main
File "compose\cli\main.py", line 199, in perform_command
File "compose\cli\command.py", line 60, in project_from_options
File "compose\cli\command.py", line 152, in get_project
File "compose\cli\docker_client.py", line 41, in get_client
File "compose\cli\docker_client.py", line 170, in docker_client
File "docker\api\client.py", line 197, in init
File "docker\api\client.py", line 221, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: (2, 'CreateFile', 'The system cannot find the file specified.')
[25332] Failed to execute script docker-compose

miriyala@SCEOV4UMNB MINGW64 ~/diveintoansible-lab (master)
$ cat .env

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

Shared home directories

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

Cannot run lab. Fedora 32

@spurin
I'm trying to run the lab, but it's giving me some errors on the ubuntu containers... please Help

➜  diveintoansible-lab (mine) ✔ docker-compose up
Creating ubuntu-c ... done
Creating centos1  ... done
Creating ubuntu1  ... done
Creating docker   ... done
Creating centos3  ... done
Creating ubuntu2  ... done
Creating centos2  ... done
Creating ubuntu3  ... done
Creating portal   ... done
Attaching to ubuntu-c, centos1, docker, centos3, ubuntu3, centos2, ubuntu1, ubuntu2, portal
ubuntu-c exited with code 255
ubuntu1 exited with code 255
ubuntu3 exited with code 255
ubuntu2 exited with code 255
portal      | 2021/04/19 19:07:52 [emerg] 1#1: host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
portal      | nginx: [emerg] host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
portal exited with code 1

I have done the respective changes to the config file

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=/home/ely/diveintoansible-lab/config                                                                                                                 
                                                                                                                                                              
  # Shared home directories                                                                                                                                   
  ANSIBLE_HOME=/home/ely/diveintoansible-lab/ansible_home  

Heres is the folder structure after I bring compose up

➜  diveintoansible-lab (mine) ✔ ls -lhat                
total 192K
drwx------. 47 ely  ely  4.0K Apr 19 13:08 ..
drwxr-xr-x.  8 ely  ely  4.0K Apr 19 13:08 .git
-rw-r--r--.  1 ely  ely   515 Apr 19 13:04 .env
drwxr-xr-x. 10 root root 4.0K Apr 19 12:27 ansible_home
drwxr-xr-x.  5 ely  ely  4.0K Apr 19 12:27 .
drwxr-xr-x.  2 ely  ely  4.0K Apr 19 11:46 config
-rw-r--r--.  1 ely  ely  4.0K Apr 19 11:46 docker-compose.yaml
-rwxr-xr-x.  1 ely  ely  5.8K Apr 19 11:46 README.md
-rw-r--r--.  1 ely  ely  156K Apr 19 11:46 DiveIntoAnsible_Cover.png

Compose and Docker versions :

➜  diveintoansible-lab (mine) ✔ docker --version
Docker version 20.10.6, build 370c289
➜  diveintoansible-lab (mine) ✔ docker-compose --version
docker-compose version 1.29.1, build c34c88b2

SSHD

Hello! I'm able to connect via the webrowser connecting to the localhost. How would I manage to use ssh if I didn't want to use the web browser? Sorry, I'm still new getting used to terminal commands. Also, this is on macOSX.
Screen Shot 2021-07-24 at 4 19 39 PM

Failed to execute script docker-compose

Here my .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/users/james/diveintoansible-lab/config

Shared home directories

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

===================================================================================

And here is the output after running the docker-compose up command

$ docker-compose up
Traceback (most recent call last):
File "docker\api\client.py", line 214, in _retrieve_server_version
File "docker\api\daemon.py", line 181, in version
File "docker\utils\decorators.py", line 46, in inner
File "docker\api\client.py", line 237, in _get
File "requests\sessions.py", line 543, in get
File "requests\sessions.py", line 530, in request
File "requests\sessions.py", line 643, in send
File "requests\adapters.py", line 439, in send
File "urllib3\connectionpool.py", line 670, in urlopen
File "urllib3\connectionpool.py", line 392, in _make_request
File "http\client.py", line 1255, in request
File "http\client.py", line 1301, in _send_request
File "http\client.py", line 1250, in endheaders
File "http\client.py", line 1010, in _send_output
File "http\client.py", line 950, in send
File "docker\transport\npipeconn.py", line 32, in connect
File "docker\transport\npipesocket.py", line 23, in wrapped
File "docker\transport\npipesocket.py", line 72, in connect
File "docker\transport\npipesocket.py", line 52, in connect
pywintypes.error: (2, 'CreateFile', 'The system cannot find the file specified.')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "docker-compose", line 3, in
File "compose\cli\main.py", line 81, in main
File "compose\cli\main.py", line 200, in perform_command
File "compose\cli\command.py", line 60, in project_from_options
File "compose\cli\command.py", line 152, in get_project
File "compose\cli\docker_client.py", line 41, in get_client
File "compose\cli\docker_client.py", line 170, in docker_client
File "docker\api\client.py", line 197, in init
File "docker\api\client.py", line 221, in _retrieve_server_version
docker.errors.DockerException: Error while fetching server API version: (2, 'CreateFile', 'The system cannot find the file specified.')
[23380] Failed to execute script docker-compose

all -m ping returns unreachable (Win10)

Hi,
in Chapter 2, when executing ansible@ubuntu-c:/$ ansible -i,ubuntu1,ubuntu2,ubuntu3,centos1,centos2,centos3 all -m ping I receive
ubuntu1 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Control socket connect(/home/ansible/.ansible/cp/492fe51149): Connection refused\r\nFailed to connect to new control master", "unreachable": true }
for each of the hosts.
ssh ubuntu1 works fine. Also for all other hosts.
The mentioned folder /home/ansible/.ansible/cp/ is empty.
Thanks for your help.

stuck in bash loop

Hi!
After command

for user in ansible root
do 
  for os in ubuntu centos
  do
    for instance in 1 2 3
    do 
    sshpass -f password.txt ssh-copy-id -o StrictHostKeyChecking=no ${user}@${os}${instance}
    done
  done
done

command execution stuck at first iteration
image

What's wrong with me? :(

Receiving network timeout after logging into ubuntu-c with ansible/password

When I attempt to log into ubuntu-c as per the lab setup, it allows me to login then gives me a timeout message.

I'm running on Windows 10 home, WSL and most recent docker desktop.
I've been using docker for other users without issues, including setting up ubuntu docker images on bridge networks on my laptop.

Edit: I am able to access the localhost:1000 web-page.

I haven't made any changes to any files except for the .env file as per the instructions in the setup.

Login:
image

here is the docker-compose startup
image

Here is my .env file
image

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

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

  • Container centos2 Created 0.0s
  • Container docker Created 0.0s
  • Container centos1 Created 0.0s
  • Container centos3 Created 0.0s
  • Container ubuntu1 Created 0.0s
  • Container ubuntu2 Created 0.0s
  • Container ubuntu-c Created 0.0s
  • Container ubuntu3 Created 0.0s
  • Container portal Created 0.0s
    Attaching to centos1, centos2, centos3, docker, portal, ubuntu-c, ubuntu1, ubuntu2, ubuntu3
    ubuntu3 exited with code 255
    ubuntu2 exited with code 255
    ubuntu1 exited with code 255
    ubuntu-c exited with code 255
    portal | 2021/06/09 19:52:14 [emerg] 1#1: host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
    portal | nginx: [emerg] host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
    portal exited with code 1

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

Cannot login ansible

I get an error trying to log into ubuntu-c once I enter localhost: 1000. I use ansible / password, ansible /, Ansible / Password or ansible / pass and it keeps giving me a login error.

image

Unable to login Ubuntu-C guest

Password not working Ubuntu

Hi, I'm running on Ubuntu (20.4.2.0) as my host and all goes well until I must login into the ubuntu-c Ansible guest. No matter what password I use (I even changed the guest_pwd file to use a different password), none seem to work. Only get login incorrect message all the time. How can I solve this?

My .env file:

# Shared config volume
CONFIG=/users/hghisaidoobe/diveintoansible-lab/config

# Shared home directories
ANSIBLE_HOME=/users/hghisaidoobe/diveintoansible-lab/ansible_home

ansible_home does not get created after pull from git, have to create it manually (not running on Windows, so no mount here). I'm stuck here...

Ansible path settings

fedora 33 even with docker.io ..

Hey there..

Lurker of the Udemy.. been listening to the audio here in NY, USA while shoveling snow..

Decided to make the labs and give it a go..

tl:dr; fedora 33 (can't make it work) clearlinux - of course it works..

portal | 2021/02/11 02:50:18 [emerg] 1#1: host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46

[2]# cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt2)/boot/vmlinuz-5.10.13-200.fc33.x86_64 root=UUID=448267b7-614f-43d2-a0cc-72113faa7d10 ro resume=UUID=9239ee84-9014-489b-9350-393baa12ee38 rhgb quiet mitigations=off systemd.unified_cgroup_hierarchy=0

docker version
Client: Docker Engine - Community
Version: 20.10.3
API version: 1.41
Go version: go1.13.15
Git commit: 48d30b5
Built: Fri Jan 29 14:33:58 2021
OS/Arch: linux/amd64
Context: default
Experimental: true

hostnamectl
Static hostname: fedora.vlan10.dns
Icon name: computer-desktop
Chassis: desktop
Machine ID: c8d483188c7e4356a4d3028e1928ba27
Boot ID: 2bfc8bd99f70413bab16ee5ef3048692
Operating System: Fedora 33 (Thirty Three)
CPE OS Name: cpe:/o:fedoraproject:fedora:33
Kernel: Linux 5.10.13-200.fc33.x86_64
Architecture: x86-64

root@fedora ~/g/diveintoansible-lab (master)# export CONFIG=/root/github/diveintoansible-lab/config
root@fedora ~/g/diveintoansible-lab (master)# export ANSIBLE_HOME=/root/github/diveintoansible-lab/ansible_home
root@fedora ~/g/diveintoansible-lab (master)# docker-compose up
Starting centos2 ... done
Starting docker ... done
Starting centos3 ... done
Starting centos1 ... done
Starting ubuntu1 ... done
Starting ubuntu3 ... done
Starting ubuntu2 ... done
Starting ubuntu-c ... done
Starting portal ... done
Attaching to docker, ubuntu1, ubuntu2, ubuntu3, ubuntu-c, centos3, centos1, centos2, portal
ubuntu-c exited with code 255
ubuntu3 exited with code 255
ubuntu1 exited with code 255
ubuntu2 exited with code 255
portal | 2021/02/11 02:55:38 [emerg] 1#1: host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
portal | nginx: [emerg] host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
portal exited with code 1

[2]# mount | grep cgroup
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755,inode64)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)

root@clear-docker ~/g/diveintoansible-lab (master)# docker-compose up
Starting ubuntu1 ... done
Starting docker ... done
Starting ubuntu2 ... done
Starting centos3 ... done
Starting centos2 ... done
Starting centos1 ... done
Starting ubuntu-c ... done
Starting ubuntu3 ... done
Starting portal ... done
Attaching to ubuntu2, centos1, centos3, ubuntu-c, docker, ubuntu1, ubuntu3, centos2, portal

root@clear-docker ~/g/diveintoansible-lab (master)# docker version
Client:
Version: 19.03.13
API version: 1.40
Go version: go1.15.8
Git commit: afacb8b7f0d8d4f9d2a8e8736e9c993e672b41f3
Built: Fri Feb 5 01:15:41 2021
OS/Arch: linux/amd64
Experimental: false

(master)# hostnamectl
Static hostname: clear-docker
Icon name: computer-desktop
Chassis: desktop
Machine ID: cdad8e76fdc84af6bee7ac8cdfd07db2
Boot ID: a889cf58162740a98719830c80df9d65
Operating System: Clear Linux OS
Kernel: Linux 5.4.96-98.lts2019
Architecture: x86-64

I do have an lts kernel in this machine..

So clear linux for the win..

Not sure why Fedora isn't doing it.. but clearlinux docker For. The. Win.

Any suggestions for Fedora?

Thanks in advance..

Cannot start service Ports are not available

Hi James,

I am trying to get docker running on windows machine but receiving the following error:
Creating ubuntu2 ...
Creating centos3 ...
Creating ubuntu-c ...
Creating ubuntu1 ...
Creating ubuntu3 ...
Creating centos1 ...
Creating centos2 ...
Creating ubuntu1 ... error

ERROR: for ubuntu1 Cannot start service ubuntu1: Ports are not available: listen tcp 0.0.0.0:2222: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
Creating ubuntu-c ... error

ERROR: for ubuntu-c Cannot start service ubuntu-c: Ports are not available: listen tcp 0.0.0.0:2221: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
Creating ubuntu2 ... error
....
Desktop Screenshot 2021 05 23 - 23 29 19 54
Desktop Screenshot 2021 05 23 - 23 33 58 22

Issues with locating .env

Hello, I'm fairly novice with coding and very new to Ansible. I'm trying to install the lab to move forward but when completing the verification of the files in their paths, I'm missing the env. I'm not sure what commands to complete to locate it and successfully complete the steps to run the lab.

I'm stuck at the Validation and Configuration stages on https://github.com/spurin/diveintoansible-lab

Please let me know if there is any more info I can provide. Thank you

Here is an image below of what I have completed so far in the setup:
Screen Shot 2021-06-23 at 11 31 14 AM

Can't setup lab on Ubuntu server 20.4

I'm trying to run this lab in VM with Ubuntu-server 20.04.1 LTS and at first sight all looks good but I can't login as user ansible to ubuntu-c container (such user is just missing there). In addition I get 100% CPU usage inside my VM when lab is running (it is two physical cores of i5-4690!).

~/diveintoansible-lab$ ssh ansible@localhost -p 2221
ansible@localhost's password:
Permission denied, please try again.
ansible@localhost's password:
Permission denied, please try again.
ansible@localhost's password:
ansible@localhost: Permission denied (publickey,password).

~/diveintoansible-lab$ docker exec -it ubuntu-c /bin/bash
root@ubuntu-c:/# grep ansible /etc/passwd
root@ubuntu-c:/#

The environment

$ docker -v
Docker version 19.03.8, build afacb8b7f0

$ docker-compose version
docker-compose version 1.27.4, build unknown
docker-py version: 4.4.0
CPython version: 3.8.5
OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020
$ docker ps -a
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS              PORTS                                          NAMES
e4d8eb069183        spurin/diveintoansible:portal    "/docker-entrypoint.…"   11 minutes ago      Up 11 minutes       0.0.0.0:1000->80/tcp                           portal
c4017fe87286        spurin/diveintoansible:ubuntu    "/lib/systemd/systemd"   11 minutes ago      Up 11 minutes       0.0.0.0:2223->22/tcp, 0.0.0.0:7683->7681/tcp   ubuntu2
51572d51f649        spurin/diveintoansible:ansible   "/lib/systemd/systemd"   11 minutes ago      Up 11 minutes       0.0.0.0:7681->7681/tcp, 0.0.0.0:2221->22/tcp   ubuntu-c
4377547ec9c3        spurin/diveintoansible:ubuntu    "/lib/systemd/systemd"   11 minutes ago      Up 11 minutes       0.0.0.0:2224->22/tcp, 0.0.0.0:7684->7681/tcp   ubuntu3
4247eca433f9        spurin/diveintoansible:dind      "dockerd-entrypoint.…"   11 minutes ago      Up 11 minutes       2375-2376/tcp                                  docker
8a527bedf5b8        spurin/diveintoansible:centos    "/usr/lib/systemd/sy…"   11 minutes ago      Up 11 minutes       0.0.0.0:2225->22/tcp, 0.0.0.0:7685->7681/tcp   centos1
bae80281bcb4        spurin/diveintoansible:centos    "/usr/lib/systemd/sy…"   11 minutes ago      Up 11 minutes       0.0.0.0:2227->22/tcp, 0.0.0.0:7687->7681/tcp   centos3
9f87c342de79        spurin/diveintoansible:centos    "/usr/lib/systemd/sy…"   11 minutes ago      Up 11 minutes       0.0.0.0:2226->22/tcp, 0.0.0.0:7686->7681/tcp   centos2
d004dd2659ef        spurin/diveintoansible:ubuntu    "/lib/systemd/systemd"   11 minutes ago      Up 11 minutes       0.0.0.0:2222->22/tcp, 0.0.0.0:7682->7681/tcp   ubuntu1

My vCPU is 100% busy with systemd processes

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
 232178 root      20   0   22000  11768   8388 S  21.4   0.6   1:36.58 /lib/systemd/systemd
 232463 root      20   0   21972  11692   8284 S  20.8   0.6   1:36.11 /lib/systemd/systemd
 232446 root      20   0   22060  11852   8440 S  11.3   0.6   1:36.34 /lib/systemd/systemd
 232125 root      20   0   94464  10648   8404 S   8.8   0.5   0:44.53 /usr/lib/systemd/systemd
 232337 root      20   0   22048  11784   8356 S   5.7   0.6   1:35.62 /lib/systemd/systemd
 232456 root      20   0   94468  10472   8232 R   3.8   0.5   0:44.95 /usr/lib/systemd/systemd
    650 root      20   0 1305548  47852  25048 S   1.9   2.4   3:50.32 /usr/bin/containerd
 233065 root      19  -1   40388  11464  10052 S   1.3   0.6   0:04.12 /lib/systemd/systemd-journald

~/diveintoansible-lab$ free -m
              total        used        free      shared  buff/cache   available
Mem:           1987         418         235         132        1333        1269
Swap:          2047           3        2044

Ubuntu 20.10 - docker up issue

Hi,

this is my .env:

# 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=/home/hostadmin/Workspace/diveintoansible-lab/config

# Shared home directories
ANSIBLE_HOME=/home/hostadmin/Workspace/diveintoansible-lab/ansible_home

After starting docker-compose i get this error:

ERROR: Version in "./docker-compose.yaml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

Portal has long load times

Hi,

I am getting long load times. Once I load the portal, it takes 1.5 min to complete. Is that normal? What is the reason behind?
As a parent OS I am using Ubuntu 20.04.

Thanks!

Ubuntu-c

Ubuntu-c, directory diveintoansible is not on the VM. Can not work on-line training.

Question regarding the 'extra step' for Linux users on setup...

Hey,

I have the containers up and running (to a degree)... one thing I have noticed is that during the docker-compose up phase, i'm not seeing the creation of the sub-folders in the ansible-lab (parent) directory. (I can confirm I have the initial lab-files (form the repo) in my home directory.

I am running my docker instance on an Ubuntu 20.04 VM, and in the read me, specifically in the 'Extra step for Linux users' section you state...

With the lab working and connectivity working as ansible...

Would you mind elaborating on this for me please? I have ran the chown command, locally (on my Ubuntu VM), but there is no 'ansible' local user there. I also swapped out the name 'ansible' for my own local username , but ... there is no '/shared/' folder to perform the action on? - I need a little more clarity on this part please?

Also.. maybe related, maybe not.. but when I try to log into ubuntu-c with ansible\password, it says the password is wrong. Is this expected?

Thanks.
://mk

Facing an issue while doing docker-compose up

ankumar@ANKUMAR-19MBP diveintoansible-lab % docker-compose up
Docker Compose is now in the Docker CLI, try docker compose up

Creating network "diveinto.io" with the default driver
Pulling ubuntu-c (spurin/diveintoansible:ansible)...
ansible: Pulling from spurin/diveintoansible
5d3b2c2d21bb: Pull complete
3fc2062ea667: Pull complete
75adf526d75b: Pull complete
e339760bac62: Pull complete
8ad8c7b7fa7b: Pull complete
3bb6a137e325: Pull complete
6532536d6bc2: Pull complete
9a9c0eb2ea70: Pull complete
4137c2b32ea4: Pull complete
e48f12d1dc21: Pull complete
0d3b4350af8a: Pull complete
3a75fb0366e3: Pull complete
4c107a58d19e: Pull complete
7c640152e81a: Pull complete
6cf44857584d: Pull complete
3a34c2528018: Pull complete
f894ffefa016: Pull complete
232302f36bf7: Pull complete
6c992b5ac2d4: Pull complete
bb3d24d53ab8: Pull complete
9adcb890eee6: Pull complete
22d5107aa0e5: Pull complete
ff2c1289b326: Pull complete
e528502cdd79: Pull complete
72aa8134d01d: Pull complete
Digest: sha256:1f6c2140403cd5b16a774c7f84e1eb94bb0eb55a10d0aa34c0df3af4673e6fc5
Status: Downloaded newer image for spurin/diveintoansible:ansible
Pulling ubuntu1 (spurin/diveintoansible:ubuntu)...
ubuntu: Pulling from spurin/diveintoansible
5d3b2c2d21bb: Already exists
3fc2062ea667: Already exists
75adf526d75b: Already exists
e339760bac62: Already exists
8ad8c7b7fa7b: Already exists
3bb6a137e325: Already exists
6532536d6bc2: Already exists
9a9c0eb2ea70: Already exists
4137c2b32ea4: Already exists
e48f12d1dc21: Already exists
0d3b4350af8a: Already exists
3a75fb0366e3: Already exists
4c107a58d19e: Already exists
7c640152e81a: Already exists
6cf44857584d: Already exists
3a34c2528018: Already exists
f894ffefa016: Already exists
a9cf06fa295f: Pull complete
0e74c8266ab6: Pull complete
238a3e65ef4c: Pull complete
408e1bbc82ec: Pull complete
f4c3c9fcf327: Pull complete
570a11145e41: Pull complete
Digest: sha256:298fbe61ecd8a64befade9eca6d3c4f25e3456610b6a8d1089bbc1bb3204ea17
Status: Downloaded newer image for spurin/diveintoansible:ubuntu
Pulling centos1 (spurin/diveintoansible:centos)...
centos: Pulling from spurin/diveintoansible
7a0437f04f83: Pull complete
cf83964885fa: Pull complete
f4744ad0a4ea: Pull complete
4ba305f74535: Pull complete
02fa94a92434: Pull complete
6ce61af718a6: Pull complete
c66795ead3c6: Pull complete
8b43e21f63a5: Pull complete
de112777223f: Pull complete
9ccfe64c4750: Pull complete
fd1752c8a3ce: Pull complete
803d902310ce: Pull complete
db2e3b4e6fb9: Pull complete
b79a8c79c185: Pull complete
2b2d9c5c665f: Pull complete
dcde7528f057: Pull complete
f7ea90ee9b0b: Pull complete
05215915c7a4: Pull complete
b55deb2f7b84: Pull complete
6848c5120027: Pull complete
c806c1eb0cad: Pull complete
1e7898b3f2d0: Pull complete
60f557c24918: Pull complete
Digest: sha256:feacec0a3f62489e086021c2184f0398360cb85795ef039502fcba2155e5cec4
Status: Downloaded newer image for spurin/diveintoansible:centos
Pulling docker (spurin/diveintoansible:dind)...
dind: Pulling from spurin/diveintoansible
ba3557a56b15: Pull complete
94caa5d1da70: Pull complete
a10a29983da5: Pull complete
3d6ccddb7fa4: Pull complete
ed1bef566495: Pull complete
201a9d1142eb: Pull complete
0806b78d1f4d: Pull complete
7487d64c1d39: Pull complete
3803ba42d066: Pull complete
3b73e0fabdc0: Pull complete
5243cc195ad1: Pull complete
79d36018d4a9: Pull complete
c4fbbab13042: Pull complete
Digest: sha256:13df3e0405efac005143305fef876e4071067ece61495eac92f3f0bd407cd49d
Status: Downloaded newer image for spurin/diveintoansible:dind
Pulling portal (spurin/diveintoansible:portal)...
portal: Pulling from spurin/diveintoansible
75646c2fb410: Pull complete
6128033c842f: Pull complete
71a81b5270eb: Pull complete
b5fc821c48a1: Pull complete
da3f514a6428: Pull complete
3be359fed358: Pull complete
e929c3b67e96: Pull complete
ff591297d60d: Pull complete
2ebe35a09969: Pull complete
Digest: sha256:7836d47176865e0314caaa6ecff920f5b923daac1d5f45d105c5eb2cf60a076e
Status: Downloaded newer image for spurin/diveintoansible:portal
Creating centos2 ...
Creating ubuntu2 ...
Creating centos1 ...
Creating ubuntu1 ...
Creating ubuntu-c ...
Creating centos1 ... error
Creating docker ... error
Creating docker ...

Creating centos2 ... error
Creating ubuntu-c ... error

ERROR: for centos1 Cannot start service centos1: error while creating mount source path '/Users/james/diveintoansible-lab/a
Creating ubuntu2 ... error

ERROR: for ubuntu-c Cannot start service ubuntu-c: error while creating mount source path '/Users/james/diveintoansible-lab/ansible_home/shared': mkdir /Users/james: operation not permitted

ERROR: for centos2 Cannot start service centos2: error while creating mount source path '/Users/james/diveintoansible-lab/ansible_home/centos2/ansible': mkdir /Users/james: operation not permitted
Creating ubuntu3 ... error
ERROR: for ubuntu2 Cannot start service ubuntu2: error while creating mount source path '/Users/james/diveintoansible-lab/ansible_home/ubuntu2/ansible': mkdir /Users/james: operation not permitted

Creating ubuntu1 ... error
Creating centos3 ... error

ERROR: for centos3 Cannot start service centos3: error while creating mount source path '/Users/james/diveintoansible-lab/ansible_home/centos3/ansible': mkdir /Users/james: operation not permitted

ERROR: for ubuntu1 Cannot start service ubuntu1: error while creating mount source path '/Users/james/diveintoansible-lab/ansible_home/shared': mkdir /Users/james: operation not permitted

ERROR: for docker Cannot start service docker: error while creating mount source path '/Users/james/diveintoansible-lab/ansible_home/shared': mkdir /Users/james: operation not permitted

ERROR: for centos1 Cannot start service centos1: error while creating mount source path '/Users/james/diveintoansible-lab/ansible_home/centos1/ansible': mkdir /Users/james: operation not permitted

ERROR: for ubuntu-c Cannot start service ubuntu-c: error while creating mount source path '/Users/james/diveintoansible-lab/ansible_home/shared': mkdir /Users/james: operation not permitted

ERROR: for centos2 Cannot start service centos2: error while creating mount source path '/Users/james/diveintoansible-lab/ansible_home/centos2/ansible': mkdir /Users/james: operation not permitted

ERROR: for ubuntu2 Cannot start service ubuntu2: error while creating mount source path '/Users/james/diveintoansible-lab/ansible_home/ubuntu2/ansible': mkdir /Users/james: operation not permitted

ERROR: for ubuntu3 Cannot start service ubuntu3: error while creating mount source path '/Users/james/diveintoansible-lab/ansible_home/ubuntu3/root': mkdir /Users/james: operation not permitted

ERROR: for centos3 Cannot start service centos3: error while creating mount source path '/Users/james/diveintoansible-lab/ansible_home/centos3/ansible': mkdir /Users/james: operation not permitted

ERROR: for ubuntu1 Cannot start service ubuntu1: error while creating mount source path '/Users/james/diveintoansible-lab/ansible_home/shared': mkdir /Users/james: operation not permitted
ERROR: Encountered errors while bringing up the project.
ankumar@ANKUMAR-19MBP diveintoansible-lab %

please help me..

Not able to connect from ubuntu-c to any of other Hosts

Hi James,

When connecting from ubuntu-c to any of other hosts (ubunt1,2,3 or centos1,2,3) or vice-versa.

However I am able to ping the mentioned hosts or IPs. I was checking on each host and saw the port 22 is open., so what should be the issue here ?

image

image

Here the version of docker and docker-compose as well as the configuration of the .env file,

image

Any suggestion, please ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.