-
Notifications
You must be signed in to change notification settings - Fork 656
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
Make default Dockerfile embedded #2360
Conversation
f75047c
to
aad276f
Compare
From now on, creating a Dockerfile for docker/podman containers would be optional. If the file is not present molecule would use its internal version. This ease maintenance of roles using molecule by having one less file to create and update. Those relying on custom containers are not affected, as this feature is still present. Newly created roles will not have Dockerfiles. Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
aad276f
to
733d9ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested it but this looks good and is a useful change!
If you can move the vars into the ansible.py
that would be better though, if it makes sense.
- name: Create Dockerfiles from image names | ||
vars: | ||
# TODO(ssbarnea): expose module dir so it can also be used by plugins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about feeding it in from:
molecule/molecule/provisioner/ansible.py
Lines 593 to 601 in 97a7b60
molecule_vars = { | |
'molecule_file': "{{ lookup('env', 'MOLECULE_FILE') }}", | |
'molecule_ephemeral_directory': "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}", | |
'molecule_scenario_directory': "{{ lookup('env', 'MOLECULE_SCENARIO_DIRECTORY') }}", | |
'molecule_yml': "{{ lookup('file', molecule_file) | molecule_from_yaml }}", | |
'molecule_instance_config': "{{ lookup('env', 'MOLECULE_INSTANCE_CONFIG') }}", | |
'molecule_no_log': "{{ lookup('env', 'MOLECULE_NO_LOG') or not " | |
"molecule_yml.provisioner.log|default(False) | bool }}", | |
} |
Does it work?
From now on, creating a Dockerfile for docker/podman containers would
be optional. If the file is not present molecule would use its internal
template.
This ease maintenance of roles using molecule by having one less file
to create and update.
Those relying on custom containers are not affected, as this feature is
still present.
Newly created roles will not have Dockerfiles.