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

Feature Request: allow override of dockerd options #90

Closed
robbyoconnor opened this issue Sep 27, 2018 · 31 comments · Fixed by #256
Closed

Feature Request: allow override of dockerd options #90

robbyoconnor opened this issue Sep 27, 2018 · 31 comments · Fixed by #256
Labels

Comments

@robbyoconnor
Copy link

I love your Ansible Roles -- but the major no-go for me is the fact I can't override the storage driver easily.

@llbbl
Copy link

llbbl commented Jan 25, 2019

# defaults
docker_default_config:
  storage-driver: overlay2
  log-level: info

# playbook
- name: apply default daemon config
  set_fact:
    docker_json: "{{ docker_default_config | combine(docker_config | default({})) }}"

- name: ensure daemon config file is present
  copy:
    content: |
      {{ docker_json | to_nice_json(indent=2) }}
    dest: /etc/docker/daemon.json
  notify: restart docker

how mongrelion.docker is doing it... but doesn't seem to change daemon.json very reliably.

@llbbl
Copy link

llbbl commented Jan 25, 2019

FYI devicemapper is depreciated and causing issues.

docker/cli#1424

@stegr04
Copy link

stegr04 commented May 1, 2019

This role is installing v18.09.5 for me as of this post. I'm not sure what might have changed since this issue was originally opened but I figured I would share my findings.

I was looking for the same thing (change storage driver) because docker info was showing it was using devicemapper after installing docker with this role. I found this issue and the solutions discussed/created. Awesome!

I started testing Rickkwa's solution (thank you!). It was working as advertised. Then I started testing without the storage options settings (after manually removing docker). I noticed it was still using overlay2. I wasn't expecting that. I then realized the uninstall wasn't removing the /etc/docker/daemon.json file.

Good time for some backgroun... all of the hosts I am testing with had docker previously installed. I think the system was setup this way because prior versions of docker required Kernel v4 on CentOs.

To make sure I wasn't picking up on anything from prior setups I removed /etc/docker and /var/lib/docker. I tested with Rickkwa's again (no storage options again) and it still showed overlay2, remove everything again, tested geerlingguy's role and found it using overlay2.

To see if there was something else I might have been missing I tested geerlingguy's role on a server I haven't touched except to uninstall all docker packages on the machine. It did not have any /etc/docker/daemon.json file but it did still have /var/lib/docker. When I tested against this node docker info showed me it was using devicemapper. So I did the manual uninstall again, cleaned up the /var/lib/docker and /etc/docker/key.json, ran geerlingguy's role and it's using overlay2.

@stale
Copy link

stale bot commented Mar 6, 2020

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@stale stale bot added the stale label Mar 6, 2020
@robbyoconnor
Copy link
Author

@geerlingguy

@stale
Copy link

stale bot commented Mar 10, 2020

This issue is no longer marked for closure.

@stale
Copy link

stale bot commented Jun 8, 2020

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@stale stale bot added the stale label Jun 8, 2020
@robbyoconnor
Copy link
Author

This issue is not resolved

@stale
Copy link

stale bot commented Jun 9, 2020

This issue is no longer marked for closure.

@stale stale bot removed the stale label Jun 9, 2020
@garymoon
Copy link

We're after this also, and will be copying tasks from one of the PRs to get around it for now. Would be happy to contribute fixes/cleanup to one of the PRs to get it merged.

@onezeroecho
Copy link

Same here, when using Molecule for testing an Ansible playbook which runs Docker containers you have to use storage-driver: vfs because apparently Docker does not support aufs over aufs.

@robbyoconnor
Copy link
Author

Same here, when using Molecule for testing an Ansible playbook which runs Docker containers you have to use storage-driver: vfs because apparently Docker does not support aufs over aufs.

@onezeroecho why not overlay2?

@onezeroecho
Copy link

@robbyoconnor Doesn't work for my use case, I get the following output during molecule test when I set the storage driver to overlay2 instead of vfs:

TASK [Get Docker container information] ***************************************
failed: [instance] (item=app_rocketchat_1) => {"ansible_loop_var": "item", "changed": false, "item":
"app_rocketchat_1", "msg": "Error connecting: Error while fetching server API version:
('Connection aborted.', ConnectionRefusedError(111, 'Connection refused'))"}

See also Continuous Infrastructure with Ansible, Molecule & TravisCI where they had to do the same thing.

@robbyoconnor
Copy link
Author

@onezeroecho interesting

@stale
Copy link

stale bot commented Sep 28, 2020

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@stale stale bot added the stale label Sep 28, 2020
@robbyoconnor
Copy link
Author

robbyoconnor commented Sep 28, 2020 via email

@stale
Copy link

stale bot commented Sep 28, 2020

This issue is no longer marked for closure.

@stale stale bot removed the stale label Sep 28, 2020
@stale
Copy link

stale bot commented Dec 27, 2020

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@stale stale bot added the stale label Dec 27, 2020
@robbyoconnor
Copy link
Author

bump

@stale
Copy link

stale bot commented Dec 27, 2020

This issue is no longer marked for closure.

@stale stale bot removed the stale label Dec 27, 2020
@MEschenbacher
Copy link

I've now come across the same limitation. Will have to either look for another role or work around by ninja-editing the required files.

@damianoneill
Copy link

Hi @geerlingguy can you provide a comment please on whether this feature is something that should be added to this role? It's unclear from looking at the thread history (its been running for two years) whether there is any appetite to update the role to support this.

@geerlingguy
Copy link
Owner

@damianoneill I do think this kind of functionality would be nice to have in this role.

@geerlingguy
Copy link
Owner

Left one review on the associated PR, other than that this will be good to go!

@stale
Copy link

stale bot commented Apr 15, 2021

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

@stale stale bot added the stale label Apr 15, 2021
@robbyoconnor
Copy link
Author

bump

@stale
Copy link

stale bot commented Apr 15, 2021

This issue is no longer marked for closure.

@stale stale bot removed the stale label Apr 15, 2021
@geerlingguy
Copy link
Owner

There's also this PR: #261

@robbyoconnor
Copy link
Author

robbyoconnor commented Apr 16, 2021

@geerlingguy my issues from closing :)

@jonathantullett
Copy link

jonathantullett commented Jun 5, 2021

Is #261 ready for merging @geerlingguy? It would be great to get this included.

@geerlingguy
Copy link
Owner

This landed in the 4.0.0 release via #256—thanks to everyone for your patience in getting this merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment