Comments (5)
This sounds like a neat idea. It could be implemented this way:
- convert the
daemon.json
template so that the output is stored in a variable, if it's not done already - add a YAML dictionary variable in defaults for custom data structures included in the variable
- in the template, merge the generated configuration with custom dictionary variable
Let me know if you want to try and implement this, if not I can look at it later on.
from ansible-docker.
So looking at this, I wasn't quite sure how to parse an array of unknown depth properly in Jinja, something I've not had to do yet. However adding the storage vars was quite simple to do as they were a known. I've forked and created a branch and am about to test it before submitting a pull request, which will add two vars; one for storage-driver and one for storage-options.
I'll circle back afterwards to see how I might handle the arbitrary config blocks, I imagine we'll need to determine max depth of the array to handle it properly? Not sure.
from ansible-docker.
You don't need to worry about arbitrary length. Assuming that the variable contents will be YAML-formatted, all you need to do in the template is to have:
{% set finished_var = (template_var | combine((inventory_var | from_yaml))) %}
That should do it.
from ansible-docker.
Hmm, ok.
Pull request #35 is in and passed my testing as working for the storage vars in the meantime.
from ansible-docker.
Pull #36 is in for the arbitrary options.
from ansible-docker.
Related Issues (17)
- docker-py HOT 10
- systemd service template compiles incorrectly HOT 3
- Support for iptables chain DOCKER-ISOLATION HOT 8
- Add certificate-based client-server authentication between docker-daemon and private registry HOT 9
- docker daemon failed to start on some systemd systems HOT 15
- Feature request: docker-compose HOT 8
- 'Restart docker' task raise error with v0.2.1. HOT 2
- Support for Latest version of docker-ce HOT 3
- Error with upstream HOT 4
- docker__storage_driver default setting not correct for debian jessie HOT 2
- Conditional dependency on ferm? HOT 4
- Error at Get upstream APT GPG key HOT 12
- Stretch not detected HOT 3
- apt-transport-https missing HOT 3
- Support Docker Compose V2
- Permit bunch of ports on docker host HOT 1
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.