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 daemon environment variables not set when SysVinit is used #152

Closed
haxorof opened this issue Apr 24, 2022 · 1 comment
Closed

Docker daemon environment variables not set when SysVinit is used #152

haxorof opened this issue Apr 24, 2022 · 1 comment
Labels

Comments

@haxorof
Copy link
Owner

haxorof commented Apr 24, 2022

Version Information

Ansible: core 2.12.4
Role: 3.7.1

Steps to Reproduce

Test on distribution that uses sysvinit instead of systemd like in the case when running Ubuntu 20.04 on WSL2

---
- hosts: test-host
  vars:
    docker_daemon_envs:
      TESTVAR: "1"
  roles:
    - haxorof.docker_ce

Expected Behavior

TESTVAR visible when looking at environment variables for the dockerd process

Actual Behavior

TESTVAR not visible since it seem for SysVinit it also is necessary to export the variables.

@haxorof haxorof added the fix label Apr 24, 2022
@haxorof
Copy link
Owner Author

haxorof commented Apr 24, 2022

Added to bottom of docker-envs.j2

{% if not _docker_systemd_used and (docker_envs.items()|list)|length > 0  %}
export{% for key, value in docker_envs.items()|list %} {{ key }}{% endfor %}
{% endif %}

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

No branches or pull requests

1 participant