Commit Graph

394 Commits (4c8e32ee27db53cf9b7ab47f21c2f6eb6b7d930e)

Author SHA1 Message Date
chouseknecht b9b727f435 Fix #16211 - only stop/kill running containers 8 years ago
Chris Houseknecht 964d9b3a6d Fix #3906 - Enforce required minimum compose version. (#3925)
* Fix #3906 - Require minimum compose version.

* Fix typo in message text.
8 years ago
Stefan Hajnoczi 47cc422b8a Stream image data in load_image() to avoid out-of-memory
Reading the entire tar file into memory can result in out-of-memory
conditions such as this traceback:

Traceback (most recent call last):
  File "/tmp/ansible_YELTSu/ansible_module_docker_image.py", line 486, in load_image
    self.client.load_image(image_data)
  File "/usr/local/lib/python2.7/dist-packages/docker/api/image.py", line 147, in load_image
    res = self._post(self._url("/images/load"), data=data)
  ...
  File "/usr/lib/python2.7/httplib.py", line 997, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 848, in _send_output
    msg += message_body
MemoryError

Luckily docker-py's load_image(), which calls requests post(), accepts a
file-like object instead of a string.  Pass in the file object to avoid
reading the full file into memory.  This allows larger tar files to load
succesfully.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
8 years ago
Vince v. Oosten fd418c19c2 move environment variable gathering to end of __init__() (#3890)
* This moves the lines in the code that parse the `env` and `env_file` options for docker to the end of the `__init__()` function.
This is needed because the `_check_capabilites` function needs both a working `self.client` and a proper `self.docker_py_versioninfo`.
`_check_capabilities` is used by `ensure_capabilities` which is, in turn, used by `get_environment`

This means that before this commit, the environment variables could not be loaded because both `self.client` and `self.docker_py_versioninfo` were not set at that time.

This commit fixes that by putting the environment variable parsing after those two.

* This moves the lines in the code that parse the `env` and `env_file` options for docker to the end of the `__init__()` function.
This is needed because the `_check_capabilites` function needs both a working `self.client` and a proper `self.docker_py_versioninfo`.
`_check_capabilities` is used by `ensure_capabilities` which is, in turn, used by `get_environment`

This means that before this commit, the environment variables could not be loaded because both `self.client` and `self.docker_py_versioninfo` were not set at that time.

This commit fixes that by putting the environment variable parsing after those two.
8 years ago
Rodríguez, Jorge 7d33c6ccdf Do not forcibly push when building, either. 8 years ago
Rodríguez, Jorge a0be466f90 Don't forcibly push loaded images to registry. Fixes #3763 8 years ago
chouseknecht 68151790c2
Fix issue #3866 8 years ago
chouseknecht d43a91c627 Fix #147 automatically expose published ports 8 years ago
chouseknecht 67432709a4
Remove unused method in ContainerManager 8 years ago
Chris Houseknecht 0a42ada42a Merge pull request #3844 from Hypermanzer/docker-python-3-compat-bug
Fixing Docker compile time errors irt exception handling for Python 3
8 years ago
chouseknecht 09fe0416b6 Fix #3822 stop container 8 years ago
Mike Mars 1c63fb754d Fixing Docker compile time errors irt exception handling for Python 3 8 years ago
chouseknecht a676d9e126 Remove registery option per #3824. 8 years ago
chouseknecht 4ded9313b7 Fix upate typo and expected volume compare. 8 years ago
chouseknecht e2d8d9d09a Fixed binds and volumes. Now recognizes bound vs unbound as well as named volumes. 8 years ago
Jirayut 'Dear' Nimsaeng 1212e2ed25 Fix volume to support not binding volumes to host 8 years ago
chouseknecht e8db7fd8cc
Remove debug/register from examples. 8 years ago
chouseknecht 0601df8c70
Fix network comparison. Fix handling of links. Updated doc strings. Added more examples. 8 years ago
chouseknecht d9c751be16
Set version added to 2.2 so that tests pass 8 years ago
chouseknecht 78019e4388
For new options move vesion_added to 2.1.1 8 years ago
chouseknecht 633e11be1e
Fixed bug in _get_network_id 8 years ago
chouseknecht 6d9de1b5a1 Fix doc strings. 8 years ago
chouseknecht 3292121e6d
Fixed issues post testing. 8 years ago
chouseknecht 8cd028bd8e First pass at implementing networks parameter. Also added purge_networks option to remove container from networks not included in networks param. 8 years ago
chouseknecht 23816c9c04 Fix for 3768 - adding support for env_file 8 years ago
Chris Houseknecht 4d8f7d161b Merge pull request #3776 from danschmidt5189/fix-docker_container-typo
Fix "ansbile_facts" typo in docker_container module
8 years ago
chouseknecht cba5b37c9f
Check self.parameters.env exists. 8 years ago
chouseknecht c419d351c5 Fix for issue #3775 - env config comparison 8 years ago
chouseknecht 651133469c
Update restart_policy doc strings. 8 years ago
chouseknecht 6aa4feb459
Fix restart_poicy 8 years ago
chouseknecht af0aa8247d
Fix for #3783 - command returns not found or does not exist. 8 years ago
pic fee0055f9f fix #3528 : dns type 8 years ago
Dan Schmidt 31d21efbc5 Fix "ansbile_facts" typo in docker_container module 8 years ago
chouseknecht 904d947172 Fix for issue 3740. Make docker_service more resilient when targeting older API versions. 8 years ago
Brian Coca d8b67bdeb0 deprecated docker (#3710)
* deprecated docker

* updated formatting
8 years ago
chouseknecht a8bf8260aa
Fixed the URL in description. It's now valid Yaml. 8 years ago
chouseknecht 3d43ccae1e
Remove the U(). 8 years ago
chouseknecht fe45ec9d9e
Uppercase 8 years ago
chouseknecht 10ee35ff26
Make the new bits a NOTE 8 years ago
chouseknecht 1825a73c40
Where to get the full docker picture. 8 years ago
Shubham 64b104ac37 remove module argument, fix #3682 (#3683) 8 years ago
Matt Martz 9b6a7eb4f9 Revert "Fix doc strings spacing."
This reverts commit 127d518011.
8 years ago
chouseknecht 127d518011
Fix doc strings spacing. 8 years ago
chouseknecht a81d0a6809
Fix doc strings. Missing requirements and doc fragment reference. 8 years ago
chouseknecht d63bc38481
Fail gracefully when build path is not found. 8 years ago
chouseknecht 3a5dd00076
Fixed files/project_files naming. Correct name is files. 8 years ago
chouseknecht 22853efeed
Flip version added back to 2.2 to make tests pass. 8 years ago
chouseknecht 834d2fb9fe
Moving version added to 2.1 8 years ago
chouseknecht 282b2d45df
Added actions to RETURN docs. Show actions when debug or check mode. 8 years ago
chouseknecht c2d2189274
Removed use of --diff. Replaced 'diff' in output with 'actions'. Only show 'actions' in output if debug true. 8 years ago
chouseknecht f69b352341 Removed fail method. Combined recreate and force_recreate params. 8 years ago
chouseknecht d9b026dcef Adding docker_service 8 years ago
Chris Houseknecht f08e5608c7 Fixed parameters passing in container_create method. (#3618) 8 years ago
Brian Coca e7d49f3308 fixed documentation and arg issues 9 years ago
Toshio Kuratomi 9db1233521 Fix documentation 9 years ago
John R Barker bb9572ca86 ansible-validate-modules part 4: Enable check on ansible-modules-core (#3526)
* Call ansible-validate-modules

* Correct quotes + add newline
9 years ago
chouseknecht a9ab2e1142
Add doc string for container_limits. Fixed push fail message. Use path type. 9 years ago
Chris Houseknecht 35c589575d Adding docker_image_facts (#3493)
* Adding docker_image_facts

* Fix github credentials
9 years ago
Chris Houseknecht f6344b6dc7 Adding docker_container (#3495)
* Adding docker_container

* If state absent, stop the container before attempting to remove. Fixed status running check.

* If container absent, stop before removing. Fix container status check.
9 years ago
Toshio Kuratomi 22ce32dd93 Fix docs building 9 years ago
Toshio Kuratomi f3fef24e49 Some beginning python3 porting for modules which have unittests 9 years ago
chouseknecht 1d2be97013 Updated version_added on options to reflect options added for 2.1. 9 years ago
chouseknecht e888abbcb0
Clean up and fixes post API version 1.20 testing. 9 years ago
chouseknecht 6eba1d6fb3 Fix github credentials 9 years ago
chouseknecht 009b02e928 Fix unfriendly exeption handling. 9 years ago
chouseknecht 39fdd2358e Updater per PR comments 9 years ago
chouseknecht 7a1eea2767 Adding refactored docker_image module. 9 years ago
Chris Houseknecht ec5515edcf Adding docker_login (#3494)
* Adding docker_login

* Set correct version_added.

* Fix github credentials
9 years ago
Darek Kaczyński f7c32e2b5e Fix for 'cannot unmarshal array into Go value of type string' error about HostConfig Binds (#3496) 9 years ago
ThomasSteinbach 8dc0276533 docker: fix type issue (#3491)
* fix type issue

* fix type issue for 'volumes-from'
9 years ago
Alexey Wasilyev 1c3071af61 docker: support polling image by digest (#2932) 9 years ago
Fabian von Feilitzsch edc8698c14 make binds a list instead of a dict (to prevent overwriting when copying the same file to two places) (#2294) 9 years ago
René Moser 13f4b40c15 Merge pull request #3284 from mscherer/fix_docker_args
Improve/fix type checking for docker module
9 years ago
Ash Wilson f4557c1631 Remove myself from the docker module maintainers
Apologies, but I no longer use this module day-to-day myself, and I don't have the bandwidth right now to effectively triage changes in any kind of timely fashion.
9 years ago
Brian Coca dabf28edbe Merge pull request #2853 from Igelko/patch-1
docker: If cmd and entrypoint not set, don't match them
9 years ago
Victor Beresnev 6a279fd421 If cmd and entrypoint not set, don't match them
Hello!
I wanted stop the containers matched only by image name, but can't do this, if I not set cmd in playbook.
This behavior confused me.

If cmd or entrypoint is defined for running container, but not defined in playbook, makes matching behavior as this sample:
https://github.com/ansible/ansible-modules-core/blob/devel/cloud/docker/docker.py#L463
9 years ago
Brian Coca 0abade73c4 Merge pull request #2929 from gesellix/add_env_file_support_v2
add `env_file` support
9 years ago
Michael Scherer e78e13b222 Improve/fix type checking for docker module
tls_* point to files, so should be type=path
count is a int, so tag it as such and avoid converting later
password should be tagged as no_log
9 years ago
Yannig Perré b958985816 Add an example of extra_hosts option. 9 years ago
Schlueter 0028f58ab6 Add missing quote in docker documentation 9 years ago
Andrey Gubarev 45b3066c81 update docker_image's path param type to 'path'. Fixes #3175 9 years ago
Brian Coca 5129ef5590 Merge pull request #2993 from berlic/devel
Fix docker container restart
9 years ago
Brian Coca 76669fa16c Merge pull request #2992 from dusdanig/devel
Adds ulimit to the docker module
9 years ago
Daniel Petty bf04a0fe0e replaced sudo with become 9 years ago
Daan Oosterveld 90153a2ca5 Adds ulimit to the docker module
The ulimit will be specified as a list and separated by colons. The
hard limit is optional, in which case it is equal to the soft limit.

The ulimits are compared to the ulimits of the container and added
or adjusted accordingly on by a reload.

The module ensures that ulimits are available in the capabilities
iff ulimits is passes as a parameter.
9 years ago
Konstantin Suvorov d9f13a0bbc Fix docker container restart
restart_containers(containers.running) may try to restart containers
that are deleted when looping through get_differing_containers()
fix this by refreshing list after first loop
9 years ago
Tobias Gesellchen 60e37e6fda add `env_file` support (original code from @vpetersson) 9 years ago
Alexey Wasilyev 511ce25ac8 docker: fix failing in case of empty image tag 9 years ago
Brian Coca 9c80b1adb7 added note about awslogs version added 9 years ago
jefferson fermo 028ecad9d4 add awslog option in docker log driver. this option is available starting with ansible 2.1 9 years ago
Brian Coca 9d4403f2b3 Merge pull request #2521 from wrouesnel/docker_reloaded_fixes
docker: Fix state=reloaded to detect default LoggingDriver for docker
9 years ago
Brian Coca 061da7dc05 updated version_added 9 years ago
Alexey Wasilyev d61772807c Add cpu_shares option for docker module 9 years ago
Brian Coca 4be34067de added versions note in description for new choice 9 years ago
Brian Coca c1df014e3b Merge pull request #2485 from sebi-hgdata/sebi/docker_unless_stopped
added unless stopped option to docker module
9 years ago
Brian Coca f1754fb51e Merge pull request #2376 from mtpereira/fix_2351
Add support for legacy registries to pull_image().
9 years ago
Pavel Derendyaev 61fdb52039 Add "timeout" option to Docker module 9 years ago
sebi aa15231cb7 added unless stopped option 9 years ago
Toshio Kuratomi 15c1c0cca7 entrypoint feature added in 2.1 9 years ago
Toshio Kuratomi 2220dc8e12 Merge pull request #2185 from AndrewPashkin/add_entrypoint_param_to_docker_module
Add entrypoint parameter to docker module
9 years ago