Sandbox

When learning Ansible is very convenient to have a sandbox environment based on virtual machine or container.

Container

        flowchart LR
    c[Control Node] --> m1[Managed Node 01]
    c[Control Node] --> m2[Managed Node 02]
    c[Control Node] --> m3[Managed Node 03]
    c[Control Node] --> m4[Managed Node 04]
    s[Shell] --> c
    u[User] --> s

    subgraph n[Container Network]
        c
        m1
        m2
        m3
        m4
    end

    subgraph h[Host]
        s
        n
    end
    

Diagram of sandbox using container for Ansible.

Podman

Tip

All the files from this section are in sandbox-podman.zip.

Start the containers with

podman kube play --recreate play.yml

and access the control node with

podman container exec -it rse-ansible-tutorial-docker-control-node /bin/sh

Docker

Tip

All the files from this section are in sandbox-docker.zip.

Start the containers with

docker compose up -d

and access the control node with

docker compose exec -it control-node /bin/sh