Comments (11)
It's been a couple of months and I haven't heard anything back, so I'm guessing this is fixed? Going to close this for now.
from ansible-docker.
Hi,
What did you set exactly in your playbook / inventory to customize docker__daemon_json
?
It should look like this:
docker__daemon_json: |
"experimental": true,
"hosts": ["fd://", "tcp://0.0.0.0:2375"]
Also, you'll always see /etc/docker/daemon.json
being set by this role since it configures the log driver (unless you disabled that). Your custom settings should be included under that.
from ansible-docker.
I have changed the 'docker__daemon_json' variable as you wrote under 'defaults' folder (main.yml).
I did not put anything special inside my playbook- only activated the role.
Do I have to specify some thing?
from ansible-docker.
Did you run my role or your forked copy?
Typically you wouldn't modify variables directly in a role. You would modify them by overriding variables in your inventory.
from ansible-docker.
I totally forgot that I have changed a few things in task's yml to make it work with centos as well.
I changed back to your tasks but received that when running the playbook.
Sep 03 06:13:21 ip-10-2-11-24 systemd[1]: docker.service: Start request repeated too quickly.
Sep 03 06:13:21 ip-10-2-11-24 systemd[1]: Failed to start Docker Application Container Engine.
Sep 03 06:13:21 ip-10-2-11-24 systemd[1]: docker.service: Unit entered failed state.
Sep 03 06:13:21 ip-10-2-11-24 systemd[1]: docker.service: Failed with result 'start-limit-hit'.
I'm pretty sure it's related to the altered daemon.json
Did it happen to you?
from ansible-docker.
What does your /etc/docker/daemon.json
look like on your server? Paste it here.
Also what does journalctl
say about that failing Docker service?
I have not encountered that while modifying that file.
If you take a look at the tests for this role, I made a bunch of changes to various config files. You can see that playbook here: https://github.com/nickjj/ansible-docker/blob/master/tests/test.yml
If I were to guess, it's probably a conflict with the hosts
in the daemon.json config file conflicting with the one in the unit file. For a long time Docker didn't allow you to set hosts
in daemon.json, but now I think they might let you, but you can't have it defined in 2 different configs.
Try keeping your custom json but set docker__daemon_flags
to []
.
from ansible-docker.
my daemon.json:
{
"log-driver": "journald"
, "experimental": true,
"hosts": ["fd://", "tcp://0.0.0.0:2375"]
}
journalctl:
-- Unit docker.service has begun starting up.
Sep 03 11:33:37 ip-10-2-11-24 dockerd[6614]: unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: hosts: (from flag: [unix://], fr
Sep 03 11:33:37 ip-10-2-11-24 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Sep 03 11:33:37 ip-10-2-11-24 systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
&
-- The start-up result is done.
Sep 03 11:33:40 ip-10-2-11-24 systemd[1]: docker.service: Start request repeated too quickly.
Sep 03 11:33:40 ip-10-2-11-24 systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker.service has failed.
--
-- The result is failed.
Sep 03 11:33:40 ip-10-2-11-24 systemd[1]: docker.socket: Unit entered failed state.
Sep 03 11:33:40 ip-10-2-11-24 systemd[1]: docker.service: Unit entered failed state.
Sep 03 11:33:40 ip-10-2-11-24 systemd[1]: docker.service: Failed with result 'start-limit-hit'.
i guess this is the problem, even due the fact this is my new playbook:
---
- hosts: "{{ host_var | default('test-ubuntu') }}"
remote_user: "{{ user_var | default('ubuntu') }}"
become: true
gather_facts: yes
vars:
docker__daemon_json: |
"experimental": true,
"hosts": ["fd://", "tcp://0.0.0.0:2375"]
docker__daemon_flags: []
roles:
# - ansible-users
# - machine-install
- ansible-docker
from ansible-docker.
The error says it all:
Sep 03 11:33:37 ip-10-2-11-24 dockerd[6614]: unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives are specified both as a flag and in the configuration file: hosts: (from flag: [unix://]
That means you haven't ran what you have defined in your playbook, or those vars aren't taking effect in your playbook.
from ansible-docker.
Did i run them incorrectly?
from ansible-docker.
No, it looks good.
But the error you pasted doesn't line up to what you have in the playbook you pasted.
The error says you have hosts
defined in both your json file and the daemon flag and it even goes as far as saying it's using unix://
as the value, which is the default docker__daemon_flags
value from this role, which makes me think your variables aren't being used due to reasons unknown.
Maybe you're not running that playbook, maybe you forgot to save the playbook, maybe you're checking the results on the wrong server. It's hard to say.
from ansible-docker.
Ok nick ill take your opinion. I will keep trying to figure out what's going on.
Thank you for your time!
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.