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

docker_container: fix env_file option #452

Merged

Conversation

felixfontein
Copy link
Collaborator

SUMMARY

The env_file option was ignored because of a snafu handling options with not_a_container_option=True. Unfortunately the env_file tests weren't really testing what happens, so they were happily passing...

Fixes #451.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

docker_container

Copy link
Contributor

@gotmax23 gotmax23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes as are LGTM, but I have one suggestion.

The docs say:

- env_file
        Path to a file, present on the target, containing environment variables `FOO=BAR'.
        If variable also present in `env', then the `env' value will override.
        [Default: (null)]
        type: path

Perhaps it's also worthwhile to ensure that the overriding works properly (e.g. add a test with env_file: "{{ remote_tmp_dir }}/env-file" and env: {TEST3: other_val3} and make sure the value is other_val)?

@github-actions
Copy link

github-actions bot commented Aug 15, 2022

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@felixfontein felixfontein merged commit f7cf125 into ansible-collections:main Aug 15, 2022
@felixfontein felixfontein deleted the docker_container-env_file branch August 15, 2022 05:46
@felixfontein
Copy link
Collaborator Author

@gotmax23 thanks for reviewing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

env_file directive in docker_container tasks has no effect since 3.0.0
2 participants