summaryrefslogtreecommitdiffstats
path: root/ansible_collections/community/docker
diff options
context:
space:
mode:
Diffstat (limited to 'ansible_collections/community/docker')
-rw-r--r--ansible_collections/community/docker/.azure-pipelines/azure-pipelines.yml100
-rw-r--r--ansible_collections/community/docker/.github/workflows/ansible-test.yml15
-rw-r--r--ansible_collections/community/docker/CHANGELOG.md491
-rw-r--r--ansible_collections/community/docker/CHANGELOG.rst25
-rw-r--r--ansible_collections/community/docker/FILES.json66
-rw-r--r--ansible_collections/community/docker/MANIFEST.json4
-rw-r--r--ansible_collections/community/docker/README.md2
-rw-r--r--ansible_collections/community/docker/changelogs/changelog.yaml40
-rw-r--r--ansible_collections/community/docker/docs/docsite/config.yml3
-rw-r--r--ansible_collections/community/docker/meta/ee-requirements.txt1
-rw-r--r--ansible_collections/community/docker/plugins/doc_fragments/compose_v2.py25
-rw-r--r--ansible_collections/community/docker/plugins/inventory/docker_containers.py2
-rw-r--r--ansible_collections/community/docker/plugins/inventory/docker_machine.py2
-rw-r--r--ansible_collections/community/docker/plugins/inventory/docker_swarm.py2
-rw-r--r--ansible_collections/community/docker/plugins/module_utils/_api/api/daemon.py62
-rw-r--r--ansible_collections/community/docker/plugins/module_utils/_api/utils/utils.py7
-rw-r--r--ansible_collections/community/docker/plugins/module_utils/compose_v2.py86
-rw-r--r--ansible_collections/community/docker/plugins/modules/docker_compose_v2.py16
-rw-r--r--ansible_collections/community/docker/plugins/modules/docker_compose_v2_pull.py12
-rw-r--r--ansible_collections/community/docker/plugins/plugin_utils/unsafe.py41
-rw-r--r--ansible_collections/community/docker/tests/integration/targets/docker_compose_v2/tasks/tests/definition.yml264
-rw-r--r--ansible_collections/community/docker/tests/sanity/ignore-2.17.txt3
-rw-r--r--ansible_collections/community/docker/tests/sanity/ignore-2.18.txt4
-rw-r--r--ansible_collections/community/docker/tests/sanity/ignore-2.18.txt.license3
-rw-r--r--ansible_collections/community/docker/tests/unit/plugins/module_utils/_api/api/test_client.py51
25 files changed, 882 insertions, 445 deletions
diff --git a/ansible_collections/community/docker/.azure-pipelines/azure-pipelines.yml b/ansible_collections/community/docker/.azure-pipelines/azure-pipelines.yml
index b54ccc148..e5d55cf6e 100644
--- a/ansible_collections/community/docker/.azure-pipelines/azure-pipelines.yml
+++ b/ansible_collections/community/docker/.azure-pipelines/azure-pipelines.yml
@@ -66,6 +66,17 @@ stages:
test: 'devel/sanity/extra'
- name: Units
test: 'devel/units/1'
+ - stage: Ansible_2_17
+ displayName: Sanity & Units 2.17
+ dependsOn: []
+ jobs:
+ - template: templates/matrix.yml
+ parameters:
+ targets:
+ - name: Sanity
+ test: '2.17/sanity/1'
+ - name: Units
+ test: '2.17/units/1'
- stage: Ansible_2_16
displayName: Sanity & Units 2.16
dependsOn: []
@@ -88,17 +99,6 @@ stages:
test: '2.15/sanity/1'
- name: Units
test: '2.15/units/1'
- - stage: Ansible_2_14
- displayName: Sanity & Units 2.14
- dependsOn: []
- jobs:
- - template: templates/matrix.yml
- parameters:
- targets:
- - name: Sanity
- test: '2.14/sanity/1'
- - name: Units
- test: '2.14/units/1'
### Docker
- stage: Docker_devel
@@ -115,8 +115,22 @@ stages:
test: ubuntu2004
- name: Ubuntu 22.04
test: ubuntu2204
- - name: Alpine 3
- test: alpine3
+ - name: Alpine 3.19
+ test: alpine319
+ groups:
+ - 4
+ - 5
+ - 6
+ - stage: Docker_2_17
+ displayName: Docker 2.17
+ dependsOn: []
+ jobs:
+ - template: templates/matrix.yml
+ parameters:
+ testFormat: 2.17/linux/{0}
+ targets:
+ - name: Alpine 3.19
+ test: alpine319
groups:
- 4
- 5
@@ -135,6 +149,8 @@ stages:
test: centos7
- name: openSUSE 15
test: opensuse15
+ - name: Alpine 3
+ test: alpine3
groups:
- 4
- 5
@@ -155,20 +171,6 @@ stages:
- 4
- 5
- 6
- - stage: Docker_2_14
- displayName: Docker 2.14
- dependsOn: []
- jobs:
- - template: templates/matrix.yml
- parameters:
- testFormat: 2.14/linux/{0}
- targets:
- - name: Alpine 3
- test: alpine3
- groups:
- - 4
- - 5
- - 6
### Community Docker
- stage: Docker_community_devel
@@ -210,7 +212,27 @@ stages:
- 3
- 4
- 5
- - 6
+ # - 6 -- Docker 26 no longer works with docker-compose v1
+ - stage: Remote_2_17
+ displayName: Remote 2.17
+ dependsOn: []
+ jobs:
+ - template: templates/matrix.yml
+ parameters:
+ testFormat: 2.17/{0}
+ targets:
+ - name: RHEL 9.3 with latest Docker SDK from PyPi
+ test: rhel/9.3-pypi-latest
+ # Currently always hangs in group 2
+ # - name: RHEL 8.8
+ # test: rhel/8.8
+ groups:
+ - 1
+ - 2
+ - 3
+ - 4
+ - 5
+ # - 6 -- Docker 26 no longer works with docker-compose v1
- stage: Remote_2_16
displayName: Remote 2.16
dependsOn: []
@@ -247,22 +269,6 @@ stages:
- 3
- 4
- 5
- - stage: Remote_2_14
- displayName: Remote 2.14
- dependsOn: []
- jobs:
- - template: templates/matrix.yml
- parameters:
- testFormat: 2.14/{0}
- targets:
- - name: RHEL 9.0
- test: rhel/9.0
- groups:
- - 1
- - 2
- - 3
- - 4
- - 5
## Finally
@@ -270,17 +276,17 @@ stages:
condition: succeededOrFailed()
dependsOn:
- Ansible_devel
+ - Ansible_2_17
- Ansible_2_16
- Ansible_2_15
- - Ansible_2_14
- Remote_devel
+ - Remote_2_17
- Remote_2_16
- Remote_2_15
- - Remote_2_14
- Docker_devel
+ - Docker_2_17
- Docker_2_16
- Docker_2_15
- - Docker_2_14
- Docker_community_devel
jobs:
- template: templates/coverage.yml
diff --git a/ansible_collections/community/docker/.github/workflows/ansible-test.yml b/ansible_collections/community/docker/.github/workflows/ansible-test.yml
index d8910d9f6..d0f253d35 100644
--- a/ansible_collections/community/docker/.github/workflows/ansible-test.yml
+++ b/ansible_collections/community/docker/.github/workflows/ansible-test.yml
@@ -32,6 +32,7 @@ jobs:
- '2.11'
- '2.12'
- '2.13'
+ - '2.14'
# Ansible-test on various stable branches does not yet work well with cgroups v2.
# Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04
# image for these stable branches. The list of branches where this is necessary will
@@ -72,6 +73,7 @@ jobs:
- '2.11'
- '2.12'
- '2.13'
+ - '2.14'
steps:
- name: Perform unit testing against Ansible version ${{ matrix.ansible }}
@@ -214,6 +216,19 @@ jobs:
docker: alpine3
python: ''
target: azp/6/
+ # 2.14
+ - ansible: '2.14'
+ docker: alpine3
+ python: ''
+ target: azp/4/
+ - ansible: '2.14'
+ docker: alpine3
+ python: ''
+ target: azp/5/
+ - ansible: '2.14'
+ docker: alpine3
+ python: ''
+ target: azp/6/
steps:
- name: Perform integration testing against Ansible version ${{ matrix.ansible }} under Python ${{ matrix.python }}
diff --git a/ansible_collections/community/docker/CHANGELOG.md b/ansible_collections/community/docker/CHANGELOG.md
index 2e232e769..f3a4b7af6 100644
--- a/ansible_collections/community/docker/CHANGELOG.md
+++ b/ansible_collections/community/docker/CHANGELOG.md
@@ -2,232 +2,259 @@
**Topics**
-- <a href="#v3-8-1">v3\.8\.1</a>
+- <a href="#v3-9-0">v3\.9\.0</a>
- <a href="#release-summary">Release Summary</a>
- - <a href="#security-fixes">Security Fixes</a>
+ - <a href="#minor-changes">Minor Changes</a>
- <a href="#bugfixes">Bugfixes</a>
-- <a href="#v3-8-0">v3\.8\.0</a>
+- <a href="#v3-8-1">v3\.8\.1</a>
- <a href="#release-summary-1">Release Summary</a>
- - <a href="#minor-changes">Minor Changes</a>
+ - <a href="#security-fixes">Security Fixes</a>
- <a href="#bugfixes-1">Bugfixes</a>
-- <a href="#v3-7-0">v3\.7\.0</a>
+- <a href="#v3-8-0">v3\.8\.0</a>
- <a href="#release-summary-2">Release Summary</a>
- <a href="#minor-changes-1">Minor Changes</a>
- <a href="#bugfixes-2">Bugfixes</a>
- - <a href="#new-modules">New Modules</a>
-- <a href="#v3-6-0">v3\.6\.0</a>
+- <a href="#v3-7-0">v3\.7\.0</a>
- <a href="#release-summary-3">Release Summary</a>
- - <a href="#major-changes">Major Changes</a>
- <a href="#minor-changes-2">Minor Changes</a>
- <a href="#bugfixes-3">Bugfixes</a>
- - <a href="#new-modules-1">New Modules</a>
-- <a href="#v3-5-0">v3\.5\.0</a>
+ - <a href="#new-modules">New Modules</a>
+- <a href="#v3-6-0">v3\.6\.0</a>
- <a href="#release-summary-4">Release Summary</a>
+ - <a href="#major-changes">Major Changes</a>
- <a href="#minor-changes-3">Minor Changes</a>
- - <a href="#deprecated-features">Deprecated Features</a>
- <a href="#bugfixes-4">Bugfixes</a>
-- <a href="#v3-4-11">v3\.4\.11</a>
+ - <a href="#new-modules-1">New Modules</a>
+- <a href="#v3-5-0">v3\.5\.0</a>
- <a href="#release-summary-5">Release Summary</a>
+ - <a href="#minor-changes-4">Minor Changes</a>
+ - <a href="#deprecated-features">Deprecated Features</a>
- <a href="#bugfixes-5">Bugfixes</a>
-- <a href="#v3-4-10">v3\.4\.10</a>
+- <a href="#v3-4-11">v3\.4\.11</a>
- <a href="#release-summary-6">Release Summary</a>
- <a href="#bugfixes-6">Bugfixes</a>
-- <a href="#v3-4-9">v3\.4\.9</a>
+- <a href="#v3-4-10">v3\.4\.10</a>
- <a href="#release-summary-7">Release Summary</a>
- <a href="#bugfixes-7">Bugfixes</a>
-- <a href="#v3-4-8">v3\.4\.8</a>
+- <a href="#v3-4-9">v3\.4\.9</a>
- <a href="#release-summary-8">Release Summary</a>
+ - <a href="#bugfixes-8">Bugfixes</a>
+- <a href="#v3-4-8">v3\.4\.8</a>
+ - <a href="#release-summary-9">Release Summary</a>
- <a href="#known-issues">Known Issues</a>
- <a href="#v3-4-7">v3\.4\.7</a>
- - <a href="#release-summary-9">Release Summary</a>
- - <a href="#bugfixes-8">Bugfixes</a>
-- <a href="#v3-4-6">v3\.4\.6</a>
- <a href="#release-summary-10">Release Summary</a>
- <a href="#bugfixes-9">Bugfixes</a>
- - <a href="#known-issues-1">Known Issues</a>
-- <a href="#v3-4-5">v3\.4\.5</a>
+- <a href="#v3-4-6">v3\.4\.6</a>
- <a href="#release-summary-11">Release Summary</a>
- <a href="#bugfixes-10">Bugfixes</a>
-- <a href="#v3-4-4">v3\.4\.4</a>
+ - <a href="#known-issues-1">Known Issues</a>
+- <a href="#v3-4-5">v3\.4\.5</a>
- <a href="#release-summary-12">Release Summary</a>
- - <a href="#minor-changes-4">Minor Changes</a>
+ - <a href="#bugfixes-11">Bugfixes</a>
+- <a href="#v3-4-4">v3\.4\.4</a>
+ - <a href="#release-summary-13">Release Summary</a>
+ - <a href="#minor-changes-5">Minor Changes</a>
- <a href="#known-issues-2">Known Issues</a>
- <a href="#v3-4-3">v3\.4\.3</a>
- - <a href="#release-summary-13">Release Summary</a>
-- <a href="#v3-4-2">v3\.4\.2</a>
- <a href="#release-summary-14">Release Summary</a>
- - <a href="#bugfixes-11">Bugfixes</a>
-- <a href="#v3-4-1">v3\.4\.1</a>
+- <a href="#v3-4-2">v3\.4\.2</a>
- <a href="#release-summary-15">Release Summary</a>
- <a href="#bugfixes-12">Bugfixes</a>
-- <a href="#v3-4-0">v3\.4\.0</a>
+- <a href="#v3-4-1">v3\.4\.1</a>
- <a href="#release-summary-16">Release Summary</a>
- - <a href="#minor-changes-5">Minor Changes</a>
- <a href="#bugfixes-13">Bugfixes</a>
- - <a href="#new-modules-2">New Modules</a>
-- <a href="#v3-3-2">v3\.3\.2</a>
+- <a href="#v3-4-0">v3\.4\.0</a>
- <a href="#release-summary-17">Release Summary</a>
+ - <a href="#minor-changes-6">Minor Changes</a>
- <a href="#bugfixes-14">Bugfixes</a>
-- <a href="#v3-3-1">v3\.3\.1</a>
+ - <a href="#new-modules-2">New Modules</a>
+- <a href="#v3-3-2">v3\.3\.2</a>
- <a href="#release-summary-18">Release Summary</a>
- <a href="#bugfixes-15">Bugfixes</a>
-- <a href="#v3-3-0">v3\.3\.0</a>
+- <a href="#v3-3-1">v3\.3\.1</a>
- <a href="#release-summary-19">Release Summary</a>
- - <a href="#minor-changes-6">Minor Changes</a>
- <a href="#bugfixes-16">Bugfixes</a>
-- <a href="#v3-2-2">v3\.2\.2</a>
+- <a href="#v3-3-0">v3\.3\.0</a>
- <a href="#release-summary-20">Release Summary</a>
+ - <a href="#minor-changes-7">Minor Changes</a>
- <a href="#bugfixes-17">Bugfixes</a>
-- <a href="#v3-2-1">v3\.2\.1</a>
+- <a href="#v3-2-2">v3\.2\.2</a>
- <a href="#release-summary-21">Release Summary</a>
-- <a href="#v3-2-0">v3\.2\.0</a>
+ - <a href="#bugfixes-18">Bugfixes</a>
+- <a href="#v3-2-1">v3\.2\.1</a>
- <a href="#release-summary-22">Release Summary</a>
- - <a href="#minor-changes-7">Minor Changes</a>
- - <a href="#deprecated-features-1">Deprecated Features</a>
-- <a href="#v3-1-0">v3\.1\.0</a>
+- <a href="#v3-2-0">v3\.2\.0</a>
- <a href="#release-summary-23">Release Summary</a>
- <a href="#minor-changes-8">Minor Changes</a>
-- <a href="#v3-0-2">v3\.0\.2</a>
+ - <a href="#deprecated-features-1">Deprecated Features</a>
+- <a href="#v3-1-0">v3\.1\.0</a>
- <a href="#release-summary-24">Release Summary</a>
- - <a href="#bugfixes-18">Bugfixes</a>
-- <a href="#v3-0-1">v3\.0\.1</a>
+ - <a href="#minor-changes-9">Minor Changes</a>
+- <a href="#v3-0-2">v3\.0\.2</a>
- <a href="#release-summary-25">Release Summary</a>
- <a href="#bugfixes-19">Bugfixes</a>
-- <a href="#v3-0-0">v3\.0\.0</a>
+- <a href="#v3-0-1">v3\.0\.1</a>
- <a href="#release-summary-26">Release Summary</a>
+ - <a href="#bugfixes-20">Bugfixes</a>
+- <a href="#v3-0-0">v3\.0\.0</a>
+ - <a href="#release-summary-27">Release Summary</a>
- <a href="#major-changes-1">Major Changes</a>
- - <a href="#minor-changes-9">Minor Changes</a>
+ - <a href="#minor-changes-10">Minor Changes</a>
- <a href="#breaking-changes--porting-guide">Breaking Changes / Porting Guide</a>
- <a href="#removed-features-previously-deprecated">Removed Features \(previously deprecated\)</a>
- <a href="#security-fixes-1">Security Fixes</a>
- - <a href="#bugfixes-20">Bugfixes</a>
-- <a href="#v2-7-0">v2\.7\.0</a>
- - <a href="#release-summary-27">Release Summary</a>
- - <a href="#minor-changes-10">Minor Changes</a>
- - <a href="#deprecated-features-2">Deprecated Features</a>
- <a href="#bugfixes-21">Bugfixes</a>
-- <a href="#v2-6-0">v2\.6\.0</a>
+- <a href="#v2-7-0">v2\.7\.0</a>
- <a href="#release-summary-28">Release Summary</a>
- <a href="#minor-changes-11">Minor Changes</a>
- - <a href="#deprecated-features-3">Deprecated Features</a>
+ - <a href="#deprecated-features-2">Deprecated Features</a>
- <a href="#bugfixes-22">Bugfixes</a>
-- <a href="#v2-5-1">v2\.5\.1</a>
+- <a href="#v2-6-0">v2\.6\.0</a>
- <a href="#release-summary-29">Release Summary</a>
+ - <a href="#minor-changes-12">Minor Changes</a>
+ - <a href="#deprecated-features-3">Deprecated Features</a>
- <a href="#bugfixes-23">Bugfixes</a>
-- <a href="#v2-5-0">v2\.5\.0</a>
+- <a href="#v2-5-1">v2\.5\.1</a>
- <a href="#release-summary-30">Release Summary</a>
- - <a href="#minor-changes-12">Minor Changes</a>
-- <a href="#v2-4-0">v2\.4\.0</a>
+ - <a href="#bugfixes-24">Bugfixes</a>
+- <a href="#v2-5-0">v2\.5\.0</a>
- <a href="#release-summary-31">Release Summary</a>
- <a href="#minor-changes-13">Minor Changes</a>
- - <a href="#bugfixes-24">Bugfixes</a>
-- <a href="#v2-3-0">v2\.3\.0</a>
+- <a href="#v2-4-0">v2\.4\.0</a>
- <a href="#release-summary-32">Release Summary</a>
- <a href="#minor-changes-14">Minor Changes</a>
- <a href="#bugfixes-25">Bugfixes</a>
-- <a href="#v2-2-1">v2\.2\.1</a>
+- <a href="#v2-3-0">v2\.3\.0</a>
- <a href="#release-summary-33">Release Summary</a>
+ - <a href="#minor-changes-15">Minor Changes</a>
- <a href="#bugfixes-26">Bugfixes</a>
-- <a href="#v2-2-0">v2\.2\.0</a>
+- <a href="#v2-2-1">v2\.2\.1</a>
- <a href="#release-summary-34">Release Summary</a>
- - <a href="#minor-changes-15">Minor Changes</a>
- <a href="#bugfixes-27">Bugfixes</a>
-- <a href="#v2-1-1">v2\.1\.1</a>
+- <a href="#v2-2-0">v2\.2\.0</a>
- <a href="#release-summary-35">Release Summary</a>
+ - <a href="#minor-changes-16">Minor Changes</a>
- <a href="#bugfixes-28">Bugfixes</a>
-- <a href="#v2-1-0">v2\.1\.0</a>
+- <a href="#v2-1-1">v2\.1\.1</a>
- <a href="#release-summary-36">Release Summary</a>
- - <a href="#minor-changes-16">Minor Changes</a>
- <a href="#bugfixes-29">Bugfixes</a>
-- <a href="#v2-0-2">v2\.0\.2</a>
+- <a href="#v2-1-0">v2\.1\.0</a>
- <a href="#release-summary-37">Release Summary</a>
+ - <a href="#minor-changes-17">Minor Changes</a>
- <a href="#bugfixes-30">Bugfixes</a>
-- <a href="#v2-0-1">v2\.0\.1</a>
+- <a href="#v2-0-2">v2\.0\.2</a>
- <a href="#release-summary-38">Release Summary</a>
-- <a href="#v2-0-0">v2\.0\.0</a>
+ - <a href="#bugfixes-31">Bugfixes</a>
+- <a href="#v2-0-1">v2\.0\.1</a>
- <a href="#release-summary-39">Release Summary</a>
+- <a href="#v2-0-0">v2\.0\.0</a>
+ - <a href="#release-summary-40">Release Summary</a>
- <a href="#breaking-changes--porting-guide-1">Breaking Changes / Porting Guide</a>
- <a href="#deprecated-features-4">Deprecated Features</a>
- <a href="#removed-features-previously-deprecated-1">Removed Features \(previously deprecated\)</a>
- <a href="#v1-10-0">v1\.10\.0</a>
- - <a href="#release-summary-40">Release Summary</a>
- - <a href="#minor-changes-17">Minor Changes</a>
-- <a href="#v1-9-1">v1\.9\.1</a>
- <a href="#release-summary-41">Release Summary</a>
- - <a href="#bugfixes-31">Bugfixes</a>
-- <a href="#v1-9-0">v1\.9\.0</a>
- - <a href="#release-summary-42">Release Summary</a>
- <a href="#minor-changes-18">Minor Changes</a>
- - <a href="#deprecated-features-5">Deprecated Features</a>
+- <a href="#v1-9-1">v1\.9\.1</a>
+ - <a href="#release-summary-42">Release Summary</a>
- <a href="#bugfixes-32">Bugfixes</a>
- - <a href="#new-plugins">New Plugins</a>
- - <a href="#connection">Connection</a>
-- <a href="#v1-8-0">v1\.8\.0</a>
+- <a href="#v1-9-0">v1\.9\.0</a>
- <a href="#release-summary-43">Release Summary</a>
- <a href="#minor-changes-19">Minor Changes</a>
+ - <a href="#deprecated-features-5">Deprecated Features</a>
- <a href="#bugfixes-33">Bugfixes</a>
-- <a href="#v1-7-0">v1\.7\.0</a>
+ - <a href="#new-plugins">New Plugins</a>
+ - <a href="#connection">Connection</a>
+- <a href="#v1-8-0">v1\.8\.0</a>
- <a href="#release-summary-44">Release Summary</a>
- <a href="#minor-changes-20">Minor Changes</a>
-- <a href="#v1-6-1">v1\.6\.1</a>
- - <a href="#release-summary-45">Release Summary</a>
- <a href="#bugfixes-34">Bugfixes</a>
-- <a href="#v1-6-0">v1\.6\.0</a>
- - <a href="#release-summary-46">Release Summary</a>
+- <a href="#v1-7-0">v1\.7\.0</a>
+ - <a href="#release-summary-45">Release Summary</a>
- <a href="#minor-changes-21">Minor Changes</a>
- - <a href="#deprecated-features-6">Deprecated Features</a>
+- <a href="#v1-6-1">v1\.6\.1</a>
+ - <a href="#release-summary-46">Release Summary</a>
- <a href="#bugfixes-35">Bugfixes</a>
-- <a href="#v1-5-0">v1\.5\.0</a>
+- <a href="#v1-6-0">v1\.6\.0</a>
- <a href="#release-summary-47">Release Summary</a>
- <a href="#minor-changes-22">Minor Changes</a>
+ - <a href="#deprecated-features-6">Deprecated Features</a>
- <a href="#bugfixes-36">Bugfixes</a>
- - <a href="#new-modules-3">New Modules</a>
-- <a href="#v1-4-0">v1\.4\.0</a>
+- <a href="#v1-5-0">v1\.5\.0</a>
- <a href="#release-summary-48">Release Summary</a>
- <a href="#minor-changes-23">Minor Changes</a>
- - <a href="#breaking-changes--porting-guide-2">Breaking Changes / Porting Guide</a>
- - <a href="#security-fixes-2">Security Fixes</a>
- <a href="#bugfixes-37">Bugfixes</a>
-- <a href="#v1-3-0">v1\.3\.0</a>
+ - <a href="#new-modules-3">New Modules</a>
+- <a href="#v1-4-0">v1\.4\.0</a>
- <a href="#release-summary-49">Release Summary</a>
- <a href="#minor-changes-24">Minor Changes</a>
+ - <a href="#breaking-changes--porting-guide-2">Breaking Changes / Porting Guide</a>
+ - <a href="#security-fixes-2">Security Fixes</a>
- <a href="#bugfixes-38">Bugfixes</a>
+- <a href="#v1-3-0">v1\.3\.0</a>
+ - <a href="#release-summary-50">Release Summary</a>
+ - <a href="#minor-changes-25">Minor Changes</a>
+ - <a href="#bugfixes-39">Bugfixes</a>
- <a href="#new-modules-4">New Modules</a>
- <a href="#v1-2-2">v1\.2\.2</a>
- - <a href="#release-summary-50">Release Summary</a>
+ - <a href="#release-summary-51">Release Summary</a>
- <a href="#security-fixes-3">Security Fixes</a>
- <a href="#v1-2-1">v1\.2\.1</a>
- - <a href="#release-summary-51">Release Summary</a>
- - <a href="#bugfixes-39">Bugfixes</a>
-- <a href="#v1-2-0">v1\.2\.0</a>
- <a href="#release-summary-52">Release Summary</a>
- - <a href="#minor-changes-25">Minor Changes</a>
- <a href="#bugfixes-40">Bugfixes</a>
-- <a href="#v1-1-0">v1\.1\.0</a>
+- <a href="#v1-2-0">v1\.2\.0</a>
- <a href="#release-summary-53">Release Summary</a>
- <a href="#minor-changes-26">Minor Changes</a>
- - <a href="#deprecated-features-7">Deprecated Features</a>
- <a href="#bugfixes-41">Bugfixes</a>
+- <a href="#v1-1-0">v1\.1\.0</a>
+ - <a href="#release-summary-54">Release Summary</a>
+ - <a href="#minor-changes-27">Minor Changes</a>
+ - <a href="#deprecated-features-7">Deprecated Features</a>
+ - <a href="#bugfixes-42">Bugfixes</a>
- <a href="#new-plugins-1">New Plugins</a>
- <a href="#connection-1">Connection</a>
- <a href="#inventory">Inventory</a>
- <a href="#new-modules-5">New Modules</a>
- <a href="#v1-0-1">v1\.0\.1</a>
- - <a href="#release-summary-54">Release Summary</a>
- - <a href="#bugfixes-42">Bugfixes</a>
-- <a href="#v1-0-0">v1\.0\.0</a>
- <a href="#release-summary-55">Release Summary</a>
- - <a href="#minor-changes-27">Minor Changes</a>
-- <a href="#v0-1-0">v0\.1\.0</a>
+ - <a href="#bugfixes-43">Bugfixes</a>
+- <a href="#v1-0-0">v1\.0\.0</a>
- <a href="#release-summary-56">Release Summary</a>
- <a href="#minor-changes-28">Minor Changes</a>
+- <a href="#v0-1-0">v0\.1\.0</a>
+ - <a href="#release-summary-57">Release Summary</a>
+ - <a href="#minor-changes-29">Minor Changes</a>
- <a href="#removed-features-previously-deprecated-2">Removed Features \(previously deprecated\)</a>
- - <a href="#bugfixes-43">Bugfixes</a>
+ - <a href="#bugfixes-44">Bugfixes</a>
+
+<a id="v3-9-0"></a>
+## v3\.9\.0
+
+<a id="release-summary"></a>
+### Release Summary
+
+Bugfix and feature release\.
+
+<a id="minor-changes"></a>
+### Minor Changes
+
+* The EE requirements now include PyYAML\, since the <code>docker\_compose\_v2\*</code> modules depend on it when the <code>definition</code> option is used\. This should not have a noticable effect on generated EEs since ansible\-core itself depends on PyYAML as well\, and ansible\-builder explicitly ignores this dependency \([https\://github\.com/ansible\-collections/community\.docker/pull/832](https\://github\.com/ansible\-collections/community\.docker/pull/832)\)\.
+* docker\_compose\_v2\* \- the new option <code>check\_files\_existing</code> allows to disable the check for one of the files <code>compose\.yaml</code>\, <code>compose\.yml</code>\, <code>docker\-compose\.yaml</code>\, and <code>docker\-compose\.yml</code> in <code>project\_src</code> if <code>files</code> is not specified\. This is necessary if a non\-standard compose filename is specified through other means\, like the <code>COMPOSE\_FILE</code> environment variable \([https\://github\.com/ansible\-collections/community\.docker/issues/838](https\://github\.com/ansible\-collections/community\.docker/issues/838)\, [https\://github\.com/ansible\-collections/community\.docker/pull/839](https\://github\.com/ansible\-collections/community\.docker/pull/839)\)\.
+* docker\_compose\_v2\* modules \- allow to provide an inline definition of the compose content instead of having to provide a <code>project\_src</code> directory with the compose file written into it \([https\://github\.com/ansible\-collections/community\.docker/issues/829](https\://github\.com/ansible\-collections/community\.docker/issues/829)\, [https\://github\.com/ansible\-collections/community\.docker/pull/832](https\://github\.com/ansible\-collections/community\.docker/pull/832)\)\.
+* vendored Docker SDK for Python \- remove unused code that relies on functionality deprecated in Python 3\.12 \([https\://github\.com/ansible\-collections/community\.docker/pull/834](https\://github\.com/ansible\-collections/community\.docker/pull/834)\)\.
+
+<a id="bugfixes"></a>
+### Bugfixes
+
+* docker\_compose\_v2\* \- allow <code>project\_src</code> to be a relative path\, by converting it to an absolute path before using it \([https\://github\.com/ansible\-collections/community\.docker/issues/827](https\://github\.com/ansible\-collections/community\.docker/issues/827)\, [https\://github\.com/ansible\-collections/community\.docker/pull/828](https\://github\.com/ansible\-collections/community\.docker/pull/828)\)\.
+* docker\_compose\_v2\* modules \- abort with a nice error message instead of crash when the Docker Compose CLI plugin version is <code>dev</code> \([https\://github\.com/ansible\-collections/community\.docker/issues/825](https\://github\.com/ansible\-collections/community\.docker/issues/825)\, [https\://github\.com/ansible\-collections/community\.docker/pull/826](https\://github\.com/ansible\-collections/community\.docker/pull/826)\)\.
+* inventory plugins \- add unsafe wrapper to avoid marking strings that do not contain <code>\{</code> or <code>\}</code> as unsafe\, to work around a bug in AWX \([https\://github\.com/ansible\-collections/community\.docker/pull/835](https\://github\.com/ansible\-collections/community\.docker/pull/835)\)\.
<a id="v3-8-1"></a>
## v3\.8\.1
-<a id="release-summary"></a>
+<a id="release-summary-1"></a>
### Release Summary
Bugfix release
@@ -237,7 +264,7 @@ Bugfix release
* docker\_containers\, docker\_machine\, and docker\_swarm inventory plugins \- make sure all data received from the Docker daemon / Docker machine is marked as unsafe\, so remote code execution by obtaining texts that can be evaluated as templates is not possible \([https\://www\.die\-welt\.net/2024/03/remote\-code\-execution\-in\-ansible\-dynamic\-inventory\-plugins/](https\://www\.die\-welt\.net/2024/03/remote\-code\-execution\-in\-ansible\-dynamic\-inventory\-plugins/)\, [https\://github\.com/ansible\-collections/community\.docker/pull/815](https\://github\.com/ansible\-collections/community\.docker/pull/815)\)\.
-<a id="bugfixes"></a>
+<a id="bugfixes-1"></a>
### Bugfixes
* docker\_compose\_v2 \- do not fail when non\-fatal errors occur\. This can happen when pulling an image fails\, but then the image can be built for another service\. Docker Compose emits an error in that case\, but <code>docker compose up</code> still completes successfully \([https\://github\.com/ansible\-collections/community\.docker/issues/807](https\://github\.com/ansible\-collections/community\.docker/issues/807)\, [https\://github\.com/ansible\-collections/community\.docker/pull/810](https\://github\.com/ansible\-collections/community\.docker/pull/810)\, [https\://github\.com/ansible\-collections/community\.docker/pull/811](https\://github\.com/ansible\-collections/community\.docker/pull/811)\)\.
@@ -248,19 +275,19 @@ Bugfix release
<a id="v3-8-0"></a>
## v3\.8\.0
-<a id="release-summary-1"></a>
+<a id="release-summary-2"></a>
### Release Summary
Bugfix and feature release\.
-<a id="minor-changes"></a>
+<a id="minor-changes-1"></a>
### Minor Changes
* docker\_compose\_v2 \- allow to wait until containers are running/health when running <code>docker compose up</code> with the new <code>wait</code> option \([https\://github\.com/ansible\-collections/community\.docker/issues/794](https\://github\.com/ansible\-collections/community\.docker/issues/794)\, [https\://github\.com/ansible\-collections/community\.docker/pull/796](https\://github\.com/ansible\-collections/community\.docker/pull/796)\)\.
* docker\_container \- the <code>pull\_check\_mode\_behavior</code> option now allows to control the module\'s behavior in check mode when <code>pull\=always</code> \([https\://github\.com/ansible\-collections/community\.docker/issues/792](https\://github\.com/ansible\-collections/community\.docker/issues/792)\, [https\://github\.com/ansible\-collections/community\.docker/pull/797](https\://github\.com/ansible\-collections/community\.docker/pull/797)\)\.
* docker\_container \- the <code>pull</code> option now accepts the three values <code>never</code>\, <code>missing\_image</code> \(default\)\, and <code>never</code>\, next to the previously valid values <code>true</code> \(equivalent to <code>always</code>\) and <code>false</code> \(equivalent to <code>missing\_image</code>\)\. This allows the equivalent to <code>\-\-pull\=never</code> from the Docker command line \([https\://github\.com/ansible\-collections/community\.docker/issues/783](https\://github\.com/ansible\-collections/community\.docker/issues/783)\, [https\://github\.com/ansible\-collections/community\.docker/pull/797](https\://github\.com/ansible\-collections/community\.docker/pull/797)\)\.
-<a id="bugfixes-1"></a>
+<a id="bugfixes-2"></a>
### Bugfixes
* docker\_compose\_v2 \- do not consider a <code>Waiting</code> event as an action/change \([https\://github\.com/ansible\-collections/community\.docker/pull/804](https\://github\.com/ansible\-collections/community\.docker/pull/804)\)\.
@@ -270,18 +297,18 @@ Bugfix and feature release\.
<a id="v3-7-0"></a>
## v3\.7\.0
-<a id="release-summary-2"></a>
+<a id="release-summary-3"></a>
### Release Summary
Bugfix and feature release\.
-<a id="minor-changes-1"></a>
+<a id="minor-changes-2"></a>
### Minor Changes
* docker\_compose\_v2 \- add <code>scale</code> option to allow to explicitly scale services \([https\://github\.com/ansible\-collections/community\.docker/pull/776](https\://github\.com/ansible\-collections/community\.docker/pull/776)\)\.
* docker\_compose\_v2\, docker\_compose\_v2\_pull \- support <code>files</code> parameter to specify multiple Compose files \([https\://github\.com/ansible\-collections/community\.docker/issues/772](https\://github\.com/ansible\-collections/community\.docker/issues/772)\, [https\://github\.com/ansible\-collections/community\.docker/pull/775](https\://github\.com/ansible\-collections/community\.docker/pull/775)\)\.
-<a id="bugfixes-2"></a>
+<a id="bugfixes-3"></a>
### Bugfixes
* docker\_compose\_v2 \- properly parse dry\-run build events from <code>stderr</code> \([https\://github\.com/ansible\-collections/community\.docker/issues/778](https\://github\.com/ansible\-collections/community\.docker/issues/778)\, [https\://github\.com/ansible\-collections/community\.docker/pull/779](https\://github\.com/ansible\-collections/community\.docker/pull/779)\)\.
@@ -295,7 +322,7 @@ Bugfix and feature release\.
<a id="v3-6-0"></a>
## v3\.6\.0
-<a id="release-summary-3"></a>
+<a id="release-summary-4"></a>
### Release Summary
Bugfix and feature release\.
@@ -315,7 +342,7 @@ so the main difference is that instead of some Python requirements\, they depend
* The <code>community\.docker</code> collection now depends on the <code>community\.library\_inventory\_filtering\_v1</code> collection\. This utility collection provides host filtering functionality for inventory plugins\. If you use the Ansible community package\, both collections are included and you do not have to do anything special\. If you install the collection with <code>ansible\-galaxy collection install</code>\, it will be installed automatically\. If you install the collection by copying the files of the collection to a place where ansible\-core can find it\, for example by cloning the git repository\, you need to make sure that you also have to install the dependency if you are using the inventory plugins \([https\://github\.com/ansible\-collections/community\.docker/pull/698](https\://github\.com/ansible\-collections/community\.docker/pull/698)\)\.
-<a id="minor-changes-2"></a>
+<a id="minor-changes-3"></a>
### Minor Changes
* The <code>ca\_cert</code> option available to almost all modules and plugins has been renamed to <code>ca\_path</code>\. The name <code>ca\_path</code> is also used for similar options in ansible\-core and other collections\. The old name has been added as an alias and can still be used \([https\://github\.com/ansible\-collections/community\.docker/pull/744](https\://github\.com/ansible\-collections/community\.docker/pull/744)\)\.
@@ -325,7 +352,7 @@ so the main difference is that instead of some Python requirements\, they depend
* docker\_image \- allow to specify memory size and swap memory size in other units than bytes \([https\://github\.com/ansible\-collections/community\.docker/pull/727](https\://github\.com/ansible\-collections/community\.docker/pull/727)\)\.
* inventory plugins \- add <code>filter</code> option which allows to include and exclude hosts based on Jinja2 conditions \([https\://github\.com/ansible\-collections/community\.docker/pull/698](https\://github\.com/ansible\-collections/community\.docker/pull/698)\, [https\://github\.com/ansible\-collections/community\.docker/issues/610](https\://github\.com/ansible\-collections/community\.docker/issues/610)\)\.
-<a id="bugfixes-3"></a>
+<a id="bugfixes-4"></a>
### Bugfixes
* Use <code>unix\:///var/run/docker\.sock</code> instead of the legacy <code>unix\://var/run/docker\.sock</code> as default for <code>docker\_host</code> \([https\://github\.com/ansible\-collections/community\.docker/pull/736](https\://github\.com/ansible\-collections/community\.docker/pull/736)\)\.
@@ -345,12 +372,12 @@ so the main difference is that instead of some Python requirements\, they depend
<a id="v3-5-0"></a>
## v3\.5\.0
-<a id="release-summary-4"></a>
+<a id="release-summary-5"></a>
### Release Summary
Bugfix and feature release\.
-<a id="minor-changes-3"></a>
+<a id="minor-changes-4"></a>
### Minor Changes
* docker\_container \- implement better <code>platform</code> string comparisons to improve idempotency \([https\://github\.com/ansible\-collections/community\.docker/issues/654](https\://github\.com/ansible\-collections/community\.docker/issues/654)\, [https\://github\.com/ansible\-collections/community\.docker/pull/705](https\://github\.com/ansible\-collections/community\.docker/pull/705)\)\.
@@ -361,7 +388,7 @@ Bugfix and feature release\.
* docker\_container \- the default <code>ignore</code> for the <code>image\_name\_mismatch</code> parameter has been deprecated and will switch to <code>recreate</code> in community\.docker 4\.0\.0\. A deprecation warning will be printed in situations where the default value is used and where a behavior would change once the default changes \([https\://github\.com/ansible\-collections/community\.docker/pull/703](https\://github\.com/ansible\-collections/community\.docker/pull/703)\)\.
-<a id="bugfixes-4"></a>
+<a id="bugfixes-5"></a>
### Bugfixes
* modules and plugins using the Docker SDK for Python \- remove <code>ssl\_version</code> from the parameters passed to Docker SDK for Python 7\.0\.0\+\. Explicitly fail with a nicer error message if it was explicitly set in this case \([https\://github\.com/ansible\-collections/community\.docker/pull/715](https\://github\.com/ansible\-collections/community\.docker/pull/715)\)\.
@@ -371,12 +398,12 @@ Bugfix and feature release\.
<a id="v3-4-11"></a>
## v3\.4\.11
-<a id="release-summary-5"></a>
+<a id="release-summary-6"></a>
### Release Summary
Bugfix release\.
-<a id="bugfixes-5"></a>
+<a id="bugfixes-6"></a>
### Bugfixes
* docker\_volume \- fix crash caused by accessing an empty dictionary\. The <code>has\_different\_config\(\)</code> was raising an <code>AttributeError</code> because the <code>self\.existing\_volume\[\"Labels\"\]</code> dictionary was <code>None</code> \([https\://github\.com/ansible\-collections/community\.docker/pull/702](https\://github\.com/ansible\-collections/community\.docker/pull/702)\)\.
@@ -384,12 +411,12 @@ Bugfix release\.
<a id="v3-4-10"></a>
## v3\.4\.10
-<a id="release-summary-6"></a>
+<a id="release-summary-7"></a>
### Release Summary
Bugfix release\.
-<a id="bugfixes-6"></a>
+<a id="bugfixes-7"></a>
### Bugfixes
* docker\_swarm \- make init and join operations work again with Docker SDK for Python before 4\.0\.0 \([https\://github\.com/ansible\-collections/community\.docker/issues/695](https\://github\.com/ansible\-collections/community\.docker/issues/695)\, [https\://github\.com/ansible\-collections/community\.docker/pull/696](https\://github\.com/ansible\-collections/community\.docker/pull/696)\)\.
@@ -397,12 +424,12 @@ Bugfix release\.
<a id="v3-4-9"></a>
## v3\.4\.9
-<a id="release-summary-7"></a>
+<a id="release-summary-8"></a>
### Release Summary
Maintenance release with updated documentation and vendored Docker SDK for Python code\.
-<a id="bugfixes-7"></a>
+<a id="bugfixes-8"></a>
### Bugfixes
* vendored Docker SDK for Python code \- cherry\-pick changes from the Docker SDK for Python code to align code\. These changes should not affect the parts used by the collection\'s code \([https\://github\.com/ansible\-collections/community\.docker/pull/694](https\://github\.com/ansible\-collections/community\.docker/pull/694)\)\.
@@ -410,7 +437,7 @@ Maintenance release with updated documentation and vendored Docker SDK for Pytho
<a id="v3-4-8"></a>
## v3\.4\.8
-<a id="release-summary-8"></a>
+<a id="release-summary-9"></a>
### Release Summary
Maintenance release with updated documentation\.
@@ -431,12 +458,12 @@ for the rendered HTML version of the documentation of the latest release\.
<a id="v3-4-7"></a>
## v3\.4\.7
-<a id="release-summary-9"></a>
+<a id="release-summary-10"></a>
### Release Summary
Bugfix release\.
-<a id="bugfixes-8"></a>
+<a id="bugfixes-9"></a>
### Bugfixes
* docker\_swarm\_info \- if <code>service\=true</code> is used\, do not crash when a service without an endpoint spec is encountered \([https\://github\.com/ansible\-collections/community\.docker/issues/636](https\://github\.com/ansible\-collections/community\.docker/issues/636)\, [https\://github\.com/ansible\-collections/community\.docker/pull/637](https\://github\.com/ansible\-collections/community\.docker/pull/637)\)\.
@@ -444,12 +471,12 @@ Bugfix release\.
<a id="v3-4-6"></a>
## v3\.4\.6
-<a id="release-summary-10"></a>
+<a id="release-summary-11"></a>
### Release Summary
Bugfix release with documentation warnings about using certain functionality when connecting to the Docker daemon with TCP TLS\.
-<a id="bugfixes-9"></a>
+<a id="bugfixes-10"></a>
### Bugfixes
* socket\_handler module utils \- make sure this fully works when Docker SDK for Python is not available \([https\://github\.com/ansible\-collections/community\.docker/pull/620](https\://github\.com/ansible\-collections/community\.docker/pull/620)\)\.
@@ -466,12 +493,12 @@ Bugfix release with documentation warnings about using certain functionality whe
<a id="v3-4-5"></a>
## v3\.4\.5
-<a id="release-summary-11"></a>
+<a id="release-summary-12"></a>
### Release Summary
Maintenance release which adds compatibility with requests 2\.29\.0 and 2\.30\.0 and urllib3 2\.0\.
-<a id="bugfixes-10"></a>
+<a id="bugfixes-11"></a>
### Bugfixes
* Make vendored Docker SDK for Python code compatible with requests 2\.29\.0 and urllib3 2\.0 \([https\://github\.com/ansible\-collections/community\.docker/pull/613](https\://github\.com/ansible\-collections/community\.docker/pull/613)\)\.
@@ -479,12 +506,12 @@ Maintenance release which adds compatibility with requests 2\.29\.0 and 2\.30\.0
<a id="v3-4-4"></a>
## v3\.4\.4
-<a id="release-summary-12"></a>
+<a id="release-summary-13"></a>
### Release Summary
Maintenance release with updated EE requirements and updated documentation\.
-<a id="minor-changes-4"></a>
+<a id="minor-changes-5"></a>
### Minor Changes
* Restrict requests to versions before 2\.29\.0\, and urllib3 to versions before 2\.0\.0\. This is necessary until the vendored code from Docker SDK for Python has been fully adjusted to work with a feature of urllib3 that is used since requests 2\.29\.0 \([https\://github\.com/ansible\-collections/community\.docker/issues/611](https\://github\.com/ansible\-collections/community\.docker/issues/611)\, [https\://github\.com/ansible\-collections/community\.docker/pull/612](https\://github\.com/ansible\-collections/community\.docker/pull/612)\)\.
@@ -497,7 +524,7 @@ Maintenance release with updated EE requirements and updated documentation\.
<a id="v3-4-3"></a>
## v3\.4\.3
-<a id="release-summary-13"></a>
+<a id="release-summary-14"></a>
### Release Summary
Maintenance release with improved documentation\.
@@ -505,12 +532,12 @@ Maintenance release with improved documentation\.
<a id="v3-4-2"></a>
## v3\.4\.2
-<a id="release-summary-14"></a>
+<a id="release-summary-15"></a>
### Release Summary
Bugfix release\.
-<a id="bugfixes-11"></a>
+<a id="bugfixes-12"></a>
### Bugfixes
* docker\_prune \- return correct value for <code>changed</code>\. So far the module always claimed that nothing changed \([https\://github\.com/ansible\-collections/community\.docker/pull/593](https\://github\.com/ansible\-collections/community\.docker/pull/593)\)\.
@@ -518,12 +545,12 @@ Bugfix release\.
<a id="v3-4-1"></a>
## v3\.4\.1
-<a id="release-summary-15"></a>
+<a id="release-summary-16"></a>
### Release Summary
Regular bugfix release\.
-<a id="bugfixes-12"></a>
+<a id="bugfixes-13"></a>
### Bugfixes
* docker\_api connection plugin\, docker\_container\_exec\, docker\_container\_copy\_into \- properly close socket to Daemon after executing commands in containers \([https\://github\.com/ansible\-collections/community\.docker/pull/582](https\://github\.com/ansible\-collections/community\.docker/pull/582)\)\.
@@ -533,18 +560,18 @@ Regular bugfix release\.
<a id="v3-4-0"></a>
## v3\.4\.0
-<a id="release-summary-16"></a>
+<a id="release-summary-17"></a>
### Release Summary
Regular bugfix and feature release\.
-<a id="minor-changes-5"></a>
+<a id="minor-changes-6"></a>
### Minor Changes
* docker\_api connection plugin \- when copying files to/from a container\, stream the file contents instead of first reading them to memory \([https\://github\.com/ansible\-collections/community\.docker/pull/545](https\://github\.com/ansible\-collections/community\.docker/pull/545)\)\.
* docker\_host\_info \- allow to list all containers with new option <code>containers\_all</code> \([https\://github\.com/ansible\-collections/community\.docker/issues/535](https\://github\.com/ansible\-collections/community\.docker/issues/535)\, [https\://github\.com/ansible\-collections/community\.docker/pull/538](https\://github\.com/ansible\-collections/community\.docker/pull/538)\)\.
-<a id="bugfixes-13"></a>
+<a id="bugfixes-14"></a>
### Bugfixes
* docker\_api connection plugin \- fix error handling when 409 Conflict is returned by the Docker daemon in case of a stopped container \([https\://github\.com/ansible\-collections/community\.docker/pull/546](https\://github\.com/ansible\-collections/community\.docker/pull/546)\)\.
@@ -560,12 +587,12 @@ Regular bugfix and feature release\.
<a id="v3-3-2"></a>
## v3\.3\.2
-<a id="release-summary-17"></a>
+<a id="release-summary-18"></a>
### Release Summary
Bugfix release\.
-<a id="bugfixes-14"></a>
+<a id="bugfixes-15"></a>
### Bugfixes
* docker\_container \- when <code>detach\=false</code>\, wait indefinitely and not at most one minute\. This was the behavior with Docker SDK for Python\, and was accidentally changed in 3\.0\.0 \([https\://github\.com/ansible\-collections/community\.docker/issues/526](https\://github\.com/ansible\-collections/community\.docker/issues/526)\, [https\://github\.com/ansible\-collections/community\.docker/pull/527](https\://github\.com/ansible\-collections/community\.docker/pull/527)\)\.
@@ -573,12 +600,12 @@ Bugfix release\.
<a id="v3-3-1"></a>
## v3\.3\.1
-<a id="release-summary-18"></a>
+<a id="release-summary-19"></a>
### Release Summary
Bugfix release\.
-<a id="bugfixes-15"></a>
+<a id="bugfixes-16"></a>
### Bugfixes
* current\_container\_facts \- make container detection work better in more cases \([https\://github\.com/ansible\-collections/community\.docker/pull/522](https\://github\.com/ansible\-collections/community\.docker/pull/522)\)\.
@@ -586,18 +613,18 @@ Bugfix release\.
<a id="v3-3-0"></a>
## v3\.3\.0
-<a id="release-summary-19"></a>
+<a id="release-summary-20"></a>
### Release Summary
Feature and bugfix release\.
-<a id="minor-changes-6"></a>
+<a id="minor-changes-7"></a>
### Minor Changes
* current\_container\_facts \- make work with current Docker version\, also support Podman \([https\://github\.com/ansible\-collections/community\.docker/pull/510](https\://github\.com/ansible\-collections/community\.docker/pull/510)\)\.
* docker\_image \- when using <code>archive\_path</code>\, detect whether changes are necessary based on the image ID \(hash\)\. If the existing tar archive matches the source\, do nothing\. Previously\, each task execution re\-created the archive \([https\://github\.com/ansible\-collections/community\.docker/pull/500](https\://github\.com/ansible\-collections/community\.docker/pull/500)\)\.
-<a id="bugfixes-16"></a>
+<a id="bugfixes-17"></a>
### Bugfixes
* docker\_container\_exec \- fix <code>chdir</code> option which was ignored since community\.docker 3\.0\.0 \([https\://github\.com/ansible\-collections/community\.docker/issues/517](https\://github\.com/ansible\-collections/community\.docker/issues/517)\, [https\://github\.com/ansible\-collections/community\.docker/pull/518](https\://github\.com/ansible\-collections/community\.docker/pull/518)\)\.
@@ -606,12 +633,12 @@ Feature and bugfix release\.
<a id="v3-2-2"></a>
## v3\.2\.2
-<a id="release-summary-20"></a>
+<a id="release-summary-21"></a>
### Release Summary
Bugfix release\.
-<a id="bugfixes-17"></a>
+<a id="bugfixes-18"></a>
### Bugfixes
* docker\_container \- the <code>kill\_signal</code> option erroneously did not accept strings anymore since 3\.0\.0 \([https\://github\.com/ansible\-collections/community\.docker/issues/505](https\://github\.com/ansible\-collections/community\.docker/issues/505)\, [https\://github\.com/ansible\-collections/community\.docker/pull/506](https\://github\.com/ansible\-collections/community\.docker/pull/506)\)\.
@@ -619,7 +646,7 @@ Bugfix release\.
<a id="v3-2-1"></a>
## v3\.2\.1
-<a id="release-summary-21"></a>
+<a id="release-summary-22"></a>
### Release Summary
Maintenance release with improved documentation\.
@@ -627,12 +654,12 @@ Maintenance release with improved documentation\.
<a id="v3-2-0"></a>
## v3\.2\.0
-<a id="release-summary-22"></a>
+<a id="release-summary-23"></a>
### Release Summary
Feature and deprecation release\.
-<a id="minor-changes-7"></a>
+<a id="minor-changes-8"></a>
### Minor Changes
* docker\_container \- added <code>image\_name\_mismatch</code> option which allows to control the behavior if the container uses the image specified\, but the container\'s configuration uses a different name for the image than the one provided to the module \([https\://github\.com/ansible\-collections/community\.docker/issues/485](https\://github\.com/ansible\-collections/community\.docker/issues/485)\, [https\://github\.com/ansible\-collections/community\.docker/pull/488](https\://github\.com/ansible\-collections/community\.docker/pull/488)\)\.
@@ -646,12 +673,12 @@ Feature and deprecation release\.
<a id="v3-1-0"></a>
## v3\.1\.0
-<a id="release-summary-23"></a>
+<a id="release-summary-24"></a>
### Release Summary
Feature release\.
-<a id="minor-changes-8"></a>
+<a id="minor-changes-9"></a>
### Minor Changes
* The collection repository conforms to the [REUSE specification](https\://reuse\.software/spec/) except for the changelog fragments \([https\://github\.com/ansible\-collections/community\.docker/pull/462](https\://github\.com/ansible\-collections/community\.docker/pull/462)\)\.
@@ -660,12 +687,12 @@ Feature release\.
<a id="v3-0-2"></a>
## v3\.0\.2
-<a id="release-summary-24"></a>
+<a id="release-summary-25"></a>
### Release Summary
Bugfix release\.
-<a id="bugfixes-18"></a>
+<a id="bugfixes-19"></a>
### Bugfixes
* docker\_image \- fix build argument handling \([https\://github\.com/ansible\-collections/community\.docker/issues/455](https\://github\.com/ansible\-collections/community\.docker/issues/455)\, [https\://github\.com/ansible\-collections/community\.docker/pull/456](https\://github\.com/ansible\-collections/community\.docker/pull/456)\)\.
@@ -673,12 +700,12 @@ Bugfix release\.
<a id="v3-0-1"></a>
## v3\.0\.1
-<a id="release-summary-25"></a>
+<a id="release-summary-26"></a>
### Release Summary
Bugfix release\.
-<a id="bugfixes-19"></a>
+<a id="bugfixes-20"></a>
### Bugfixes
* docker\_container \- fix handling of <code>env\_file</code> \([https\://github\.com/ansible\-collections/community\.docker/issues/451](https\://github\.com/ansible\-collections/community\.docker/issues/451)\, [https\://github\.com/ansible\-collections/community\.docker/pull/452](https\://github\.com/ansible\-collections/community\.docker/pull/452)\)\.
@@ -686,7 +713,7 @@ Bugfix release\.
<a id="v3-0-0"></a>
## v3\.0\.0
-<a id="release-summary-26"></a>
+<a id="release-summary-27"></a>
### Release Summary
The 3\.0\.0 release features a rewrite of the <code>docker\_container</code> module\, and many modules and plugins no longer depend on the Docker SDK for Python\.
@@ -713,7 +740,7 @@ The 3\.0\.0 release features a rewrite of the <code>docker\_container</code> mod
* docker\_volume \- no longer uses the Docker SDK for Python\. It requires <code>requests</code> to be installed\, and depending on the features used has some more requirements\. If the Docker SDK for Python is installed\, these requirements are likely met \([https\://github\.com/ansible\-collections/community\.docker/pull/411](https\://github\.com/ansible\-collections/community\.docker/pull/411)\)\.
* docker\_volume\_info \- no longer uses the Docker SDK for Python\. It requires <code>requests</code> to be installed\, and depending on the features used has some more requirements\. If the Docker SDK for Python is installed\, these requirements are likely met \([https\://github\.com/ansible\-collections/community\.docker/pull/412](https\://github\.com/ansible\-collections/community\.docker/pull/412)\)\.
-<a id="minor-changes-9"></a>
+<a id="minor-changes-10"></a>
### Minor Changes
* All software licenses are now in the <code>LICENSES/</code> directory of the collection root\. Moreover\, <code>SPDX\-License\-Identifier\:</code> is used to declare the applicable license for every file that is not automatically generated \([https\://github\.com/ansible\-collections/community\.docker/pull/430](https\://github\.com/ansible\-collections/community\.docker/pull/430)\)\.
@@ -753,7 +780,7 @@ The 3\.0\.0 release features a rewrite of the <code>docker\_container</code> mod
* modules and plugins communicating directly with the Docker daemon \- when connecting by SSH and not using <code>use\_ssh\_client\=true</code>\, reject unknown host keys instead of accepting them\. This is only a change relative to older community\.docker 3\.0\.0 pre\-releases or with respect to Docker SDK for Python \< 6\.0\.0\. Docker SDK for Python 6\.0\.0 will also include this change \([https\://github\.com/ansible\-collections/community\.docker/pull/434](https\://github\.com/ansible\-collections/community\.docker/pull/434)\)\.
-<a id="bugfixes-20"></a>
+<a id="bugfixes-21"></a>
### Bugfixes
* docker\_image \- when composing the build context\, trim trailing whitespace from <code>\.dockerignore</code> entries\. This is only a change relative to older community\.docker 3\.0\.0 pre\-releases or with respect to Docker SDK for Python \< 6\.0\.0\. Docker SDK for Python 6\.0\.0 will also include this change \([https\://github\.com/ansible\-collections/community\.docker/pull/434](https\://github\.com/ansible\-collections/community\.docker/pull/434)\)\.
@@ -767,12 +794,12 @@ The 3\.0\.0 release features a rewrite of the <code>docker\_container</code> mod
<a id="v2-7-0"></a>
## v2\.7\.0
-<a id="release-summary-27"></a>
+<a id="release-summary-28"></a>
### Release Summary
Bugfix and deprecation release\. The next 2\.x\.y releases will only be bugfix releases\, the next expect minor/major release will be 3\.0\.0 with some major changes\.
-<a id="minor-changes-10"></a>
+<a id="minor-changes-11"></a>
### Minor Changes
* Move common utility functions from the <code>common</code> module\_util to a new module\_util called <code>util</code>\. This should not have any user\-visible effect \([https\://github\.com/ansible\-collections/community\.docker/pull/390](https\://github\.com/ansible\-collections/community\.docker/pull/390)\)\.
@@ -783,7 +810,7 @@ Bugfix and deprecation release\. The next 2\.x\.y releases will only be bugfix r
* Support for Docker API version 1\.20 to 1\.24 has been deprecated and will be removed in community\.docker 3\.0\.0\. The first Docker version supporting API version 1\.25 was Docker 1\.13\, released in January 2017\. This affects the modules <code>docker\_container</code>\, <code>docker\_container\_exec</code>\, <code>docker\_container\_info</code>\, <code>docker\_compose</code>\, <code>docker\_login</code>\, <code>docker\_image</code>\, <code>docker\_image\_info</code>\, <code>docker\_image\_load</code>\, <code>docker\_host\_info</code>\, <code>docker\_network</code>\, <code>docker\_network\_info</code>\, <code>docker\_node\_info</code>\, <code>docker\_swarm\_info</code>\, <code>docker\_swarm\_service</code>\, <code>docker\_swarm\_service\_info</code>\, <code>docker\_volume\_info</code>\, and <code>docker\_volume</code>\, whose minimally supported API version is between 1\.20 and 1\.24 \([https\://github\.com/ansible\-collections/community\.docker/pull/396](https\://github\.com/ansible\-collections/community\.docker/pull/396)\)\.
* Support for Python 2\.6 is deprecated and will be removed in the next major release \(community\.docker 3\.0\.0\)\. Some modules might still work with Python 2\.6\, but we will no longer try to ensure compatibility \([https\://github\.com/ansible\-collections/community\.docker/pull/388](https\://github\.com/ansible\-collections/community\.docker/pull/388)\)\.
-<a id="bugfixes-21"></a>
+<a id="bugfixes-22"></a>
### Bugfixes
* Docker SDK for Python based modules and plugins \- if the API version is specified as an option\, use that one to validate API version requirements of module/plugin options instead of the latest API version supported by the Docker daemon\. This also avoids one unnecessary API call per module/plugin \([https\://github\.com/ansible\-collections/community\.docker/pull/389](https\://github\.com/ansible\-collections/community\.docker/pull/389)\)\.
@@ -791,12 +818,12 @@ Bugfix and deprecation release\. The next 2\.x\.y releases will only be bugfix r
<a id="v2-6-0"></a>
## v2\.6\.0
-<a id="release-summary-28"></a>
+<a id="release-summary-29"></a>
### Release Summary
Bugfix and feature release\.
-<a id="minor-changes-11"></a>
+<a id="minor-changes-12"></a>
### Minor Changes
* docker\_container \- added <code>image\_label\_mismatch</code> parameter \([https\://github\.com/ansible\-collections/community\.docker/issues/314](https\://github\.com/ansible\-collections/community\.docker/issues/314)\, [https\://github\.com/ansible\-collections/community\.docker/pull/370](https\://github\.com/ansible\-collections/community\.docker/pull/370)\)\.
@@ -809,7 +836,7 @@ Bugfix and feature release\.
* Various modules \- the default of <code>tls\_hostname</code> that was supposed to be removed in community\.docker 2\.0\.0 will now be removed in version 3\.0\.0 \([https\://github\.com/ansible\-collections/community\.docker/pull/362](https\://github\.com/ansible\-collections/community\.docker/pull/362)\)\.
* docker\_stack \- the return values <code>out</code> and <code>err</code> that were supposed to be removed in community\.docker 2\.0\.0 will now be removed in version 3\.0\.0 \([https\://github\.com/ansible\-collections/community\.docker/pull/362](https\://github\.com/ansible\-collections/community\.docker/pull/362)\)\.
-<a id="bugfixes-22"></a>
+<a id="bugfixes-23"></a>
### Bugfixes
* docker\_container \- fail with a meaningful message instead of crashing if a port is specified with more than three colon\-separated parts \([https\://github\.com/ansible\-collections/community\.docker/pull/367](https\://github\.com/ansible\-collections/community\.docker/pull/367)\, [https\://github\.com/ansible\-collections/community\.docker/issues/365](https\://github\.com/ansible\-collections/community\.docker/issues/365)\)\.
@@ -818,12 +845,12 @@ Bugfix and feature release\.
<a id="v2-5-1"></a>
## v2\.5\.1
-<a id="release-summary-29"></a>
+<a id="release-summary-30"></a>
### Release Summary
Maintenance release\.
-<a id="bugfixes-23"></a>
+<a id="bugfixes-24"></a>
### Bugfixes
* Include <code>PSF\-license\.txt</code> file for <code>plugins/module\_utils/\_version\.py</code>\.
@@ -831,12 +858,12 @@ Maintenance release\.
<a id="v2-5-0"></a>
## v2\.5\.0
-<a id="release-summary-30"></a>
+<a id="release-summary-31"></a>
### Release Summary
Regular feature release\.
-<a id="minor-changes-12"></a>
+<a id="minor-changes-13"></a>
### Minor Changes
* docker\_config \- add support for <code>template\_driver</code> with one option <code>golang</code> \([https\://github\.com/ansible\-collections/community\.docker/issues/332](https\://github\.com/ansible\-collections/community\.docker/issues/332)\, [https\://github\.com/ansible\-collections/community\.docker/pull/345](https\://github\.com/ansible\-collections/community\.docker/pull/345)\)\.
@@ -845,19 +872,19 @@ Regular feature release\.
<a id="v2-4-0"></a>
## v2\.4\.0
-<a id="release-summary-31"></a>
+<a id="release-summary-32"></a>
### Release Summary
Regular feature and bugfix release\.
-<a id="minor-changes-13"></a>
+<a id="minor-changes-14"></a>
### Minor Changes
* Prepare collection for inclusion in an Execution Environment by declaring its dependencies\. The <code>docker\_stack\*</code> modules are not supported \([https\://github\.com/ansible\-collections/community\.docker/pull/336](https\://github\.com/ansible\-collections/community\.docker/pull/336)\)\.
* current\_container\_facts \- add detection for GitHub Actions \([https\://github\.com/ansible\-collections/community\.docker/pull/336](https\://github\.com/ansible\-collections/community\.docker/pull/336)\)\.
* docker\_container \- support returning Docker container log output when using Docker\'s <code>local</code> logging driver\, an optimized local logging driver introduced in Docker 18\.09 \([https\://github\.com/ansible\-collections/community\.docker/pull/337](https\://github\.com/ansible\-collections/community\.docker/pull/337)\)\.
-<a id="bugfixes-24"></a>
+<a id="bugfixes-25"></a>
### Bugfixes
* docker connection plugin \- make sure that <code>docker\_extra\_args</code> is used for querying the Docker version\. Also ensures that the Docker version is only queried when needed\. This is currently the case if a remote user is specified \([https\://github\.com/ansible\-collections/community\.docker/issues/325](https\://github\.com/ansible\-collections/community\.docker/issues/325)\, [https\://github\.com/ansible\-collections/community\.docker/pull/327](https\://github\.com/ansible\-collections/community\.docker/pull/327)\)\.
@@ -865,12 +892,12 @@ Regular feature and bugfix release\.
<a id="v2-3-0"></a>
## v2\.3\.0
-<a id="release-summary-32"></a>
+<a id="release-summary-33"></a>
### Release Summary
Regular feature and bugfix release\.
-<a id="minor-changes-14"></a>
+<a id="minor-changes-15"></a>
### Minor Changes
* docker connection plugin \- implement connection reset by clearing internal container user cache \([https\://github\.com/ansible\-collections/community\.docker/pull/312](https\://github\.com/ansible\-collections/community\.docker/pull/312)\)\.
@@ -879,7 +906,7 @@ Regular feature and bugfix release\.
* docker\_api connection plugin \- implement connection reset by clearing internal container user/group ID cache \([https\://github\.com/ansible\-collections/community\.docker/pull/312](https\://github\.com/ansible\-collections/community\.docker/pull/312)\)\.
* docker\_api connection plugin \- the plugin supports new ways to define the timeout\. These are the <code>ANSIBLE\_DOCKER\_TIMEOUT</code> environment variable\, the <code>timeout</code> setting in the <code>docker\_connection</code> section of <code>ansible\.cfg</code>\, and the <code>ansible\_docker\_timeout</code> variable \([https\://github\.com/ansible\-collections/community\.docker/pull/308](https\://github\.com/ansible\-collections/community\.docker/pull/308)\)\.
-<a id="bugfixes-25"></a>
+<a id="bugfixes-26"></a>
### Bugfixes
* docker connection plugin \- fix option handling to be compatible with ansible\-core 2\.13 \([https\://github\.com/ansible\-collections/community\.docker/pull/297](https\://github\.com/ansible\-collections/community\.docker/pull/297)\, [https\://github\.com/ansible\-collections/community\.docker/issues/307](https\://github\.com/ansible\-collections/community\.docker/issues/307)\)\.
@@ -888,12 +915,12 @@ Regular feature and bugfix release\.
<a id="v2-2-1"></a>
## v2\.2\.1
-<a id="release-summary-33"></a>
+<a id="release-summary-34"></a>
### Release Summary
Regular bugfix release\.
-<a id="bugfixes-26"></a>
+<a id="bugfixes-27"></a>
### Bugfixes
* docker\_compose \- fix Python 3 type error when extracting warnings or errors from docker\-compose\'s output \([https\://github\.com/ansible\-collections/community\.docker/pull/305](https\://github\.com/ansible\-collections/community\.docker/pull/305)\)\.
@@ -901,19 +928,19 @@ Regular bugfix release\.
<a id="v2-2-0"></a>
## v2\.2\.0
-<a id="release-summary-34"></a>
+<a id="release-summary-35"></a>
### Release Summary
Regular feature and bugfix release\.
-<a id="minor-changes-15"></a>
+<a id="minor-changes-16"></a>
### Minor Changes
* docker\_config \- add support for rolling update\, set <code>rolling\_versions</code> to <code>true</code> to enable \([https\://github\.com/ansible\-collections/community\.docker/pull/295](https\://github\.com/ansible\-collections/community\.docker/pull/295)\, [https\://github\.com/ansible\-collections/community\.docker/issues/109](https\://github\.com/ansible\-collections/community\.docker/issues/109)\)\.
* docker\_secret \- add support for rolling update\, set <code>rolling\_versions</code> to <code>true</code> to enable \([https\://github\.com/ansible\-collections/community\.docker/pull/293](https\://github\.com/ansible\-collections/community\.docker/pull/293)\, [https\://github\.com/ansible\-collections/community\.docker/issues/21](https\://github\.com/ansible\-collections/community\.docker/issues/21)\)\.
* docker\_swarm\_service \- add support for setting capabilities with the <code>cap\_add</code> and <code>cap\_drop</code> parameters\. Usage is the same as with the <code>capabilities</code> and <code>cap\_drop</code> parameters for <code>docker\_container</code> \([https\://github\.com/ansible\-collections/community\.docker/pull/294](https\://github\.com/ansible\-collections/community\.docker/pull/294)\)\.
-<a id="bugfixes-27"></a>
+<a id="bugfixes-28"></a>
### Bugfixes
* docker\_container\, docker\_image \- adjust image finding code to peculiarities of <code>podman\-docker</code>\'s API emulation when Docker short names like <code>redis</code> are used \([https\://github\.com/ansible\-collections/community\.docker/issues/292](https\://github\.com/ansible\-collections/community\.docker/issues/292)\)\.
@@ -921,12 +948,12 @@ Regular feature and bugfix release\.
<a id="v2-1-1"></a>
## v2\.1\.1
-<a id="release-summary-35"></a>
+<a id="release-summary-36"></a>
### Release Summary
Emergency release to amend breaking change in previous release\.
-<a id="bugfixes-28"></a>
+<a id="bugfixes-29"></a>
### Bugfixes
* Fix unintended breaking change caused by [an earlier fix](https\://github\.com/ansible\-collections/community\.docker/pull/258) by vendoring the deprecated Python standard library <code>distutils\.version</code> until this collection stops supporting Ansible 2\.9 and ansible\-base 2\.10 \([https\://github\.com/ansible\-collections/community\.docker/issues/267](https\://github\.com/ansible\-collections/community\.docker/issues/267)\, [https\://github\.com/ansible\-collections/community\.docker/pull/269](https\://github\.com/ansible\-collections/community\.docker/pull/269)\)\.
@@ -934,18 +961,18 @@ Emergency release to amend breaking change in previous release\.
<a id="v2-1-0"></a>
## v2\.1\.0
-<a id="release-summary-36"></a>
+<a id="release-summary-37"></a>
### Release Summary
Feature and bugfix release\.
-<a id="minor-changes-16"></a>
+<a id="minor-changes-17"></a>
### Minor Changes
* docker\_container\_exec \- add <code>detach</code> parameter \([https\://github\.com/ansible\-collections/community\.docker/issues/250](https\://github\.com/ansible\-collections/community\.docker/issues/250)\, [https\://github\.com/ansible\-collections/community\.docker/pull/255](https\://github\.com/ansible\-collections/community\.docker/pull/255)\)\.
* docker\_container\_exec \- add <code>env</code> option \([https\://github\.com/ansible\-collections/community\.docker/issues/248](https\://github\.com/ansible\-collections/community\.docker/issues/248)\, [https\://github\.com/ansible\-collections/community\.docker/pull/254](https\://github\.com/ansible\-collections/community\.docker/pull/254)\)\.
-<a id="bugfixes-29"></a>
+<a id="bugfixes-30"></a>
### Bugfixes
* Various modules and plugins \- use vendored version of <code>distutils\.version</code> included in ansible\-core 2\.12 if available\. This avoids breakage when <code>distutils</code> is removed from the standard library of Python 3\.12\. Note that ansible\-core 2\.11\, ansible\-base 2\.10 and Ansible 2\.9 are right now not compatible with Python 3\.12\, hence this fix does not target these ansible\-core/\-base/2\.9 versions \([https\://github\.com/ansible\-collections/community\.docker/pull/258](https\://github\.com/ansible\-collections/community\.docker/pull/258)\)\.
@@ -955,12 +982,12 @@ Feature and bugfix release\.
<a id="v2-0-2"></a>
## v2\.0\.2
-<a id="release-summary-37"></a>
+<a id="release-summary-38"></a>
### Release Summary
Bugfix release\.
-<a id="bugfixes-30"></a>
+<a id="bugfixes-31"></a>
### Bugfixes
* docker\_api connection plugin \- avoid passing an unnecessary argument to a Docker SDK for Python call that is only supported by version 3\.0\.0 or later \([https\://github\.com/ansible\-collections/community\.docker/pull/243](https\://github\.com/ansible\-collections/community\.docker/pull/243)\)\.
@@ -971,7 +998,7 @@ Bugfix release\.
<a id="v2-0-1"></a>
## v2\.0\.1
-<a id="release-summary-38"></a>
+<a id="release-summary-39"></a>
### Release Summary
Maintenance release with some documentation fixes\.
@@ -979,7 +1006,7 @@ Maintenance release with some documentation fixes\.
<a id="v2-0-0"></a>
## v2\.0\.0
-<a id="release-summary-39"></a>
+<a id="release-summary-40"></a>
### Release Summary
New major release with some deprecations removed and a breaking change in the <code>docker\_compose</code> module regarding the <code>timeout</code> parameter\.
@@ -987,7 +1014,7 @@ New major release with some deprecations removed and a breaking change in the <c
<a id="breaking-changes--porting-guide-1"></a>
### Breaking Changes / Porting Guide
-* docker\_compose \- fixed <code>timeout</code> defaulting behavior so that <code>stop\_grace\_period</code>\, if defined in the compose file\, will be used if <em class="title-reference">timeout\`</em> is not specified \([https\://github\.com/ansible\-collections/community\.docker/pull/163](https\://github\.com/ansible\-collections/community\.docker/pull/163)\)\.
+* docker\_compose \- fixed <code>timeout</code> defaulting behavior so that <code>stop\_grace\_period</code>\, if defined in the compose file\, will be used if <code>timeout</code> is not specified \([https\://github\.com/ansible\-collections/community\.docker/pull/163](https\://github\.com/ansible\-collections/community\.docker/pull/163)\)\.
<a id="deprecated-features-4"></a>
### Deprecated Features
@@ -1005,12 +1032,12 @@ New major release with some deprecations removed and a breaking change in the <c
<a id="v1-10-0"></a>
## v1\.10\.0
-<a id="release-summary-40"></a>
+<a id="release-summary-41"></a>
### Release Summary
Regular feature and bugfix release\.
-<a id="minor-changes-17"></a>
+<a id="minor-changes-18"></a>
### Minor Changes
* Add the modules docker\_container\_exec\, docker\_image\_load and docker\_plugin to the <code>docker</code> module defaults group \([https\://github\.com/ansible\-collections/community\.docker/pull/209](https\://github\.com/ansible\-collections/community\.docker/pull/209)\)\.
@@ -1020,12 +1047,12 @@ Regular feature and bugfix release\.
<a id="v1-9-1"></a>
## v1\.9\.1
-<a id="release-summary-41"></a>
+<a id="release-summary-42"></a>
### Release Summary
Regular bugfix release\.
-<a id="bugfixes-31"></a>
+<a id="bugfixes-32"></a>
### Bugfixes
* docker\_compose \- fixed incorrect <code>changed</code> status for services with <code>profiles</code> defined\, but none enabled \([https\://github\.com/ansible\-collections/community\.docker/pull/192](https\://github\.com/ansible\-collections/community\.docker/pull/192)\)\.
@@ -1033,12 +1060,12 @@ Regular bugfix release\.
<a id="v1-9-0"></a>
## v1\.9\.0
-<a id="release-summary-42"></a>
+<a id="release-summary-43"></a>
### Release Summary
New bugfixes and features release\.
-<a id="minor-changes-18"></a>
+<a id="minor-changes-19"></a>
### Minor Changes
* docker\_\* modules \- include <code>ImportError</code> traceback when reporting that Docker SDK for Python could not be found \([https\://github\.com/ansible\-collections/community\.docker/pull/188](https\://github\.com/ansible\-collections/community\.docker/pull/188)\)\.
@@ -1052,7 +1079,7 @@ New bugfixes and features release\.
* docker\_container \- the new <code>command\_handling</code>\'s default value\, <code>compatibility</code>\, is deprecated and will change to <code>correct</code> in community\.docker 3\.0\.0\. A deprecation warning is emitted by the module in cases where the behavior will change\. Please note that ansible\-core will output a deprecation warning only once\, so if it is shown for an earlier task\, there could be more tasks with this warning where it is not shown \([https\://github\.com/ansible\-collections/community\.docker/pull/186](https\://github\.com/ansible\-collections/community\.docker/pull/186)\)\.
-<a id="bugfixes-32"></a>
+<a id="bugfixes-33"></a>
### Bugfixes
* docker\_compose \- fixes task failures when bringing up services while using <code>docker\-compose \<1\.17\.0</code> \([https\://github\.com/ansible\-collections/community\.docker/issues/180](https\://github\.com/ansible\-collections/community\.docker/issues/180)\)\.
@@ -1071,12 +1098,12 @@ New bugfixes and features release\.
<a id="v1-8-0"></a>
## v1\.8\.0
-<a id="release-summary-43"></a>
+<a id="release-summary-44"></a>
### Release Summary
Regular bugfix and feature release\.
-<a id="minor-changes-19"></a>
+<a id="minor-changes-20"></a>
### Minor Changes
* Avoid internal ansible\-core module\_utils in favor of equivalent public API available since at least Ansible 2\.9 \([https\://github\.com/ansible\-collections/community\.docker/pull/164](https\://github\.com/ansible\-collections/community\.docker/pull/164)\)\.
@@ -1085,7 +1112,7 @@ Regular bugfix and feature release\.
* docker\_host\_info \- allow values for keys in <code>containers\_filters</code>\, <code>images\_filters</code>\, <code>networks\_filters</code>\, and <code>volumes\_filters</code> to be passed as YAML lists \([https\://github\.com/ansible\-collections/community\.docker/pull/160](https\://github\.com/ansible\-collections/community\.docker/pull/160)\)\.
* docker\_plugin \- added <code>alias</code> option to specify local names for docker plugins \([https\://github\.com/ansible\-collections/community\.docker/pull/161](https\://github\.com/ansible\-collections/community\.docker/pull/161)\)\.
-<a id="bugfixes-33"></a>
+<a id="bugfixes-34"></a>
### Bugfixes
* docker\_compose \- fix idempotence bug when using <code>stopped\: true</code> \([https\://github\.com/ansible\-collections/community\.docker/issues/142](https\://github\.com/ansible\-collections/community\.docker/issues/142)\, [https\://github\.com/ansible\-collections/community\.docker/pull/159](https\://github\.com/ansible\-collections/community\.docker/pull/159)\)\.
@@ -1093,12 +1120,12 @@ Regular bugfix and feature release\.
<a id="v1-7-0"></a>
## v1\.7\.0
-<a id="release-summary-44"></a>
+<a id="release-summary-45"></a>
### Release Summary
Small feature and bugfix release\.
-<a id="minor-changes-20"></a>
+<a id="minor-changes-21"></a>
### Minor Changes
* docker\_image \- allow to tag images by ID \([https\://github\.com/ansible\-collections/community\.docker/pull/149](https\://github\.com/ansible\-collections/community\.docker/pull/149)\)\.
@@ -1106,12 +1133,12 @@ Small feature and bugfix release\.
<a id="v1-6-1"></a>
## v1\.6\.1
-<a id="release-summary-45"></a>
+<a id="release-summary-46"></a>
### Release Summary
Bugfix release to reduce deprecation warning spam\.
-<a id="bugfixes-34"></a>
+<a id="bugfixes-35"></a>
### Bugfixes
* docker\_\* modules and plugins\, except <code>docker\_swarm</code> connection plugin and <code>docker\_compose</code> and <code>docker\_stack\*\` modules \- only emit \`\`tls\_hostname</code> deprecation message if TLS is actually used \([https\://github\.com/ansible\-collections/community\.docker/pull/143](https\://github\.com/ansible\-collections/community\.docker/pull/143)\)\.
@@ -1119,12 +1146,12 @@ Bugfix release to reduce deprecation warning spam\.
<a id="v1-6-0"></a>
## v1\.6\.0
-<a id="release-summary-46"></a>
+<a id="release-summary-47"></a>
### Release Summary
Regular bugfix and feature release\.
-<a id="minor-changes-21"></a>
+<a id="minor-changes-22"></a>
### Minor Changes
* common module utils \- correct error messages for guiding to install proper Docker SDK for Python module \([https\://github\.com/ansible\-collections/community\.docker/pull/125](https\://github\.com/ansible\-collections/community\.docker/pull/125)\)\.
@@ -1135,7 +1162,7 @@ Regular bugfix and feature release\.
* docker\_\* modules and plugins\, except <code>docker\_swarm</code> connection plugin and <code>docker\_compose</code> and <code>docker\_stack\*\` modules \- the current default \`\`localhost</code> for <code>tls\_hostname</code> is deprecated\. In community\.docker 2\.0\.0 it will be computed from <code>docker\_host</code> instead \([https\://github\.com/ansible\-collections/community\.docker/pull/134](https\://github\.com/ansible\-collections/community\.docker/pull/134)\)\.
-<a id="bugfixes-35"></a>
+<a id="bugfixes-36"></a>
### Bugfixes
* docker\-compose \- fix not pulling when <code>state\: present</code> and <code>stopped\: true</code> \([https\://github\.com/ansible\-collections/community\.docker/issues/12](https\://github\.com/ansible\-collections/community\.docker/issues/12)\, [https\://github\.com/ansible\-collections/community\.docker/pull/119](https\://github\.com/ansible\-collections/community\.docker/pull/119)\)\.
@@ -1145,17 +1172,17 @@ Regular bugfix and feature release\.
<a id="v1-5-0"></a>
## v1\.5\.0
-<a id="release-summary-47"></a>
+<a id="release-summary-48"></a>
### Release Summary
Regular feature release\.
-<a id="minor-changes-22"></a>
+<a id="minor-changes-23"></a>
### Minor Changes
* Add the <code>use\_ssh\_client</code> option to most docker modules and plugins \([https\://github\.com/ansible\-collections/community\.docker/issues/108](https\://github\.com/ansible\-collections/community\.docker/issues/108)\, [https\://github\.com/ansible\-collections/community\.docker/pull/114](https\://github\.com/ansible\-collections/community\.docker/pull/114)\)\.
-<a id="bugfixes-36"></a>
+<a id="bugfixes-37"></a>
### Bugfixes
* all modules \- use <code>to\_native</code> to convert exceptions to strings \([https\://github\.com/ansible\-collections/community\.docker/pull/121](https\://github\.com/ansible\-collections/community\.docker/pull/121)\)\.
@@ -1168,12 +1195,12 @@ Regular feature release\.
<a id="v1-4-0"></a>
## v1\.4\.0
-<a id="release-summary-48"></a>
+<a id="release-summary-49"></a>
### Release Summary
Security release to address another potential secret leak\. Also includes regular bugfixes and features\.
-<a id="minor-changes-23"></a>
+<a id="minor-changes-24"></a>
### Minor Changes
* docker\_swarm\_service \- change <code>publish\.published\_port</code> option from mandatory to optional\. Docker will assign random high port if not specified \([https\://github\.com/ansible\-collections/community\.docker/issues/99](https\://github\.com/ansible\-collections/community\.docker/issues/99)\)\.
@@ -1188,7 +1215,7 @@ Security release to address another potential secret leak\. Also includes regula
* docker\_swarm \- the <code>join\_token</code> option is now marked as <code>no\_log</code> so it is no longer written into logs \([https\://github\.com/ansible\-collections/community\.docker/pull/103](https\://github\.com/ansible\-collections/community\.docker/pull/103)\)\.
-<a id="bugfixes-37"></a>
+<a id="bugfixes-38"></a>
### Bugfixes
* <code>docker\_swarm\_service</code> \- fix KeyError on caused by reference to deprecated option <code>update\_failure\_action</code> \([https\://github\.com/ansible\-collections/community\.docker/pull/100](https\://github\.com/ansible\-collections/community\.docker/pull/100)\)\.
@@ -1197,12 +1224,12 @@ Security release to address another potential secret leak\. Also includes regula
<a id="v1-3-0"></a>
## v1\.3\.0
-<a id="release-summary-49"></a>
+<a id="release-summary-50"></a>
### Release Summary
Regular feature and bugfix release\.
-<a id="minor-changes-24"></a>
+<a id="minor-changes-25"></a>
### Minor Changes
* docker\_container \- add <code>storage\_opts</code> option to specify storage options \([https\://github\.com/ansible\-collections/community\.docker/issues/91](https\://github\.com/ansible\-collections/community\.docker/issues/91)\, [https\://github\.com/ansible\-collections/community\.docker/pull/93](https\://github\.com/ansible\-collections/community\.docker/pull/93)\)\.
@@ -1210,7 +1237,7 @@ Regular feature and bugfix release\.
* docker\_image \- properly support image IDs \(hashes\) for loading and tagging images \([https\://github\.com/ansible\-collections/community\.docker/issues/86](https\://github\.com/ansible\-collections/community\.docker/issues/86)\, [https\://github\.com/ansible\-collections/community\.docker/pull/87](https\://github\.com/ansible\-collections/community\.docker/pull/87)\)\.
* docker\_swarm\_service \- adding support for maximum number of tasks per node \(<code>replicas\_max\_per\_node</code>\) when running swarm service in replicated mode\. Introduced in API 1\.40 \([https\://github\.com/ansible\-collections/community\.docker/issues/7](https\://github\.com/ansible\-collections/community\.docker/issues/7)\, [https\://github\.com/ansible\-collections/community\.docker/pull/92](https\://github\.com/ansible\-collections/community\.docker/pull/92)\)\.
-<a id="bugfixes-38"></a>
+<a id="bugfixes-39"></a>
### Bugfixes
* docker\_container \- fix healthcheck disabling idempotency issue with strict comparison \([https\://github\.com/ansible\-collections/community\.docker/issues/85](https\://github\.com/ansible\-collections/community\.docker/issues/85)\)\.
@@ -1228,7 +1255,7 @@ Regular feature and bugfix release\.
<a id="v1-2-2"></a>
## v1\.2\.2
-<a id="release-summary-50"></a>
+<a id="release-summary-51"></a>
### Release Summary
Security bugfix release to address CVE\-2021\-20191\.
@@ -1241,12 +1268,12 @@ Security bugfix release to address CVE\-2021\-20191\.
<a id="v1-2-1"></a>
## v1\.2\.1
-<a id="release-summary-51"></a>
+<a id="release-summary-52"></a>
### Release Summary
Bugfix release\.
-<a id="bugfixes-39"></a>
+<a id="bugfixes-40"></a>
### Bugfixes
* docker connection plugin \- fix Docker version parsing\, as some docker versions have a leading <code>v</code> in the output of the command <code>docker version \-\-format \"\{\{\.Server\.Version\}\}\"</code> \([https\://github\.com/ansible\-collections/community\.docker/pull/76](https\://github\.com/ansible\-collections/community\.docker/pull/76)\)\.
@@ -1254,17 +1281,17 @@ Bugfix release\.
<a id="v1-2-0"></a>
## v1\.2\.0
-<a id="release-summary-52"></a>
+<a id="release-summary-53"></a>
### Release Summary
Feature release with one new feature and two bugfixes\.
-<a id="minor-changes-25"></a>
+<a id="minor-changes-26"></a>
### Minor Changes
* docker\_container \- added <code>default\_host\_ip</code> option which allows to explicitly set the default IP string for published ports without explicitly specified IPs\. When using IPv6 binds with Docker 20\.10\.2 or newer\, this needs to be set to an empty string \(<code>\"\"</code>\) \([https\://github\.com/ansible\-collections/community\.docker/issues/70](https\://github\.com/ansible\-collections/community\.docker/issues/70)\, [https\://github\.com/ansible\-collections/community\.docker/pull/71](https\://github\.com/ansible\-collections/community\.docker/pull/71)\)\.
-<a id="bugfixes-40"></a>
+<a id="bugfixes-41"></a>
### Bugfixes
* docker\_container \- allow IPv6 zones \(RFC 4007\) in bind IPs \([https\://github\.com/ansible\-collections/community\.docker/pull/66](https\://github\.com/ansible\-collections/community\.docker/pull/66)\)\.
@@ -1273,12 +1300,12 @@ Feature release with one new feature and two bugfixes\.
<a id="v1-1-0"></a>
## v1\.1\.0
-<a id="release-summary-53"></a>
+<a id="release-summary-54"></a>
### Release Summary
Feature release with three new plugins and modules\.
-<a id="minor-changes-26"></a>
+<a id="minor-changes-27"></a>
### Minor Changes
* docker\_container \- support specifying <code>cgroup\_parent</code> \([https\://github\.com/ansible\-collections/community\.docker/issues/6](https\://github\.com/ansible\-collections/community\.docker/issues/6)\, [https\://github\.com/ansible\-collections/community\.docker/pull/59](https\://github\.com/ansible\-collections/community\.docker/pull/59)\)\.
@@ -1290,7 +1317,7 @@ Feature release with three new plugins and modules\.
* docker\_container \- currently <code>published\_ports</code> can contain port mappings next to the special value <code>all</code>\, in which case the port mappings are ignored\. This behavior is deprecated for community\.docker 2\.0\.0\, at which point it will either be forbidden\, or this behavior will be properly implemented similar to how the Docker CLI tool handles this \([https\://github\.com/ansible\-collections/community\.docker/issues/8](https\://github\.com/ansible\-collections/community\.docker/issues/8)\, [https\://github\.com/ansible\-collections/community\.docker/pull/60](https\://github\.com/ansible\-collections/community\.docker/pull/60)\)\.
-<a id="bugfixes-41"></a>
+<a id="bugfixes-42"></a>
### Bugfixes
* docker\_image \- if <code>push\=true</code> is used with <code>repository</code>\, and the image does not need to be tagged\, still push\. This can happen if <code>repository</code> and <code>name</code> are equal \([https\://github\.com/ansible\-collections/community\.docker/issues/52](https\://github\.com/ansible\-collections/community\.docker/issues/52)\, [https\://github\.com/ansible\-collections/community\.docker/pull/53](https\://github\.com/ansible\-collections/community\.docker/pull/53)\)\.
@@ -1318,12 +1345,12 @@ Feature release with three new plugins and modules\.
<a id="v1-0-1"></a>
## v1\.0\.1
-<a id="release-summary-54"></a>
+<a id="release-summary-55"></a>
### Release Summary
Maintenance release with a bugfix for <code>docker\_container</code>\.
-<a id="bugfixes-42"></a>
+<a id="bugfixes-43"></a>
### Bugfixes
* docker\_container \- the validation for <code>capabilities</code> in <code>device\_requests</code> was incorrect \([https\://github\.com/ansible\-collections/community\.docker/issues/42](https\://github\.com/ansible\-collections/community\.docker/issues/42)\, [https\://github\.com/ansible\-collections/community\.docker/pull/43](https\://github\.com/ansible\-collections/community\.docker/pull/43)\)\.
@@ -1331,12 +1358,12 @@ Maintenance release with a bugfix for <code>docker\_container</code>\.
<a id="v1-0-0"></a>
## v1\.0\.0
-<a id="release-summary-55"></a>
+<a id="release-summary-56"></a>
### Release Summary
This is the first production \(non\-prerelease\) release of <code>community\.docker</code>\.
-<a id="minor-changes-27"></a>
+<a id="minor-changes-28"></a>
### Minor Changes
* Add collection\-side support of the <code>docker</code> action group / module defaults group \([https\://github\.com/ansible\-collections/community\.docker/pull/17](https\://github\.com/ansible\-collections/community\.docker/pull/17)\)\.
@@ -1346,14 +1373,14 @@ This is the first production \(non\-prerelease\) release of <code>community\.doc
<a id="v0-1-0"></a>
## v0\.1\.0
-<a id="release-summary-56"></a>
+<a id="release-summary-57"></a>
### Release Summary
The <code>community\.docker</code> continues the work on the Ansible docker modules and plugins from their state in <code>community\.general</code> 1\.2\.0\. The changes listed here are thus relative to the modules and plugins <code>community\.general\.docker\*</code>\.
All deprecation removals planned for <code>community\.general</code> 2\.0\.0 have been applied\. All deprecation removals scheduled for <code>community\.general</code> 3\.0\.0 have been re\-scheduled for <code>community\.docker</code> 2\.0\.0\.
-<a id="minor-changes-28"></a>
+<a id="minor-changes-29"></a>
### Minor Changes
* docker\_container \- now supports the <code>device\_requests</code> option\, which allows to request additional resources such as GPUs \([https\://github\.com/ansible/ansible/issues/65748](https\://github\.com/ansible/ansible/issues/65748)\, [https\://github\.com/ansible\-collections/community\.general/pull/1119](https\://github\.com/ansible\-collections/community\.general/pull/1119)\)\.
@@ -1384,7 +1411,7 @@ All deprecation removals planned for <code>community\.general</code> 2\.0\.0 hav
* docker\_volume \- no longer returns <code>ansible\_facts</code> \([https\://github\.com/ansible\-collections/community\.docker/pull/1](https\://github\.com/ansible\-collections/community\.docker/pull/1)\)\.
* docker\_volume \- the <code>force</code> option has been removed\. Use <code>recreate</code> instead \([https\://github\.com/ansible\-collections/community\.docker/pull/1](https\://github\.com/ansible\-collections/community\.docker/pull/1)\)\.
-<a id="bugfixes-43"></a>
+<a id="bugfixes-44"></a>
### Bugfixes
* docker\_login \- fix internal config file storage to handle credentials for more than one registry \([https\://github\.com/ansible\-collections/community\.general/issues/1117](https\://github\.com/ansible\-collections/community\.general/issues/1117)\)\.
diff --git a/ansible_collections/community/docker/CHANGELOG.rst b/ansible_collections/community/docker/CHANGELOG.rst
index 74e43714e..1e2ef58a6 100644
--- a/ansible_collections/community/docker/CHANGELOG.rst
+++ b/ansible_collections/community/docker/CHANGELOG.rst
@@ -4,6 +4,29 @@ Docker Community Collection Release Notes
.. contents:: Topics
+v3.9.0
+======
+
+Release Summary
+---------------
+
+Bugfix and feature release.
+
+Minor Changes
+-------------
+
+- The EE requirements now include PyYAML, since the ``docker_compose_v2*`` modules depend on it when the ``definition`` option is used. This should not have a noticable effect on generated EEs since ansible-core itself depends on PyYAML as well, and ansible-builder explicitly ignores this dependency (https://github.com/ansible-collections/community.docker/pull/832).
+- docker_compose_v2* - the new option ``check_files_existing`` allows to disable the check for one of the files ``compose.yaml``, ``compose.yml``, ``docker-compose.yaml``, and ``docker-compose.yml`` in ``project_src`` if ``files`` is not specified. This is necessary if a non-standard compose filename is specified through other means, like the ``COMPOSE_FILE`` environment variable (https://github.com/ansible-collections/community.docker/issues/838, https://github.com/ansible-collections/community.docker/pull/839).
+- docker_compose_v2* modules - allow to provide an inline definition of the compose content instead of having to provide a ``project_src`` directory with the compose file written into it (https://github.com/ansible-collections/community.docker/issues/829, https://github.com/ansible-collections/community.docker/pull/832).
+- vendored Docker SDK for Python - remove unused code that relies on functionality deprecated in Python 3.12 (https://github.com/ansible-collections/community.docker/pull/834).
+
+Bugfixes
+--------
+
+- docker_compose_v2* - allow ``project_src`` to be a relative path, by converting it to an absolute path before using it (https://github.com/ansible-collections/community.docker/issues/827, https://github.com/ansible-collections/community.docker/pull/828).
+- docker_compose_v2* modules - abort with a nice error message instead of crash when the Docker Compose CLI plugin version is ``dev`` (https://github.com/ansible-collections/community.docker/issues/825, https://github.com/ansible-collections/community.docker/pull/826).
+- inventory plugins - add unsafe wrapper to avoid marking strings that do not contain ``{`` or ``}`` as unsafe, to work around a bug in AWX (https://github.com/ansible-collections/community.docker/pull/835).
+
v3.8.1
======
@@ -768,7 +791,7 @@ New major release with some deprecations removed and a breaking change in the ``
Breaking Changes / Porting Guide
--------------------------------
-- docker_compose - fixed ``timeout`` defaulting behavior so that ``stop_grace_period``, if defined in the compose file, will be used if `timeout`` is not specified (https://github.com/ansible-collections/community.docker/pull/163).
+- docker_compose - fixed ``timeout`` defaulting behavior so that ``stop_grace_period``, if defined in the compose file, will be used if ``timeout`` is not specified (https://github.com/ansible-collections/community.docker/pull/163).
Deprecated Features
-------------------
diff --git a/ansible_collections/community/docker/FILES.json b/ansible_collections/community/docker/FILES.json
index 9797df497..da52548f1 100644
--- a/ansible_collections/community/docker/FILES.json
+++ b/ansible_collections/community/docker/FILES.json
@@ -109,7 +109,7 @@
"name": ".azure-pipelines/azure-pipelines.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "4083b64eda9b5fdcbf472007a0a8edc921d46d7d2132b870ccddfc04b72aede1",
+ "chksum_sha256": "84dc585b738c2bfea68ee8e9cd6d4417f36627bd96a67f92b6f8073449b2d7af",
"format": 1
},
{
@@ -130,7 +130,7 @@
"name": ".github/workflows/ansible-test.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "c1b9c8b20850a848ebb8c91cdb9382cc3e521658fb2bbe1bb62f6357565e044d",
+ "chksum_sha256": "4082845558609060198c2628d77b14eb18b28f48faf0fc08116fee817b4e056c",
"format": 1
},
{
@@ -242,7 +242,7 @@
"name": "changelogs/changelog.yaml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "78b978f9536ee113fed773101c478a20057167e348c8d5b6cdb77f44e62d9b6f",
+ "chksum_sha256": "d3068c91410e1c891056bfdefa3812fb91ed3ccd41fe97b6aaa428debcd5b663",
"format": 1
},
{
@@ -291,7 +291,7 @@
"name": "docs/docsite/config.yml",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "a2d289e9f0e5f0151d1cd40963461f6427b69df33ba7dde69b950dc58912f016",
+ "chksum_sha256": "c2e717709f55bbeb87f08b2fe9722c91150c87f94a3245935becc186c5c8def4",
"format": 1
},
{
@@ -326,7 +326,7 @@
"name": "meta/ee-requirements.txt",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "1a36d9a4e747ef31cde1094f3d0805e912b142f9529f2332374bcb0ed34bd5c5",
+ "chksum_sha256": "d078015d25bf12defe85d0ca788cd997ce9fd8f71c08c96ab27c472346df378d",
"format": 1
},
{
@@ -410,7 +410,7 @@
"name": "plugins/doc_fragments/compose_v2.py",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "9e42aa81006fe5a72ef9713d008b616da75c6dbb0bc359ff892ced2885545166",
+ "chksum_sha256": "b92c9446b36c3a2d8faa368a8036561d65cf5dae443d5f6a26f8d800a767a9a5",
"format": 1
},
{
@@ -431,21 +431,21 @@
"name": "plugins/inventory/docker_containers.py",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "1d01e5f455339e704233d7df6597aae12be29a5fef4e6aef5fcb787cfb8030d2",
+ "chksum_sha256": "a4feea030c92ca0b3541d679ad49ae060430c0f5a3994fb589485a330613941a",
"format": 1
},
{
"name": "plugins/inventory/docker_machine.py",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "559ab252a16a63dc14a344be1f90ee66f976d8f3927f83dda2b3657fea0c1078",
+ "chksum_sha256": "3b3a1ef0f3d745a7b642777b7dd4126f153898a9c5f536091177442ed2d7c8ed",
"format": 1
},
{
"name": "plugins/inventory/docker_swarm.py",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "a01b5a62dffc44a43c42dfacff3ee1430d39c43c0d313a4289a12526bca33109",
+ "chksum_sha256": "04e5cf494bac339905130787fbdfe0ca23ab7caad8fec2f784d014937f86eeb1",
"format": 1
},
{
@@ -480,7 +480,7 @@
"name": "plugins/module_utils/_api/api/daemon.py",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "c3ff41f499911eba707f23fe05062adf3d5c7464138111c37d1afc30f913a2f8",
+ "chksum_sha256": "9a0d17ad9e1fc3ca2fe1d502273ad12442cfe46d32bcb19372f6bed32b1e0815",
"format": 1
},
{
@@ -648,7 +648,7 @@
"name": "plugins/module_utils/_api/utils/utils.py",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "951272b159d81117e35e73c6d67fce3ea9501b1edc6aace9580063a4a61936b4",
+ "chksum_sha256": "84d22ae2825223d88d2cc66386427828a3363cf549404a3be68880db91fc0bfa",
"format": 1
},
{
@@ -760,7 +760,7 @@
"name": "plugins/module_utils/compose_v2.py",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "60698c26cc1f0b0394ebd9ed2451d45681844d44c79c32b0e2921193feebc29f",
+ "chksum_sha256": "010f71093f38f18e9fcd1b5cd78a5babe601d2dd79ceb16642b999d299719b6f",
"format": 1
},
{
@@ -837,14 +837,14 @@
"name": "plugins/modules/docker_compose_v2.py",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "237adfe9c0e33461e576fe78fb2c5f82b089e9df202fa9e61ca5ab4bc39d4282",
+ "chksum_sha256": "299fc207fcda246f73bbb7213f0a3f1eca8c5ebf0a6344e571c867fff0eba258",
"format": 1
},
{
"name": "plugins/modules/docker_compose_v2_pull.py",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "16378b1ddf2c8914b0b9ec7adc4519f6b664787971ba46672b1ec05f593c1ca3",
+ "chksum_sha256": "a3171c449b56019853aaa8da3c6d8b54f2bf6fe03ce8da1ade87afcd32a07756",
"format": 1
},
{
@@ -1100,6 +1100,13 @@
"format": 1
},
{
+ "name": "plugins/plugin_utils/unsafe.py",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "93ccc2e18634405c7ff21a91a1df4f17261ac24b0f41bf3c46dbec2f254538c3",
+ "format": 1
+ },
+ {
"name": "tests",
"ftype": "dir",
"chksum_type": null,
@@ -1555,6 +1562,13 @@
"format": 1
},
{
+ "name": "tests/integration/targets/docker_compose_v2/tasks/tests/definition.yml",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "9a2483112e899562f769a66c3660d7d8fade379f6e2b7c09db7db578c59012a6",
+ "format": 1
+ },
+ {
"name": "tests/integration/targets/docker_compose_v2/tasks/tests/pull.yml",
"ftype": "file",
"chksum_type": "sha256",
@@ -5884,7 +5898,7 @@
"name": "tests/sanity/ignore-2.17.txt",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "77e2580c039e9062bb354b79bad043392a7e343f11e1797b35b3d28b6955de79",
+ "chksum_sha256": "f52743569e64513bef9795bab6cf6ccfde9b70a8cd5b81a3fe28994379468877",
"format": 1
},
{
@@ -5895,6 +5909,20 @@
"format": 1
},
{
+ "name": "tests/sanity/ignore-2.18.txt",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "f52743569e64513bef9795bab6cf6ccfde9b70a8cd5b81a3fe28994379468877",
+ "format": 1
+ },
+ {
+ "name": "tests/sanity/ignore-2.18.txt.license",
+ "ftype": "file",
+ "chksum_type": "sha256",
+ "chksum_sha256": "6eb915239f9f35407fa68fdc41ed6522f1fdcce11badbdcd6057548023179ac1",
+ "format": 1
+ },
+ {
"name": "tests/unit",
"ftype": "dir",
"chksum_type": null,
@@ -5996,7 +6024,7 @@
"name": "tests/unit/plugins/module_utils/_api/api/test_client.py",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "5114474e56b443ac90b48d2ce7d140c825da8cf52cc9d12f1285fd868089a2d2",
+ "chksum_sha256": "9c9b531983d18111c1ae36320dead46e6a98637a258c5335e29e85915447a768",
"format": 1
},
{
@@ -6360,7 +6388,7 @@
"name": "CHANGELOG.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "a454d168d730e40228bc1b635787e39f4f1dd9561117c1c0472203fb3850ea45",
+ "chksum_sha256": "b7838b371ac49712b398b2cc47e2959e020fbe727275fc1052c8e49489bc3596",
"format": 1
},
{
@@ -6374,7 +6402,7 @@
"name": "CHANGELOG.rst",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "c0938e99f68c7ca4fce239f527e9a251a8c32562d4f89065fd2f4b53187f6408",
+ "chksum_sha256": "8593cb523e7f0bfece19e9dd82a25d06277269451d1334d15c15a868272bcb63",
"format": 1
},
{
@@ -6395,7 +6423,7 @@
"name": "README.md",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "f2ed87985a5ed9319821b58e4f4e124db2e06f1b6c60a28c9f50a2666d37ca6f",
+ "chksum_sha256": "18391f2b88eae674b860ad2cd1ac1426dc64299c91965aa4d30b69ff269aac5f",
"format": 1
}
],
diff --git a/ansible_collections/community/docker/MANIFEST.json b/ansible_collections/community/docker/MANIFEST.json
index ac81cb0ff..447bfc1ce 100644
--- a/ansible_collections/community/docker/MANIFEST.json
+++ b/ansible_collections/community/docker/MANIFEST.json
@@ -2,7 +2,7 @@
"collection_info": {
"namespace": "community",
"name": "docker",
- "version": "3.8.1",
+ "version": "3.9.0",
"authors": [
"Ansible Docker Working Group"
],
@@ -28,7 +28,7 @@
"name": "FILES.json",
"ftype": "file",
"chksum_type": "sha256",
- "chksum_sha256": "b8f523a2e97dadfa557a707eca6cb96b06b64396f46e33fb6c9bfcb200345094",
+ "chksum_sha256": "f1b0cee31d5d2e869134e845593489c03632024171cd300f35688fb089e7bf2d",
"format": 1
},
"format": 1
diff --git a/ansible_collections/community/docker/README.md b/ansible_collections/community/docker/README.md
index 1bee82833..0d169c54a 100644
--- a/ansible_collections/community/docker/README.md
+++ b/ansible_collections/community/docker/README.md
@@ -16,7 +16,7 @@ Please note that this collection does **not** support Windows targets. The conne
## Tested with Ansible
-Tested with the current ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, ansible-core 2.14, ansible-core 2.15, and ansible-core 2.16 releases, and the current development version of ansible-core. Ansible/ansible-base versions before 2.11.0 are not supported.
+Tested with the current ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, ansible-core 2.14, ansible-core 2.15, ansible-core 2.16, and ansible-core 2.17 releases, and the current development version of ansible-core. Ansible/ansible-base versions before 2.11.0 are not supported.
Please note that Ansible 2.9 and ansible-base 2.10 are no longer supported. If you need to use them, use community.docker 2.x.y. Also note that this collection does not work with ansible-core 2.11 (this includes ansible-base and Ansible 2.9) on Python 3.12+.
diff --git a/ansible_collections/community/docker/changelogs/changelog.yaml b/ansible_collections/community/docker/changelogs/changelog.yaml
index db03d2485..fc22ba446 100644
--- a/ansible_collections/community/docker/changelogs/changelog.yaml
+++ b/ansible_collections/community/docker/changelogs/changelog.yaml
@@ -436,7 +436,7 @@ releases:
changes:
breaking_changes:
- docker_compose - fixed ``timeout`` defaulting behavior so that ``stop_grace_period``,
- if defined in the compose file, will be used if `timeout`` is not specified
+ if defined in the compose file, will be used if ``timeout`` is not specified
(https://github.com/ansible-collections/community.docker/pull/163).
deprecated_features:
- docker_container - using the special value ``all`` in ``published_ports``
@@ -1623,3 +1623,41 @@ releases:
- 814-docker_compose_v2_pull-idem.yml
- inventory-rce.yml
release_date: '2024-03-16'
+ 3.9.0:
+ changes:
+ bugfixes:
+ - docker_compose_v2* - allow ``project_src`` to be a relative path, by converting
+ it to an absolute path before using it (https://github.com/ansible-collections/community.docker/issues/827,
+ https://github.com/ansible-collections/community.docker/pull/828).
+ - docker_compose_v2* modules - abort with a nice error message instead of crash
+ when the Docker Compose CLI plugin version is ``dev`` (https://github.com/ansible-collections/community.docker/issues/825,
+ https://github.com/ansible-collections/community.docker/pull/826).
+ - inventory plugins - add unsafe wrapper to avoid marking strings that do not
+ contain ``{`` or ``}`` as unsafe, to work around a bug in AWX (https://github.com/ansible-collections/community.docker/pull/835).
+ minor_changes:
+ - The EE requirements now include PyYAML, since the ``docker_compose_v2*`` modules
+ depend on it when the ``definition`` option is used. This should not have
+ a noticable effect on generated EEs since ansible-core itself depends on PyYAML
+ as well, and ansible-builder explicitly ignores this dependency (https://github.com/ansible-collections/community.docker/pull/832).
+ - docker_compose_v2* - the new option ``check_files_existing`` allows to disable
+ the check for one of the files ``compose.yaml``, ``compose.yml``, ``docker-compose.yaml``,
+ and ``docker-compose.yml`` in ``project_src`` if ``files`` is not specified.
+ This is necessary if a non-standard compose filename is specified through
+ other means, like the ``COMPOSE_FILE`` environment variable (https://github.com/ansible-collections/community.docker/issues/838,
+ https://github.com/ansible-collections/community.docker/pull/839).
+ - docker_compose_v2* modules - allow to provide an inline definition of the
+ compose content instead of having to provide a ``project_src`` directory with
+ the compose file written into it (https://github.com/ansible-collections/community.docker/issues/829,
+ https://github.com/ansible-collections/community.docker/pull/832).
+ - vendored Docker SDK for Python - remove unused code that relies on functionality
+ deprecated in Python 3.12 (https://github.com/ansible-collections/community.docker/pull/834).
+ release_summary: Bugfix and feature release.
+ fragments:
+ - 3.9.0.yml
+ - 826-docker-compose-v2-version.yml
+ - 828-compose-project_src.yml
+ - 832-docker_compose_v2-definition.yml
+ - 834-datetime-depr.yml
+ - 835-unsafe.yml
+ - 839-compose_v2-check-file.yml
+ release_date: '2024-04-21'
diff --git a/ansible_collections/community/docker/docs/docsite/config.yml b/ansible_collections/community/docker/docs/docsite/config.yml
index 846b95f62..48eedc269 100644
--- a/ansible_collections/community/docker/docs/docsite/config.yml
+++ b/ansible_collections/community/docker/docs/docsite/config.yml
@@ -13,3 +13,6 @@ envvar_directives:
- DOCKER_TLS
- DOCKER_TLS_HOSTNAME
- DOCKER_TLS_VERIFY
+
+changelog:
+ write_changelog: true
diff --git a/ansible_collections/community/docker/meta/ee-requirements.txt b/ansible_collections/community/docker/meta/ee-requirements.txt
index de03ff0fd..099dcf9a8 100644
--- a/ansible_collections/community/docker/meta/ee-requirements.txt
+++ b/ansible_collections/community/docker/meta/ee-requirements.txt
@@ -6,6 +6,7 @@ docker
urllib3
requests
paramiko
+pyyaml
# We assume that EEs are not based on Windows, and have Python >= 3.5.
# (ansible-builder does not support conditionals, it will simply add
diff --git a/ansible_collections/community/docker/plugins/doc_fragments/compose_v2.py b/ansible_collections/community/docker/plugins/doc_fragments/compose_v2.py
index 4e21f974c..234a94fe2 100644
--- a/ansible_collections/community/docker/plugins/doc_fragments/compose_v2.py
+++ b/ansible_collections/community/docker/plugins/doc_fragments/compose_v2.py
@@ -18,20 +18,30 @@ options:
- Path to a directory containing a Compose file
(C(compose.yml), C(compose.yaml), C(docker-compose.yml), or C(docker-compose.yaml)).
- If O(files) is provided, will look for these files in this directory instead.
+ - Mutually exclusive with O(definition).
type: path
- required: true
project_name:
description:
- Provide a project name. If not provided, the project name is taken from the basename of O(project_src).
+ - Required when O(definition) is provided.
type: str
files:
description:
- List of Compose file names relative to O(project_src) to be used instead of the main Compose file
(C(compose.yml), C(compose.yaml), C(docker-compose.yml), or C(docker-compose.yaml)).
- Files are loaded and merged in the order given.
+ - Mutually exclusive with O(definition).
type: list
elements: path
version_added: 3.7.0
+ definition:
+ description:
+ - Compose file describing one or more services, networks and volumes.
+ - Mutually exclusive with O(project_src) and O(files).
+ - If provided, PyYAML must be available to this module, and O(project_name) must be specified.
+ - Note that a temporary directory will be created and deleted afterwards when using this option.
+ type: dict
+ version_added: 3.9.0
env_files:
description:
- By default environment files are loaded from a C(.env) file located directly under the O(project_src) directory.
@@ -45,6 +55,19 @@ options:
- Equivalent to C(docker compose --profile).
type: list
elements: str
+ check_files_existing:
+ description:
+ - If set to V(false), the module will not check whether one of the files
+ C(compose.yaml), C(compose.yml), C(docker-compose.yaml), or C(docker-compose.yml)
+ exists in O(project_src) if O(files) is not provided.
+ - This can be useful if environment files with C(COMPOSE_FILE) are used to configure a different
+ filename. The module currently does not check for C(COMPOSE_FILE) in environment files or the
+ current environment.
+ type: bool
+ default: true
+ version_added: 3.9.0
+requirements:
+ - "PyYAML if O(definition) is used"
notes:
- |-
The Docker compose CLI plugin has no stable output format (see for example U(https://github.com/docker/compose/issues/10872)),
diff --git a/ansible_collections/community/docker/plugins/inventory/docker_containers.py b/ansible_collections/community/docker/plugins/inventory/docker_containers.py
index 75b49ff92..0cae05472 100644
--- a/ansible_collections/community/docker/plugins/inventory/docker_containers.py
+++ b/ansible_collections/community/docker/plugins/inventory/docker_containers.py
@@ -167,7 +167,6 @@ import re
from ansible.errors import AnsibleError
from ansible.module_utils.common.text.converters import to_native
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable
-from ansible.utils.unsafe_proxy import wrap_var as make_unsafe
from ansible_collections.community.docker.plugins.module_utils.common_api import (
RequestException,
@@ -180,6 +179,7 @@ from ansible_collections.community.docker.plugins.plugin_utils.common_api import
)
from ansible_collections.community.docker.plugins.module_utils._api.errors import APIError, DockerException
+from ansible_collections.community.docker.plugins.plugin_utils.unsafe import make_unsafe
from ansible_collections.community.library_inventory_filtering_v1.plugins.plugin_utils.inventory_filter import parse_filters, filter_host
MIN_DOCKER_API = None
diff --git a/ansible_collections/community/docker/plugins/inventory/docker_machine.py b/ansible_collections/community/docker/plugins/inventory/docker_machine.py
index e3330a339..984c9932b 100644
--- a/ansible_collections/community/docker/plugins/inventory/docker_machine.py
+++ b/ansible_collections/community/docker/plugins/inventory/docker_machine.py
@@ -96,8 +96,8 @@ from ansible.module_utils.common.text.converters import to_text
from ansible.module_utils.common.process import get_bin_path
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
from ansible.utils.display import Display
-from ansible.utils.unsafe_proxy import wrap_var as make_unsafe
+from ansible_collections.community.docker.plugins.plugin_utils.unsafe import make_unsafe
from ansible_collections.community.library_inventory_filtering_v1.plugins.plugin_utils.inventory_filter import parse_filters, filter_host
import json
diff --git a/ansible_collections/community/docker/plugins/inventory/docker_swarm.py b/ansible_collections/community/docker/plugins/inventory/docker_swarm.py
index 0d60033f9..acceac86c 100644
--- a/ansible_collections/community/docker/plugins/inventory/docker_swarm.py
+++ b/ansible_collections/community/docker/plugins/inventory/docker_swarm.py
@@ -159,8 +159,8 @@ from ansible_collections.community.docker.plugins.module_utils.common import get
from ansible_collections.community.docker.plugins.module_utils.util import update_tls_hostname
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable
from ansible.parsing.utils.addresses import parse_address
-from ansible.utils.unsafe_proxy import wrap_var as make_unsafe
+from ansible_collections.community.docker.plugins.plugin_utils.unsafe import make_unsafe
from ansible_collections.community.library_inventory_filtering_v1.plugins.plugin_utils.inventory_filter import parse_filters, filter_host
try:
diff --git a/ansible_collections/community/docker/plugins/module_utils/_api/api/daemon.py b/ansible_collections/community/docker/plugins/module_utils/_api/api/daemon.py
index 9e7adbf3f..16d1d1243 100644
--- a/ansible_collections/community/docker/plugins/module_utils/_api/api/daemon.py
+++ b/ansible_collections/community/docker/plugins/module_utils/_api/api/daemon.py
@@ -11,12 +11,9 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
-from datetime import datetime
from .. import auth
-from ..utils.utils import datetime_to_timestamp, convert_filters
from ..utils.decorators import minimum_version
-from ..types.daemon import CancellableStream
class DaemonApiMixin(object):
@@ -36,65 +33,6 @@ class DaemonApiMixin(object):
url = self._url('/system/df')
return self._result(self._get(url), True)
- def events(self, since=None, until=None, filters=None, decode=None):
- """
- Get real-time events from the server. Similar to the ``docker events``
- command.
-
- Args:
- since (UTC datetime or int): Get events from this point
- until (UTC datetime or int): Get events until this point
- filters (dict): Filter the events by event time, container or image
- decode (bool): If set to true, stream will be decoded into dicts on
- the fly. False by default.
-
- Returns:
- A :py:class:`docker.types.daemon.CancellableStream` generator
-
- Raises:
- :py:class:`docker.errors.APIError`
- If the server returns an error.
-
- Example:
-
- >>> for event in client.events(decode=True)
- ... print(event)
- {u'from': u'image/with:tag',
- u'id': u'container-id',
- u'status': u'start',
- u'time': 1423339459}
- ...
-
- or
-
- >>> events = client.events()
- >>> for event in events:
- ... print(event)
- >>> # and cancel from another thread
- >>> events.close()
- """
-
- if isinstance(since, datetime):
- since = datetime_to_timestamp(since)
-
- if isinstance(until, datetime):
- until = datetime_to_timestamp(until)
-
- if filters:
- filters = convert_filters(filters)
-
- params = {
- 'since': since,
- 'until': until,
- 'filters': filters
- }
- url = self._url('/events')
-
- response = self._get(url, params=params, stream=True, timeout=None)
- stream = self._stream_helper(response, decode=decode)
-
- return CancellableStream(stream, response)
-
def info(self):
"""
Display system-wide information. Identical to the ``docker info``
diff --git a/ansible_collections/community/docker/plugins/module_utils/_api/utils/utils.py b/ansible_collections/community/docker/plugins/module_utils/_api/utils/utils.py
index db3718d4d..cdf3eedd2 100644
--- a/ansible_collections/community/docker/plugins/module_utils/_api/utils/utils.py
+++ b/ansible_collections/community/docker/plugins/module_utils/_api/utils/utils.py
@@ -17,7 +17,6 @@ import os
import os.path
import shlex
import string
-from datetime import datetime
from ansible_collections.community.docker.plugins.module_utils.version import StrictVersion
from ansible.module_utils.six import PY2, PY3, binary_type, integer_types, iteritems, string_types, text_type
@@ -421,12 +420,6 @@ def convert_filters(filters):
return json.dumps(result)
-def datetime_to_timestamp(dt):
- """Convert a UTC datetime to a Unix timestamp"""
- delta = dt - datetime.utcfromtimestamp(0)
- return delta.seconds + delta.days * 24 * 3600
-
-
def parse_bytes(s):
if isinstance(s, integer_types + (float,)):
return s
diff --git a/ansible_collections/community/docker/plugins/module_utils/compose_v2.py b/ansible_collections/community/docker/plugins/module_utils/compose_v2.py
index 92f109269..85fbd5d80 100644
--- a/ansible_collections/community/docker/plugins/module_utils/compose_v2.py
+++ b/ansible_collections/community/docker/plugins/module_utils/compose_v2.py
@@ -9,8 +9,12 @@ __metaclass__ = type
import os
import re
+import shutil
+import tempfile
+import traceback
from collections import namedtuple
+from ansible.module_utils.basic import missing_required_lib
from ansible.module_utils.common.text.converters import to_native
from ansible.module_utils.six.moves import shlex_quote
@@ -21,6 +25,19 @@ from ansible_collections.community.docker.plugins.module_utils._logfmt import (
parse_line as _parse_logfmt_line,
)
+try:
+ import yaml
+ try:
+ # use C version if possible for speedup
+ from yaml import CSafeDumper as _SafeDumper
+ except ImportError:
+ from yaml import SafeDumper as _SafeDumper
+ HAS_PYYAML = True
+ PYYAML_IMPORT_ERROR = None
+except ImportError:
+ HAS_PYYAML = False
+ PYYAML_IMPORT_ERROR = traceback.format_exc()
+
DOCKER_COMPOSE_FILES = ('compose.yaml', 'compose.yml', 'docker-compose.yaml', 'docker-compose.yml')
@@ -484,11 +501,26 @@ def update_failed(result, events, args, stdout, stderr, rc, cli):
def common_compose_argspec():
return dict(
- project_src=dict(type='path', required=True),
+ project_src=dict(type='path'),
project_name=dict(type='str'),
files=dict(type='list', elements='path'),
+ definition=dict(type='dict'),
env_files=dict(type='list', elements='path'),
profiles=dict(type='list', elements='str'),
+ check_files_existing=dict(type='bool', default=True),
+ )
+
+
+def common_compose_argspec_ex():
+ return dict(
+ argspec=common_compose_argspec(),
+ mutually_exclusive=[
+ ('definition', 'project_src'),
+ ('definition', 'files')
+ ],
+ required_by={
+ 'definition': ('project_name', ),
+ },
)
@@ -505,37 +537,67 @@ class BaseComposeManager(DockerBaseClass):
super(BaseComposeManager, self).__init__()
self.client = client
self.check_mode = self.client.check_mode
+ self.cleanup_dirs = set()
parameters = self.client.module.params
- self.project_src = parameters['project_src']
+ if parameters['definition'] is not None and not HAS_PYYAML:
+ self.fail(
+ missing_required_lib('PyYAML'),
+ exception=PYYAML_IMPORT_ERROR
+ )
+
self.project_name = parameters['project_name']
+ if parameters['definition'] is not None:
+ self.project_src = tempfile.mkdtemp(prefix='ansible')
+ self.cleanup_dirs.add(self.project_src)
+ compose_file = os.path.join(self.project_src, 'compose.yaml')
+ self.client.module.add_cleanup_file(compose_file)
+ try:
+ with open(compose_file, 'wb') as f:
+ yaml.dump(parameters['definition'], f, encoding="utf-8", Dumper=_SafeDumper)
+ except Exception as exc:
+ self.fail("Error writing to %s - %s" % (compose_file, to_native(exc)))
+ else:
+ self.project_src = os.path.abspath(parameters['project_src'])
+
self.files = parameters['files']
self.env_files = parameters['env_files']
self.profiles = parameters['profiles']
compose = self.client.get_client_plugin_info('compose')
if compose is None:
- self.client.fail('Docker CLI {0} does not have the compose plugin installed'.format(self.client.get_cli()))
+ self.fail('Docker CLI {0} does not have the compose plugin installed'.format(self.client.get_cli()))
+ if compose['Version'] == 'dev':
+ self.fail(
+ 'Docker CLI {0} has a compose plugin installed, but it reports version "dev".'
+ ' Please use a version of the plugin that returns a proper version.'
+ .format(self.client.get_cli())
+ )
compose_version = compose['Version'].lstrip('v')
self.compose_version = LooseVersion(compose_version)
if self.compose_version < LooseVersion(min_version):
- self.client.fail('Docker CLI {cli} has the compose plugin with version {version}; need version {min_version} or later'.format(
+ self.fail('Docker CLI {cli} has the compose plugin with version {version}; need version {min_version} or later'.format(
cli=self.client.get_cli(),
version=compose_version,
min_version=min_version,
))
if not os.path.isdir(self.project_src):
- self.client.fail('"{0}" is not a directory'.format(self.project_src))
+ self.fail('"{0}" is not a directory'.format(self.project_src))
+ self.check_files_existing = parameters['check_files_existing']
if self.files:
for file in self.files:
path = os.path.join(self.project_src, file)
if not os.path.exists(path):
- self.client.fail('Cannot find Compose file "{0}" relative to project directory "{1}"'.format(file, self.project_src))
- elif all(not os.path.exists(os.path.join(self.project_src, f)) for f in DOCKER_COMPOSE_FILES):
+ self.fail('Cannot find Compose file "{0}" relative to project directory "{1}"'.format(file, self.project_src))
+ elif self.check_files_existing and all(not os.path.exists(os.path.join(self.project_src, f)) for f in DOCKER_COMPOSE_FILES):
filenames = ', '.join(DOCKER_COMPOSE_FILES[:-1])
- self.client.fail('"{0}" does not contain {1}, or {2}'.format(self.project_src, filenames, DOCKER_COMPOSE_FILES[-1]))
+ self.fail('"{0}" does not contain {1}, or {2}'.format(self.project_src, filenames, DOCKER_COMPOSE_FILES[-1]))
+
+ def fail(self, msg, **kwargs):
+ self.cleanup()
+ self.client.fail(msg, **kwargs)
def get_base_args(self):
args = ['compose', '--ansi', 'never']
@@ -616,3 +678,11 @@ class BaseComposeManager(DockerBaseClass):
for res in ('stdout', 'stderr'):
if result.get(res) == '':
result.pop(res)
+
+ def cleanup(self):
+ for dir in self.cleanup_dirs:
+ try:
+ shutil.rmtree(dir, True)
+ except Exception:
+ # shouldn't happen, but simply ignore to be on the safe side
+ pass
diff --git a/ansible_collections/community/docker/plugins/modules/docker_compose_v2.py b/ansible_collections/community/docker/plugins/modules/docker_compose_v2.py
index 29bb81ad9..9972d45f6 100644
--- a/ansible_collections/community/docker/plugins/modules/docker_compose_v2.py
+++ b/ansible_collections/community/docker/plugins/modules/docker_compose_v2.py
@@ -409,7 +409,7 @@ from ansible_collections.community.docker.plugins.module_utils.common_cli import
from ansible_collections.community.docker.plugins.module_utils.compose_v2 import (
BaseComposeManager,
- common_compose_argspec,
+ common_compose_argspec_ex,
is_failed,
)
@@ -435,13 +435,13 @@ class ServicesManager(BaseComposeManager):
for key, value in self.scale.items():
if not isinstance(key, string_types):
- self.client.fail('The key %s for `scale` is not a string' % repr(key))
+ self.fail('The key %s for `scale` is not a string' % repr(key))
try:
value = check_type_int(value)
except TypeError as exc:
- self.client.fail('The value %s for `scale[%s]` is not an integer' % (repr(value), repr(key)))
+ self.fail('The value %s for `scale[%s]` is not an integer' % (repr(value), repr(key)))
if value < 0:
- self.client.fail('The value %s for `scale[%s]` is negative' % (repr(value), repr(key)))
+ self.fail('The value %s for `scale[%s]` is negative' % (repr(value), repr(key)))
self.scale[key] = value
def run(self):
@@ -620,15 +620,19 @@ def main():
wait=dict(type='bool', default=False),
wait_timeout=dict(type='int'),
)
- argument_spec.update(common_compose_argspec())
+ argspec_ex = common_compose_argspec_ex()
+ argument_spec.update(argspec_ex.pop('argspec'))
client = AnsibleModuleDockerClient(
argument_spec=argument_spec,
supports_check_mode=True,
+ **argspec_ex
)
try:
- result = ServicesManager(client).run()
+ manager = ServicesManager(client)
+ result = manager.run()
+ manager.cleanup()
client.module.exit_json(**result)
except DockerException as e:
client.fail('An unexpected docker error occurred: {0}'.format(to_native(e)), exception=traceback.format_exc())
diff --git a/ansible_collections/community/docker/plugins/modules/docker_compose_v2_pull.py b/ansible_collections/community/docker/plugins/modules/docker_compose_v2_pull.py
index 2b1980bf6..6b091f9aa 100644
--- a/ansible_collections/community/docker/plugins/modules/docker_compose_v2_pull.py
+++ b/ansible_collections/community/docker/plugins/modules/docker_compose_v2_pull.py
@@ -102,7 +102,7 @@ from ansible_collections.community.docker.plugins.module_utils.common_cli import
from ansible_collections.community.docker.plugins.module_utils.compose_v2 import (
BaseComposeManager,
- common_compose_argspec,
+ common_compose_argspec_ex,
)
from ansible_collections.community.docker.plugins.module_utils.version import LooseVersion
@@ -117,7 +117,7 @@ class PullManager(BaseComposeManager):
if self.policy != 'always' and self.compose_version < LooseVersion('2.22.0'):
# https://github.com/docker/compose/pull/10981 - 2.22.0
- self.client.fail('A pull policy other than always is only supported since Docker Compose 2.22.0. {0} has version {1}'.format(
+ self.fail('A pull policy other than always is only supported since Docker Compose 2.22.0. {0} has version {1}'.format(
self.client.get_cli(), self.compose_version))
def get_pull_cmd(self, dry_run, no_start=False):
@@ -145,15 +145,19 @@ def main():
argument_spec = dict(
policy=dict(type='str', choices=['always', 'missing'], default='always'),
)
- argument_spec.update(common_compose_argspec())
+ argspec_ex = common_compose_argspec_ex()
+ argument_spec.update(argspec_ex.pop('argspec'))
client = AnsibleModuleDockerClient(
argument_spec=argument_spec,
supports_check_mode=True,
+ **argspec_ex
)
try:
- result = PullManager(client).run()
+ manager = PullManager(client)
+ result = manager.run()
+ manager.cleanup()
client.module.exit_json(**result)
except DockerException as e:
client.fail('An unexpected docker error occurred: {0}'.format(to_native(e)), exception=traceback.format_exc())
diff --git a/ansible_collections/community/docker/plugins/plugin_utils/unsafe.py b/ansible_collections/community/docker/plugins/plugin_utils/unsafe.py
new file mode 100644
index 000000000..1eb61bea0
--- /dev/null
+++ b/ansible_collections/community/docker/plugins/plugin_utils/unsafe.py
@@ -0,0 +1,41 @@
+# Copyright (c) 2023, Felix Fontein <felix@fontein.de>
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
+import re
+
+from ansible.module_utils.six import binary_type, text_type
+from ansible.module_utils.common._collections_compat import Mapping, Set
+from ansible.module_utils.common.collections import is_sequence
+from ansible.utils.unsafe_proxy import (
+ AnsibleUnsafe,
+ wrap_var as _make_unsafe,
+)
+
+_RE_TEMPLATE_CHARS = re.compile(u'[{}]')
+_RE_TEMPLATE_CHARS_BYTES = re.compile(b'[{}]')
+
+
+def make_unsafe(value):
+ if value is None or isinstance(value, AnsibleUnsafe):
+ return value
+
+ if isinstance(value, Mapping):
+ return dict((make_unsafe(key), make_unsafe(val)) for key, val in value.items())
+ elif isinstance(value, Set):
+ return set(make_unsafe(elt) for elt in value)
+ elif is_sequence(value):
+ return type(value)(make_unsafe(elt) for elt in value)
+ elif isinstance(value, binary_type):
+ if _RE_TEMPLATE_CHARS_BYTES.search(value):
+ value = _make_unsafe(value)
+ return value
+ elif isinstance(value, text_type):
+ if _RE_TEMPLATE_CHARS.search(value):
+ value = _make_unsafe(value)
+ return value
+
+ return value
diff --git a/ansible_collections/community/docker/tests/integration/targets/docker_compose_v2/tasks/tests/definition.yml b/ansible_collections/community/docker/tests/integration/targets/docker_compose_v2/tasks/tests/definition.yml
new file mode 100644
index 000000000..4b88edcd1
--- /dev/null
+++ b/ansible_collections/community/docker/tests/integration/targets/docker_compose_v2/tasks/tests/definition.yml
@@ -0,0 +1,264 @@
+---
+# Copyright (c) Ansible Project
+# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+- vars:
+ pname: "{{ name_prefix }}-definition"
+ cname: "{{ name_prefix }}-container"
+ test_service: |
+ services:
+ {{ cname }}:
+ image: "{{ docker_test_image_alpine }}"
+ command: '/bin/sh -c "sleep 10m"'
+ stop_grace_period: 1s
+ test_service_mod: |
+ services:
+ {{ cname }}:
+ image: "{{ docker_test_image_alpine }}"
+ command: '/bin/sh -c "sleep 15m"'
+ stop_grace_period: 1s
+
+ block:
+ - name: Registering container name
+ set_fact:
+ cnames: "{{ cnames + [pname ~ '-' ~ cname ~ '-1'] }}"
+ dnetworks: "{{ dnetworks + [pname ~ '_default'] }}"
+
+####################################################################
+## Present #########################################################
+####################################################################
+
+ - name: Present (check)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: present
+ check_mode: true
+ register: present_1_check
+
+ - name: Present
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: present
+ register: present_1
+
+ - name: Present (idempotent check)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: present
+ check_mode: true
+ register: present_2_check
+
+ - name: Present (idempotent)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: present
+ register: present_2
+
+ - name: Present (changed check)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service_mod | from_yaml }}'
+ state: present
+ check_mode: true
+ register: present_3_check
+
+ - name: Present (changed)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service_mod | from_yaml }}'
+ state: present
+ register: present_3
+
+ - assert:
+ that:
+ - present_1_check is changed
+ - present_1 is changed
+ - present_1.containers | length == 1
+ - present_1.containers[0].Name == pname ~ '-' ~ cname ~ '-1'
+ - present_1.containers[0].Image == docker_test_image_alpine
+ - present_1.images | length == 1
+ - present_1.images[0].ContainerName == pname ~ '-' ~ cname ~ '-1'
+ - present_1.images[0].Repository == (docker_test_image_alpine | split(':') | first)
+ - present_1.images[0].Tag == (docker_test_image_alpine | split(':') | last)
+ - present_2_check is not changed
+ - present_2 is not changed
+ - present_3_check is changed
+ - present_3 is changed
+
+####################################################################
+## Absent ##########################################################
+####################################################################
+
+ - name: Absent (check)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service_mod | from_yaml }}'
+ state: absent
+ check_mode: true
+ register: absent_1_check
+
+ - name: Absent
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service_mod | from_yaml }}'
+ state: absent
+ register: absent_1
+
+ - name: Absent (idempotent check)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service_mod | from_yaml }}'
+ state: absent
+ check_mode: true
+ register: absent_2_check
+
+ - name: Absent (idempotent)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service_mod | from_yaml }}'
+ state: absent
+ register: absent_2
+
+ - assert:
+ that:
+ - absent_1_check is changed
+ - absent_1 is changed
+ - absent_2_check is not changed
+ - absent_2 is not changed
+
+####################################################################
+## Stopping and starting ###########################################
+####################################################################
+
+ - name: Present stopped (check)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: stopped
+ check_mode: true
+ register: present_1_check
+
+ - name: Present stopped
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: stopped
+ register: present_1
+
+ - name: Present stopped (idempotent check)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: stopped
+ check_mode: true
+ register: present_2_check
+
+ - name: Present stopped (idempotent)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: stopped
+ register: present_2
+
+ - name: Started (check)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: present
+ check_mode: true
+ register: present_3_check
+
+ - name: Started
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: present
+ register: present_3
+
+ - name: Started (idempotent check)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: present
+ check_mode: true
+ register: present_4_check
+
+ - name: Started (idempotent)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: present
+ register: present_4
+
+ - name: Restarted (check)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: restarted
+ check_mode: true
+ register: present_5_check
+
+ - name: Restarted
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: restarted
+ register: present_5
+
+ - name: Stopped (check)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: stopped
+ check_mode: true
+ register: present_6_check
+
+ - name: Stopped
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: stopped
+ register: present_6
+
+ - name: Restarted (check)
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: restarted
+ check_mode: true
+ register: present_7_check
+
+ - name: Restarted
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: restarted
+ register: present_7
+
+ - name: Cleanup
+ docker_compose_v2:
+ project_name: '{{ pname }}'
+ definition: '{{ test_service | from_yaml }}'
+ state: absent
+
+ - assert:
+ that:
+ - present_1_check is changed
+ - present_1 is changed
+ - present_2_check is not changed
+ - present_2 is not changed
+ - present_3_check is changed
+ - present_3 is changed
+ - present_4_check is not changed
+ - present_4 is not changed
+ - present_5_check is changed
+ - present_5 is changed
+ - present_6_check is changed
+ - present_6 is changed
+ - present_7_check is changed
+ - present_7 is changed
diff --git a/ansible_collections/community/docker/tests/sanity/ignore-2.17.txt b/ansible_collections/community/docker/tests/sanity/ignore-2.17.txt
index 12e0b26f9..f1974bd5e 100644
--- a/ansible_collections/community/docker/tests/sanity/ignore-2.17.txt
+++ b/ansible_collections/community/docker/tests/sanity/ignore-2.17.txt
@@ -1 +1,4 @@
plugins/modules/docker_container_copy_into.py validate-modules:undocumented-parameter # _max_file_size_for_diff is used by the action plugin
+plugins/module_utils/_api/api/client.py pylint:use-yield-from # suggested construct does not work with Python 2
+plugins/module_utils/_api/utils/build.py pylint:use-yield-from # suggested construct does not work with Python 2
+tests/unit/plugins/module_utils/test_copy.py pylint:use-yield-from # suggested construct does not work with Python 2
diff --git a/ansible_collections/community/docker/tests/sanity/ignore-2.18.txt b/ansible_collections/community/docker/tests/sanity/ignore-2.18.txt
new file mode 100644
index 000000000..f1974bd5e
--- /dev/null
+++ b/ansible_collections/community/docker/tests/sanity/ignore-2.18.txt
@@ -0,0 +1,4 @@
+plugins/modules/docker_container_copy_into.py validate-modules:undocumented-parameter # _max_file_size_for_diff is used by the action plugin
+plugins/module_utils/_api/api/client.py pylint:use-yield-from # suggested construct does not work with Python 2
+plugins/module_utils/_api/utils/build.py pylint:use-yield-from # suggested construct does not work with Python 2
+tests/unit/plugins/module_utils/test_copy.py pylint:use-yield-from # suggested construct does not work with Python 2
diff --git a/ansible_collections/community/docker/tests/sanity/ignore-2.18.txt.license b/ansible_collections/community/docker/tests/sanity/ignore-2.18.txt.license
new file mode 100644
index 000000000..edff8c768
--- /dev/null
+++ b/ansible_collections/community/docker/tests/sanity/ignore-2.18.txt.license
@@ -0,0 +1,3 @@
+GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
+SPDX-License-Identifier: GPL-3.0-or-later
+SPDX-FileCopyrightText: Ansible Project
diff --git a/ansible_collections/community/docker/tests/unit/plugins/module_utils/_api/api/test_client.py b/ansible_collections/community/docker/tests/unit/plugins/module_utils/_api/api/test_client.py
index 57040b631..87769a3cd 100644
--- a/ansible_collections/community/docker/tests/unit/plugins/module_utils/_api/api/test_client.py
+++ b/ansible_collections/community/docker/tests/unit/plugins/module_utils/_api/api/test_client.py
@@ -35,7 +35,6 @@ if sys.version_info < (2, 7):
from ansible_collections.community.docker.plugins.module_utils._api import constants, errors
from ansible_collections.community.docker.plugins.module_utils._api.api.client import APIClient
from ansible_collections.community.docker.plugins.module_utils._api.constants import DEFAULT_DOCKER_API_VERSION
-from ansible_collections.community.docker.plugins.module_utils._api.utils.utils import convert_filters
from requests.packages import urllib3
from .. import fake_api
@@ -246,56 +245,6 @@ class DockerApiTest(BaseAPIClientTest):
'serveraddress': None,
}
- def test_events(self):
- self.client.events()
-
- fake_request.assert_called_with(
- 'GET',
- url_prefix + 'events',
- params={'since': None, 'until': None, 'filters': None},
- stream=True,
- timeout=None
- )
-
- def test_events_with_since_until(self):
- ts = 1356048000
- now = datetime.datetime.utcfromtimestamp(ts)
- since = now - datetime.timedelta(seconds=10)
- until = now + datetime.timedelta(seconds=10)
-
- self.client.events(since=since, until=until)
-
- fake_request.assert_called_with(
- 'GET',
- url_prefix + 'events',
- params={
- 'since': ts - 10,
- 'until': ts + 10,
- 'filters': None
- },
- stream=True,
- timeout=None
- )
-
- def test_events_with_filters(self):
- filters = {'event': ['die', 'stop'],
- 'container': fake_api.FAKE_CONTAINER_ID}
-
- self.client.events(filters=filters)
-
- expected_filters = convert_filters(filters)
- fake_request.assert_called_with(
- 'GET',
- url_prefix + 'events',
- params={
- 'since': None,
- 'until': None,
- 'filters': expected_filters
- },
- stream=True,
- timeout=None
- )
-
def _socket_path_for_client_session(self, client):
socket_adapter = client.get_adapter('http+docker://')
return socket_adapter.socket_path