ansible-community / ansible-community/molecule-plugins

Ansible rebuilds images after molecule destroy when pre_build_image: false

Open
#79 2 comments 0 reactions 0 assignees View on GitHub
podman
Dominant language
Python
Stars
164
Forks
113
Avg merge
4d 20h
Merged PRs (30d)
1

Description

When I run `molecule create` with `pre_build_image: false` ansible recreates image everytime.
I'm not sure if this is a bug or expected behavior?

After `molecule create`
```sh
ls ~/.cache/molecule/gentoo-portage/default/
ansible.cfg Dockerfile_gentoo_portage molecule.yml
inventory state.yml
```
After `molecule destroy` Dockerfile is gone
```sh
ls ~/.cache/molecule/gentoo-portage/default/
ansible.cfg inventory state.yml
```

Next time I run `molecule create` Dockerfiles would be created again triggering [Build an Ansible compatible image](https://github.com/ansible-community/molecule-podman/blob/master/lib/molecule_podman/playbooks/create.yml#L52) with `platforms.changed`

My `molecule.yml` file
```yaml
driver:
name: podman
platforms:
- name: gentoo-portage
image: gentoo-portage
dockerfile: Containerfile
pre_build_image: false
cmd: /sbin/init
provisioner:
name: ansible
verifier:
name: ansible
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported molecule.yml configuration and compare the cache contents before and after molecule destroy. Read the linked create.yml section around “Build an Ansible compatible image” and determine whether removing Dockerfile_gentoo_portage causes an unintended rebuild on the next molecule create; done means the expected image lifecycle is documented or the behavior is corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.