Improve docker_container resource
This commit is contained in:
parent
44a598e045
commit
c2edb01e11
@ -7,14 +7,17 @@
|
|||||||
image: {{ image }}
|
image: {{ image }}
|
||||||
state: running
|
state: running
|
||||||
net: host
|
net: host
|
||||||
{% if ports.value %}
|
{% if ports %}
|
||||||
ports:
|
ports:
|
||||||
{% for port in ports.value %}
|
{% for port in ports %}
|
||||||
{% for p in port['value'] %}
|
- {{ port }}:{{ port }}
|
||||||
- {{ p['value'] }}:{{ p['value'] }}
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
expose:
|
||||||
|
{% for port in ports %}
|
||||||
|
- {{ port }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if host_binds.value %}
|
{% if host_binds.value %}
|
||||||
volumes:
|
volumes:
|
||||||
# TODO: host_binds might need more work
|
# TODO: host_binds might need more work
|
||||||
@ -25,3 +28,10 @@
|
|||||||
- {{ bind['value']['src'] }}:{{ bind['value']['dst'] }}:{{ bind['value'].get('mode', 'ro') }}
|
- {{ bind['value']['src'] }}:{{ bind['value']['dst'] }}:{{ bind['value'].get('mode', 'ro') }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if env %}
|
||||||
|
env:
|
||||||
|
{% for key, value in env.iteritems() %}
|
||||||
|
{{ key }}: {{ value }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
@ -9,7 +9,7 @@ input:
|
|||||||
schema: str!
|
schema: str!
|
||||||
value:
|
value:
|
||||||
ports:
|
ports:
|
||||||
schema: [{value: [{value: int}]}]
|
schema: [int]
|
||||||
value: []
|
value: []
|
||||||
host_binds:
|
host_binds:
|
||||||
schema: [{value: {src: str, dst: str, mode: str}}]
|
schema: [{value: {src: str, dst: str, mode: str}}]
|
||||||
@ -17,6 +17,9 @@ input:
|
|||||||
volume_binds:
|
volume_binds:
|
||||||
schema: [{src: str, dst: str, mode: str}]
|
schema: [{src: str, dst: str, mode: str}]
|
||||||
value: []
|
value: []
|
||||||
|
env:
|
||||||
|
schema: {}
|
||||||
|
value: {}
|
||||||
# ssh_user:
|
# ssh_user:
|
||||||
# schema: str!
|
# schema: str!
|
||||||
# value: []
|
# value: []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user