Commit Graph

175 Commits

Author SHA1 Message Date
Felix Fontein
422d51c480
docker_prune: improve docs, fix handling of lists for filters (#966) (#967)
* Improve docs.

* Fix handling of lists for filters.

(cherry picked from commit 3802e424d9)
2024-09-17 21:00:50 +02:00
Felix Fontein
02b2070ff3
Prevent infinite loop. (#922) (#926)
(cherry picked from commit 6fcbd34e23)
2024-07-08 09:27:31 +02:00
Felix Fontein
d0aee07ab0
Docker Compose v1 tests: restrict API version to 1.44 if default API version is 1.45+ (#881) (#883)
* Restrict API version to 1.44 if default API version is 1.45+.

* Set COMPOSE_API_VERSION if api_version is provided.

* Add changelog.

(cherry picked from commit 691bc6de72)
2024-06-14 08:25:11 +02:00
Felix Fontein
e2e1bc796b
Prevent RCE via inventory plugins (#815) (#818)
* Prevent RCE via inventory plugins.

* Do not make ansible_connection unsafe.

* Add test.

(cherry picked from commit bf1281ae7f)
2024-03-14 22:09:57 +01:00
Felix Fontein
58036e5092
mac_address no longer works with Docker API v1.44+. (#764) (#768)
(cherry picked from commit 648e0652d5)
2024-01-20 14:27:04 +01:00
Felix Fontein
5f12bc97be
[stable-2] Docker SDK for Python 7+: make sure that tls_hostname is not passed, and error out if it was explicitly set (#723)
* Do not accept tls_hostname for Docker SDK for Python 7.0.0+. (#721)

(cherry picked from commit 26772304f9)

* Ignore the value 'localhost', which appens to be the default for this option.
2023-12-09 23:33:45 +01:00
patchback[bot]
fe771e5615
Docker SDK for Python 7+: make sure that ssl_version is not passed, and error out if it was explicitly set (#715) (#720)
* Do not accept ssl_version for Docker SDK for Python 7.0.0+.

* Add changelog fragment.

* Generally avoid sending None values to TLSConfig. Potentially prevents similar errors in the future, assuming the users do not pass values in.

* Python 2.6 compatibility.

(cherry picked from commit 3aa1ddcca0)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-09 22:05:31 +01:00
patchback[bot]
35de5b3c37
fix(community.docker.docker_volume): labels can be none (#702) (#704)
* fix(community.docker.docker_volume): labels can be none

catch case where volume labels can are done (default) eg:

$ docker volume inspect foo
[
    {
        "CreatedAt": "2023-11-11T12:55:23+01:00",
        "Driver": "local",
        "Labels": null,
        "Mountpoint": "/var/lib/docker/volumes/foo/_data",
        "Name": "foo",
        "Options": {},
        "Scope": "local"
    }
]

* Update plugins/modules/docker_volume.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* add(community.docker.docker_volume): changelog fragment

* Update changelogs/fragments/702-docker-volume-label-none.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 4c220c4d74)

Co-authored-by: Alexander Jähnel <alexanderjaehnel@gmail.com>
2023-11-12 12:03:29 +01:00
Felix Fontein
5f413ac778
Do not pass data_path_addr for older Docker SDK for Python versions. (#696) (#697)
(cherry picked from commit fbc2750b6a)
2023-10-14 22:10:49 +00:00
patchback[bot]
a9c1d1ce1a
Fix example of docker-compose module (#674) (#675)
(cherry picked from commit e21d6d380c)

Co-authored-by: bastantoine <bastien.antoine69+github@gmail.com>
2023-07-25 10:23:36 +02:00
patchback[bot]
2dad1d46ae
Update docker_container_exec.py documentation (#642) (#643)
Should be or not and

(cherry picked from commit 861988fd36)

Co-authored-by: Kendi <37668739+K3ndu@users.noreply.github.com>
2023-06-01 13:18:32 +02:00
patchback[bot]
c31fb79755
Fix EndpointSpec KeyError. (#637) (#638)
(cherry picked from commit 748d619fb2)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-26 21:20:18 +02:00
patchback[bot]
38a40db26a
Improve examples: use FQCNs and always add name: to tasks (#624) (#627)
* Improve examples: use FQCNs and always add name: to tasks.

* Improvements.

Co-authored-by: Don Naro <dnaro@redhat.com>

---------

Co-authored-by: Don Naro <dnaro@redhat.com>
(cherry picked from commit 7bdb2127e0)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-15 22:20:04 +02:00
patchback[bot]
8eecb6b6a8
Improve time units of docker_swarm documentation. (#623) (#625)
(cherry picked from commit 6187068ee5)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-05-13 15:36:01 +00:00
patchback[bot]
93f3bd62d0
docker_swarm: document docker_node module for manager removal (#602) (#604)
* docker_swarm: document manager removal

Add note that community.docker.swarm_node needs to
be used to demote a manager before it can be removed.

Fixes #601.

* docker_swarm: improve wording

* docker_swarm: fix formatting

(cherry picked from commit 634da44f67)

Co-authored-by: Ville Ojamo <14869000+bluikko@users.noreply.github.com>
2023-04-08 19:42:24 +02:00
patchback[bot]
88fb666d41
More true/false normalization. (#597) (#598)
(cherry picked from commit d0a3e587a5)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-06 22:36:33 +01:00
Felix Fontein
94227e2575
docker_prune: correctly return 'changed' result (#593) (#594)
* Correctly return 'changed' status.

* Extend tests.

* Fix typo.

(cherry picked from commit 08bfcf7e5f)
2023-02-24 21:24:39 +01:00
Felix Fontein
d50d6e05ca
[stable-2] Ignore more unnecessary import warnings (#587)
* Fix imports. (#585)

(cherry picked from commit a426232523)

* Add another ignore.
2023-02-12 22:32:02 +01:00
Felix Fontein
808063ddcd
[stable-2] Remove unneccessary imports (#579)
* Remove unneccessary imports (#575)

* Remove unneccessary imports.

* Add noqas.

(cherry picked from commit 54a3dc151d)

* Remove additional unnecessary import.
2023-02-09 16:09:00 +01:00
patchback[bot]
7485ec0f8b
docs: Fix json path in asserts (#560) (#562)
##### SUMMARY

The current path to the running state does not include `output.services.` which it should.

##### ISSUE TYPE

- Docs Pull Request

+label: docsite_pr

(cherry picked from commit c24ea78f6e)

Co-authored-by: David Jack Wange Olrik <david@olrik.dk>
2023-01-20 13:29:44 +01:00
Felix Fontein
40bef226c0
Improve envvar fallback handling. (#554) (#555)
(cherry picked from commit 4e6ac335f3)
2023-01-13 21:04:00 +01:00
Felix Fontein
0ffa3cc1d2
docker_plugin: do not crash when plugin doesn't exist (#553) (#556)
* Do not crash when plugin doesn't exist.

* Improve style.

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
(cherry picked from commit c7cbec0163)
2023-01-13 21:00:34 +01:00
patchback[bot]
4928828d22
Fix error handling. (#546) (#548)
(cherry picked from commit 18091193de)

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-01-05 21:15:21 +01:00
Felix Fontein
8811d9be10
Improve container detection. (#522) (#523)
(cherry picked from commit e87b327764)
2022-12-06 08:39:15 +01:00
Felix Fontein
3da9aa3b9c
[stable-2] Make current_container_facts work with newer Docker versions and latest ansible-test container changes (#512)
* Make current_container_facts work with newer Docker versions and latest ansible-test container changes (#510)

* Add more debug output.

* Add basic integration test.

* Split into lines.

* Fix docker detection, add podman detection.

ci_complete

* Improve regular expression.

* Document that this module is trying its best, but might not be perfect.

* Update comment.

(cherry picked from commit c2d84efccb)

* Remove new feature (podman support).
2022-11-30 23:01:30 +01:00
patchback[bot]
bb7f89974a
Add docstring to ImageManager.__init__ and fix docstring for ImageManager.archive_image (#509) (#511)
(cherry picked from commit ee9ddb954f)

Co-authored-by: iamjpotts <8704475+iamjpotts@users.noreply.github.com>
2022-11-30 22:14:34 +01:00
patchback[bot]
6512400b44
Fix non-matching defaults. (#494) (#496)
(cherry picked from commit 1ac3a99e7c)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-01 19:20:32 +01:00
patchback[bot]
8db6513298
added documentation to indicate docker_swarm_service does not currently support operating on stack based services. (#491) (#493)
(cherry picked from commit df864221d6)

Co-authored-by: James A. Robinson <jim.robinson@gmail.com>
2022-10-26 13:13:25 +02:00
patchback[bot]
29050ffbb8
Improve docker_compose example (#470) (#474)
* Improve compose docs.

* Also adjust inline v1 example.

(cherry picked from commit 3b41e7d6a8)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-08 06:49:21 +02:00
patchback[bot]
f901eeb57e
Clarify that BuildKit / buildx cannot be used with docker_image. (#468) (#472)
(cherry picked from commit 9458bc6e62)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-08 06:38:24 +02:00
patchback[bot]
89deaf4189
Fix two more booleans. (#464) (#465)
(cherry picked from commit 1e24120014)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-24 06:53:31 +02:00
patchback[bot]
154e1902de
Fix error formatting bug. (#448) (#450)
(cherry picked from commit f513ba2c59)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-12 14:15:40 +02:00
Felix Fontein
b29e91f866
Normalize booleans in all other plugins and modules. (#440) (#443)
(cherry picked from commit be58ccc13f)
2022-08-10 21:46:13 +02:00
patchback[bot]
81273a93f2
Normalize booleans in docker_container docs. (#439) (#442)
(cherry picked from commit 1bf8da2390)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-10 18:16:50 +02:00
patchback[bot]
855227c892
Fix docs. (#436) (#437)
(cherry picked from commit bc6757d3b8)

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-04 14:33:10 +02:00
Felix Fontein
e6d597b539 Revert "Remove deprecated functionality. (#363)"
This reverts commit 209aeb57fd.
2022-07-02 14:18:53 +02:00
Felix Fontein
57e19ca596 Revert "Remove deprecations from docker_container, bump collection version to 3.0.0 (#399)"
This reverts commit 49ce0a3cb1.
2022-07-02 14:18:48 +02:00
Felix Fontein
49ce0a3cb1
Remove deprecations from docker_container, bump collection version to 3.0.0 (#399)
* Remove deprecated features in docker_container.

* Bump collection version to 3.0.0.

* Remove 'published_ports: all' tests.
2022-07-01 19:16:22 +02:00
Felix Fontein
209aeb57fd
Remove deprecated functionality. (#363) 2022-07-01 19:02:22 +02:00
Felix Fontein
f41d7ac1b8
Move common utility code to plugins.module_utils.util (#390)
* Move common utility code to plugins.module_utils.util.

* Also adjust plugins.

* Fix import.
2022-06-20 18:39:13 +02:00
Felix Fontein
a44e0736cf
Improve API version handling. (#389) 2022-06-20 07:34:38 +02:00
seffyB
6ff739390e
Update docker_container.py (#378)
##### Correct Typo in the word compatibility
Change all occurrences of `compatiblity` to be `compatibility` as it looks to be a typo.
For example, when running a task with `command_handling: compatiblity` an error will be thrown stating an invalid value


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2022-06-01 07:38:51 +02:00
Garrit Franke
9c33aa5d12
Remove trailing space (#375)
* Remove trailing space

* Update plugins/modules/docker_compose.py

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-27 10:31:15 +02:00
Rodrigo Candido Gryzinski
497c2fda91
Add image_label_mismatch parameter to docker_container (#370)
* Add image_label_mismatch to docker_container

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* Test image_label_mismatch error message

* Add change fragment for image_label_mismatch

* Break long line in docker_container.py for pep-8 compliance

* pep8 compliance

* Update changelogs/fragments/370-add-image-label-mismatch.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix: add expected_labels to parameters_map in docker_container

* Apply suggestions from code review

* Apply suggestions from code review

* Update tests/integration/targets/docker_container/tasks/tests/options.yml

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-24 08:35:33 +02:00
Felix Fontein
401a76ff00
docker_container: fail if there are too many parts in a parsed port (#367)
* Fail if there are too many parts in a parsed port.

* Add tests.

* Prevent bad parsing.
2022-05-22 17:20:05 +02:00
Felix Fontein
7e710f743d
Bump deprecations we forgot to remove in 2.0.0. (#362) 2022-05-20 14:45:52 +02:00
Felix Fontein
fb55b1d780
Avoid breakage with Python 3.13. (#354) 2022-05-18 22:22:50 +02:00
Felix Fontein
6adc7bddf3
Add PSF-license.txt file. (#350) 2022-05-16 07:35:23 +02:00
Sasha Jenner
c63ef4116d
Support --template-driver for docker_config (#332) (#345)
* initial templating changes

* adding docs

* author

* responding to pr comments

* testing for idempotency

* using template_driver rather than templating

* adding explicit idem check

* remove local testing changes

* bug fix

* fixing idempotency

Co-authored-by: Sasha Jenner <sasha.jenner@cba.com.au>
2022-05-11 07:26:59 +02:00
chrische
98b227003e
docker_swarm: adds data_path_addr option for swarm init and swarm join (#344)
* adds data_path_addr option for swarm init and swarm join. (ansible-collections/community.docker#339)

* adds changelog fragment (ansible-collections/community.docker#339)

* adds formatting to changelog entry

Co-authored-by: Felix Fontein <felix@fontein.de>

* adds version to doc entry in ansible_swarm

Co-authored-by: Felix Fontein <felix@fontein.de>

* rewrites doc entry to formal language

Co-authored-by: Felix Fontein <felix@fontein.de>

* Correct docker api version (src: docker api docs)

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-09 20:37:27 +02:00