mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-03-15 19:58:28 +00:00
docker_compose_v2_pull: Add ignore_pull_failures option (#1248)
* feat(docker_compose_v2_pull): Add `ignore_pull_failures` option Co-authored-by: Felix Fontein <felix@fontein.de> * changelog fragment * Update changelogs/fragments/1248-ignore-pull-failures.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
241ba443ac
commit
15690313f3
2
changelogs/fragments/1248-ignore-pull-failures.yml
Normal file
2
changelogs/fragments/1248-ignore-pull-failures.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
minor_changes:
|
||||||
|
- docker_compose_v2_pull - adds ``ignore_pull_failures`` parameter that passes ``--ignore-pull-failures`` to the ``docker compose pull`` call when set to ``true`` (https://github.com/ansible-collections/community.docker/pull/1248).
|
||||||
@ -51,6 +51,12 @@ options:
|
|||||||
type: bool
|
type: bool
|
||||||
default: false
|
default: false
|
||||||
version_added: 3.12.0
|
version_added: 3.12.0
|
||||||
|
ignore_pull_failures:
|
||||||
|
description:
|
||||||
|
- If set to V(true), will pull what it can and ignores images with pull failures.
|
||||||
|
type: bool
|
||||||
|
default: false
|
||||||
|
version_added: 5.1.0
|
||||||
include_deps:
|
include_deps:
|
||||||
description:
|
description:
|
||||||
- If set to V(true), also pull services that are declared as dependencies.
|
- If set to V(true), also pull services that are declared as dependencies.
|
||||||
@ -132,6 +138,7 @@ class PullManager(BaseComposeManager):
|
|||||||
|
|
||||||
self.policy: t.Literal["always", "missing"] = parameters["policy"]
|
self.policy: t.Literal["always", "missing"] = parameters["policy"]
|
||||||
self.ignore_buildable: bool = parameters["ignore_buildable"]
|
self.ignore_buildable: bool = parameters["ignore_buildable"]
|
||||||
|
self.ignore_pull_failures: bool = parameters["ignore_pull_failures"]
|
||||||
self.include_deps: bool = parameters["include_deps"]
|
self.include_deps: bool = parameters["include_deps"]
|
||||||
self.services: list[str] = parameters["services"] or []
|
self.services: list[str] = parameters["services"] or []
|
||||||
|
|
||||||
@ -152,6 +159,8 @@ class PullManager(BaseComposeManager):
|
|||||||
args.extend(["--policy", self.policy])
|
args.extend(["--policy", self.policy])
|
||||||
if self.ignore_buildable:
|
if self.ignore_buildable:
|
||||||
args.append("--ignore-buildable")
|
args.append("--ignore-buildable")
|
||||||
|
if self.ignore_pull_failures:
|
||||||
|
args.append("--ignore-pull-failures")
|
||||||
if self.include_deps:
|
if self.include_deps:
|
||||||
args.append("--include-deps")
|
args.append("--include-deps")
|
||||||
if dry_run:
|
if dry_run:
|
||||||
@ -187,6 +196,7 @@ def main() -> None:
|
|||||||
"default": "always",
|
"default": "always",
|
||||||
},
|
},
|
||||||
"ignore_buildable": {"type": "bool", "default": False},
|
"ignore_buildable": {"type": "bool", "default": False},
|
||||||
|
"ignore_pull_failures": {"type": "bool", "default": False},
|
||||||
"include_deps": {"type": "bool", "default": False},
|
"include_deps": {"type": "bool", "default": False},
|
||||||
"services": {"type": "list", "elements": "str"},
|
"services": {"type": "list", "elements": "str"},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user