mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Make it possible to say:
tags: 42 And have the tag be a string, not an int, so --tags matches. Fixes #4110
This commit is contained in:
parent
c5672cf16e
commit
5e30cd999c
1 changed files with 5 additions and 1 deletions
|
@ -215,7 +215,9 @@ class Task(object):
|
|||
self.module_args = tokens[1]
|
||||
|
||||
import_tags = self.module_vars.get('tags',[])
|
||||
if type(import_tags) in [str,unicode]:
|
||||
if type(import_tags) in [int,float]:
|
||||
import_tags = str(import_tags)
|
||||
elif type(import_tags) in [str,unicode]:
|
||||
# allow the user to list comma delimited tags
|
||||
import_tags = import_tags.split(",")
|
||||
|
||||
|
@ -247,6 +249,8 @@ class Task(object):
|
|||
if apply_tags is not None:
|
||||
if type(apply_tags) in [ str, unicode ]:
|
||||
self.tags.append(apply_tags)
|
||||
elif type(apply_tags) in [ int, float ]:
|
||||
self.tags.append(str(apply_tags))
|
||||
elif type(apply_tags) == list:
|
||||
self.tags.extend(apply_tags)
|
||||
self.tags.extend(import_tags)
|
||||
|
|
Loading…
Reference in a new issue