Comments (6)
Hi,
Yeah in this case, I used the default Docker system unit file, which does have -H set.
It sounds like we should introduce another systemd override file for daemon options, and name the variable something so it's not confused with the other one.
That, or get rid of the docker__daemon_environment
variable, change it to something like docker__systemd_override: ""
which allows you to override anything you want (add environment variables, set daemon options at the unit file level, etc.). Then the environment.conf.j2
template gets renamed to override.conf.j2
.
I'm leaning towards the 2nd option because suddenly now you can tweak everything, thoughts?
If that happens maybe docker__daemon_options
gets renamed to docker__etc_docker_daemon_json
so it's crystal clear on where those settings are getting saved to.
from ansible-docker.
Hey, thanks for the quick reply.
What would the docker__systemd_override
would look like? Environment variables and dockerd arguments end up in different places, don't they? (I'm not very confortable with systemd)
Or do you think of two sub-keys in that variable?
docker__daemon_json
might be enough to convey the information that its going to be actual JSON text meant to be inserted into daemon.json. I must confess that I had trouble realizing that (of course I didn't quite read the README properly). I was trying for a moment to figure out what sort of strange yaml syntax was expected there...
from ansible-docker.
The override variable would be empty by default, but it could look like this:
For adding environment variables:
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"
For adding daemon options:
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd://
The empty ExecStart=
is needed to null out the old one in the original file.
But with that said, maybe that's too much of a burden for people since they would need to know the inner workings of how systemd works.
A third option could be:
docker__daemon_json
configures the /etc/docker/daemon.json
file as usual.
docker__daemon_options
accepts a list of command line flags (exactly how it used to work)
docker__daemon_environment
continues to work as it does now
docker__systemd_override
for doing advanced configuration
docker__daemon_options
defaults to -H fd://
and writes out /etc/systemd/system/docker.service.d/options.conf
with the necessary systemd boilerplate.
When docker__systemd_override
is not empty, it writes out /etc/systemd/system/docker.service.d/override.conf
with what you put exactly.
Now as an end user you only need to adjust lists for the common overrides, and if you plan to change docker__systemd_override
it is expected you know how systemd works.
Sound good?
from ansible-docker.
This sounds great!
I was going to suggest docker__daemon_flags
instead of docker__daemon_options
to make even more clear what it is. But it may be better to keep the same name to avoid a potential pain point for people migrating.
from ansible-docker.
I like docker__daemon_flags
because it hints on what type of configuration is expected and the _json
variable also does the same thing. Might as well go in all and make it the best it can be since there's going to be migration things to deal with no matter what.
I'll release a new version tomorrow with these changes in place, along with a few other things I've been working on.
from ansible-docker.
Ended up doing some late night coding. This is now included in v1.4.0 and it's up on the Galaxy.
from ansible-docker.
Related Issues (20)
- Support for docker.io package (in addition to ce and ee) HOT 4
- Failed : Install Docker's dependencies HOT 9
- Package dependency error for Docker installation on clean Ubuntu 18.04 HOT 11
- Ubuntu 20.04 ImportError: No module named pkg_resources HOT 10
- Avoid docker login issue with X11 HOT 11
- Expected behavior for DockerHub private repositories login options? HOT 19
- Failed to import the required Python library HOT 10
- Update apt cache before installing packages HOT 1
- Add way to add additional packages to install HOT 3
- Versioning pinning not working HOT 5
- Install Python packages: Could not get output from /usr/local/bin/virtualenv --help HOT 16
- Hi; Please consider suppressing credentials output in: Manage Docker registry login credentials HOT 8
- Upgrade edge case HOT 9
- I'm thinking about no longer setting up a virtualenv, pip installing docker / docker compose and switching the docker_login module to a shell script HOT 2
- docker not installed into /usr/local/bin HOT 4
- Unable to find pip in the virtualenv HOT 8
- Error in new v2.2.0 version when using ansible 2.9.14 HOT 3
- Docker Compose V1 causes the Install Python packages step to crash HOT 3
- Error with pip on basic usage HOT 2
- Task exception at: Install Python packages HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-docker.