Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding molecule template based on driver.name #4126

Merged
merged 3 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/molecule/data/init-scenario.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@
- templates/scenario/*.j2
loop_control:
label: "{{ dest_file | relpath }}"
when:
- ((driver_name in ['containers', 'docker', 'podman']) and
(item | regex_search('create|destroy') is none) or
(driver_name not in ['containers', 'docker', 'podman']))
7 changes: 7 additions & 0 deletions src/molecule/data/templates/scenario/molecule.yml.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
---
driver:
name: {{ driver_name }}
platforms:
- name: instance
{% if driver_name in ['containers', 'docker', 'podman'] %}
image: quay.io/centos/centos:stream8
pre_build_image: true
{% else %}
# you might want to add your own variables here based on what provisioning
# you are doing like:
# image: quay.io/centos/centos:stream8
{% endif %}