Commit Graph

186 Commits (f1b91a9d31a737e09ad109524427e69d7bfc89be)

Author SHA1 Message Date
Johan Haals 1ea03e7182 ensures API compatibility for read_only containers 9 years ago
Johan Haals 851e55b55f changed version_added for read_only param
this feature will be released in 2.0
9 years ago
Johan Haals 8ec6538ad4 Merge remote-tracking branch 'upstream/devel' into docker-read-only-container 9 years ago
Christian Hammerl b96d304b93 docker: add support to add/drop capabilities 9 years ago
Johan Haals 38f01b52e8 Added support for --read-only Docker containers
Adds support for mounting the container's root filesystem as read only.
9 years ago
Brian Coca 88167a5dac minor doc fixes to docker_user 9 years ago
Brian Coca 5240124525 Merge pull request #361 from simono/docker-add-user
Add option docker_user for docker module.
9 years ago
Brian Coca 030d6d645c added version_Added for new signal option in docker module 9 years ago
Brian Coca ac28f16126 Merge pull request #1014 from nemunaire/docker-kill-signal
[Docker] Add signal parameter when killing container
9 years ago
Brian Coca 2441928484 corrected v ersion added 9 years ago
Daniel Kerwin d4d78a1998 Too late for 1.8 9 years ago
Daniel Kerwin a702dbd29a Switch to _cap_ver_req and add cpu_set to create_containers 9 years ago
Daniel Kerwin a8bc50a11f Renamed to cpu_set 9 years ago
Daniel Kerwin fca75a9705 Add support for cpusets. Requires docker-py >= 0.6.0 9 years ago
Brian Coca cf25888e2d Merge pull request #978 from bobrik/faster-docker-updates
[docker] pulling missing docker image before doing anything
9 years ago
Maksim Losev efb6088c27 Use HostConfig object when creating container with Docker Remote API > 1.15
This is mlosev's patch (from #1208), rebased against devel as of
2790af2.  It resolves #1707, which was caused by an API incompatibility
between the docker module and server API version 1.19.
9 years ago
Lars Kellogg-Stedman 444a2ad808 Do not erroneously mask exceptions
There was a catch-all `except` statement in `create_containers`:

        try:
            containers = do_create(count, params)
        except:
            self.pull_image()
            containers = do_create(count, params)

This would mask a variety of errors that should be exposed, including
API compatability errors (as in #1707) and common Python exceptions (KeyError, ValueError, etc) that could result from errors in the code.

This change makes the `except` statement more specific, and only attempts to pull the image and start a container if the original create attempt failed due to a 404 error from the docker API.
9 years ago
Lars Kellogg-Stedman 6672205f49 docker: permit empty or false pid
The `docker` Python module only accepts `None` or `'host'` as arguments.
This makes it difficult to conditionally set the `pid` attribute using
standard Ansible syntax.

This change converts any value that evaluates as boolean `False` to
`None`, which includes empty strings:

    pid:

As well as an explicit `false`:

    pid: false

This permits the following to work as intended:

    - hosts: localhost
      tasks:
      - name: starting container
        docker:
          docker_api_version: 1.18
          image: larsks/mini-httpd
          name: web
          pid: "{{ container_pid|default('') }}"

If `container_pid` is set to `host` somewhere, this will create a
Docker container with `pid=host`; otherwise, this will create a
container with normal isolated pid namespace.
9 years ago
Brian Coca 51b6b725cc Merge pull request #1078 from andrewgdavis/devel
ansible_facts reflects 1.8 output
9 years ago
Brian Coca afeb3c8d07 Merge pull request #1031 from smashwilson/docker-wait
[docker] Wait for process exit on detached=no.
9 years ago
Brian Coca 5f5f01833f Merge pull request #1508 from tarrychk/issue_1442
Fix computation of port bindings
9 years ago
Brian Coca 038cc05f4e Merge pull request #1609 from smashwilson/default-net-bridge
[docker] Prevent unnecessary reloads due to the net parameter
9 years ago
Brian Coca ec15b67712 Merge pull request #547 from steveeJ/devel
Fix bind-volumes on docker >= 1.4.0
9 years ago
Simon Olofsson dc3161dfdd Add option docker_user for docker module.
docker_user can be used to specify the user or UID to use within the
container.
9 years ago
Ash Wilson 29e4a127e1 Default net to 'bridge' in container diff
This prevents an unnecessary reload when the `net` parameter is unspecified
(i.e. almost always).
9 years ago
Toshio Kuratomi 964d731722 Add version_added documentation to log_driver parameter 9 years ago
Toshio Kuratomi 718f32a042 Merge pull request #1405 from ryanwalls/docker-module-log-driver
Add support for --log-driver option that docker released with Docker 1.6
9 years ago
Brian Coca 19f6099777 minor doc fixes 9 years ago
Robin Roth 64fe01178f add comment: ports need to be exposed.
port mapping with this module only works for ports that are exposed either in the Dockerfile or via an additional arguments. This is different from the command line docker client, that is willing to also map ports that are not exposed.

This comments makes the behaviour more obvious.
9 years ago
Greg DeKoenigsberg 28a869a030 Updating cloud modules with proper github author information 9 years ago
Ed Hein 558f2ace1f Fix computation of port bindings. Port bindings configuration can be a list
if several host ports are bound to the same guest port.
9 years ago
Ryan Walls a2630d40fb Fix typo in Docker module. 9 years ago
Ryan Walls 88eddb13c0 Update docker module to avoid false positives when containers are first created. Also have the module check
for api compatibility before trying to set a "--log-driver" option.
9 years ago
Ryan Walls c95717afe5 Set default "log_driver" option to None in docker module. 9 years ago
Ryan Walls 5f1d88a829 Update docker module to look at log_driver variable when deciding if container configuration has changed. 9 years ago
Andrew Pashkin 27c174128b Add 'docker_api_version' to docker_image
By default docker-py uses latest version of Docker API. This is not
always desireable, and this patch adds option to specify version, that
should be used.
9 years ago
Ryan Walls 3f679933a6 Add support for --log-driver option that docker released with Docker 1.6 9 years ago
Pierre Baillet 06e3ac7bf4 Support optional dockerfile name 9 years ago
Toshio Kuratomi 60a66a544d Several cleanups to many modules:
* Fix docs to specify when python2.6+ is required (due to a library
  dep).  This helps us know when it is okay to use python2.6+ syntax in
  the file.
* remove BabyJson returns.  See #1211  This commit fixes all but the
  openstack modules.
* Use if __name__ == '__main__' to only run the main part of the module
  if the module is run as a program.  This allows for the potential to
  unittest the code later.
10 years ago
Ian Babrou 501a665060 Pulling missing docker image before doing anything 10 years ago
Ratnadeep Debnath be66acb436 Fixed typo in cloud docker module. 10 years ago
Toshio Kuratomi f444e49dfa Fix error when container has no names.
Rename loop variable from "i" to more informative "container"

Fixes #1188
10 years ago
Pascal Borreli f29a6ec54d Fixed typos 10 years ago
Toshio Kuratomi 1fdf75d49d Second try at fixing #1227 -- set e default value earlier 10 years ago
Toshio Kuratomi e51ea29d8f Return empty list if an image has no repo_tags 10 years ago
Toshio Kuratomi e356692c74 Get docker's default api version definition from both 1.2 location and pre-1.2 location
Fixes #1227
10 years ago
Brian Coca 09aa79c58f Merge pull request #1102 from heiparta/extra_hosts
Add support for extra_hosts to docker module
10 years ago
Brian Coca a811b9f12e removed deprecated docs, not true anymore 10 years ago
Toshio Kuratomi e95c0b2df3 Only split on the first colon.
Fixes #1214
10 years ago
Heikki Partanen 91ca2d6386 Add support for extra_hosts to docker module
extra_hosts parameter (maps to --add-host in 'docker run' syntax) is used
to add host-to-ip mappings to the container.
10 years ago