Skip to content

Commit

Permalink
Improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kowalski7cc committed Jul 23, 2022
1 parent 1d127da commit 9bc7f87
Showing 1 changed file with 107 additions and 7 deletions.
114 changes: 107 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# podLAB

Build a simple lab using podman and systemd, ready for exercising with Ansible
Build a simple lab using podman and systemd, ready for exercising with Ansible, inspired by [@mrjackv](https://github.com/mrjackv) ansible-nspawn

## Requirements

Expand All @@ -11,18 +11,118 @@ Build a simple lab using podman and systemd, ready for exercising with Ansible
- ssh-keygen, ssh
- ansible

## Setup
## Usage

First run `./setup`, then start pods with
First run the `setup`

```sh
```shell
./setup
```

This script will generate an ssh-key pair, setup the podlab network and then download a `centos:stream9` image and perform the following steps on it:

- add podlab labels
- install userful packages (see [Included Pakcages](#included-packages))

then start pods with the `boot` script, and you can set optionally the ansible gruop to which they will belong.

```shell
./boot [group]
```

You can use option `-a` to attach to the new container.
You can also use the option `-a` to attach directly to the new container.

Finally you can run your playbooks with:
Finally you can run your playbooks like this:

```sh
```shell
ansible-playbook ./playbooks/example.yml
```

After you're done excercising, you can stop the lab with the command

```shell
./shutdown
```

You can also use the `-c` option to delete the image and the network. They will be created again next time tou run the `setup` script

## What's inside?

A quick look at the files and directories included in podlab

```
.
├── playbooks
├── ansible.cfg
├── boot
├── inventory
├── LICENSE
├── podssh
├── README.md
├── setenv
├── setup
├── shutdown
└── ssh_config
```

1. `playbooks`: A direcotry where you can place you playbooks. podLAB comes with a playbook named `example.yml`. You can run it with the command `ansible-playbook playbooks/example.yml`
2. `ansible.cfg`: The configuration to tell ansible how to connect to podLAB containers
3. `boot`: Runs a podLAB container (see [usage](#usage))
4. `inventory`: Inventory script for Ansible in Python, it will filter out any non-podLAB containers
5. `LICENSE`: podlab's MIT license
6. `podssh`: ssh script in podman's unshare net namespace environment, it allows to ssh to any container easily.
7. `README.md`: This file :)
8. `setenv`: podLABS configuration
9. `setup`: Configures the environment for podLAB's usage (see [usage](#usage))
10. `shutdown`: Stops all podLAB's containers, and optionally clears images and networks (see [usage](#usage))
11. `ssh_config`: The ssh configuration file that allows ansible and manual ssh connection to containers

## Included packages

```
- basesystem
- bash
- systemd
- openssh-server
- passwd
- sudo
- python3
- yum
- dnf
- findutils
- iproute
- NetworkManager
- iputils
- bind-utils
- procps-ng
- openssh-clients
- nc
- at
- hostname
- acl
- xz
- zip
- info
- wget
- bzip2
- file
- ed
- nano
- quota
- less
- which
- strace
- symlinks
- tcpdump
- time
- tree
- jq
- pinfo
- vim-enhanced
- words
- util-linux-user
```

## License

MIT License

0 comments on commit 9bc7f87

Please sign in to comment.