mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Always returns changed when state present and name includes :tag.
This commit is contained in:
parent
1cf9d3e68e
commit
3dab1785ba
1 changed files with 8 additions and 1 deletions
|
@ -116,7 +116,8 @@ options:
|
||||||
tag:
|
tag:
|
||||||
description:
|
description:
|
||||||
- Used to select an image when pulling. Will be added to the image when pushing, tagging or building. Defaults to
|
- Used to select an image when pulling. Will be added to the image when pushing, tagging or building. Defaults to
|
||||||
C(latest).
|
I(latest).
|
||||||
|
- If C(name) parameter format is I(name:tag), then tag value from C(name) will take precedence.
|
||||||
default: latest
|
default: latest
|
||||||
required: false
|
required: false
|
||||||
container_limits:
|
container_limits:
|
||||||
|
@ -258,6 +259,12 @@ class ImageManager(DockerBaseClass):
|
||||||
self.http_timeout = parameters.get('http_timeout')
|
self.http_timeout = parameters.get('http_timeout')
|
||||||
self.push = parameters.get('push')
|
self.push = parameters.get('push')
|
||||||
|
|
||||||
|
# If name contains a tag, it takes precedence over tag parameter.
|
||||||
|
repo, repo_tag = parse_repository_tag(self.name)
|
||||||
|
if repo_tag:
|
||||||
|
self.name = repo
|
||||||
|
self.tag = repo_tag
|
||||||
|
|
||||||
if self.state in ['present', 'build']:
|
if self.state in ['present', 'build']:
|
||||||
self.present()
|
self.present()
|
||||||
elif self.state == 'absent':
|
elif self.state == 'absent':
|
||||||
|
|
Loading…
Add table
Reference in a new issue