Commit 203f06d
Adding molecule template based on
In past when using `cookicuter` some molecule templates where straight
forward to use delegated container drivers, such as `podman` and
`docker`. Since it was gone, every time a new scenario is created it's
needed to configure the templates again, by adding the image and the
driver, also cleaning the files that will not be used by default such as
`create.yml` and `destroy.yml`
If we can just init the scenario with a basic template that just works
as we had in version `5` would be great.
Here I'm bringing back some of this functionality, e.g:
```bash
ansible-galaxy collection init foo.example
cd foo/example/roles
ansible-galaxy role init bar
cd bar
molecule init scenario -d podman podman
```
This will create a `molecule.yml` as the following:
```yaml
---
driver:
name: podman
platforms:
- name: instance
image: quay.io/centos/centos:stream8
pre_build_image: true
```
it will also create the molecule scenario with just the `molecule.yml`
and the `converge.yml`. e.g:
```bash
tree ./molecule/podman/
./molecule/podman/
├── converge.yml
└── molecule.yml
```
If the scenario was any driver different than `podman`, `docker` or
`containers` it will create the scenario with all the default templates
from the current `data` structure, e.g:
```bash
molecule init scenario
tree ./molecule/
./molecule/
├── default
│ ├── converge.yml
│ ├── create.yml
│ ├── destroy.yml
│ └── molecule.yml
```
The final scenario tree, after the commands `molecule init scenario -d
podman podman` and `molecule init scenario` will look like:
```bash
tree ./molecule/
./molecule/
├── default
│ ├── converge.yml
│ ├── create.yml
│ ├── destroy.yml
│ └── molecule.yml
└── podman
├── converge.yml
└── molecule.yml
```
Fixes: #4128
Co-authored-by: Sorin Sbarnea <ssbarnea@redhat.com>driver.name (#4126)1 parent 82652e8 commit 203f06d
2 files changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
4 | 10 | | |
5 | 11 | | |
6 | 12 | | |
| 13 | + | |
0 commit comments