# code to allow "with_glob" and to reference a lookup plugin named glob
# code to allow "with_glob" and to reference a lookup plugin named glob
elifx.startswith("with_"):
elifx.startswith("with_"):
# Only a variable, no logic
ifisinstance(ds[x],basestring):
if(isinstance(ds[x],basestring)and
param=ds[x].strip()
ds[x].startswith('{{')and
# Only a variable, no logic
ds[x].find('}}')==len(ds[x])-2and
if(param.startswith('{{')and
find('|')==-1):
param.find('}}')==len(ds[x])-2and
utils.warning("It is unnecessary to use '{{' in loops, leave variables in loop expressions bare.")
param.find('|')==-1):
utils.warning("It is unnecessary to use '{{' in loops, leave variables in loop expressions bare.")
plugin_name=x.replace("with_","")
plugin_name=x.replace("with_","")
ifplugin_nameinutils.plugins.lookup_loader:
ifplugin_nameinutils.plugins.lookup_loader:
@ -100,12 +101,13 @@ class Task(object):
raiseerrors.AnsibleError("cannot find lookup plugin named %s for usage in with_%s"%(plugin_name,plugin_name))
raiseerrors.AnsibleError("cannot find lookup plugin named %s for usage in with_%s"%(plugin_name,plugin_name))
elifxin['changed_when','failed_when','when']:
elifxin['changed_when','failed_when','when']:
# Only a variable, no logic
ifisinstance(ds[x],basestring):
if(isinstance(ds[x],basestring)and
param=ds[x].strip()
ds[x].startswith('{{')and
# Only a variable, no logic
ds[x].find('}}')==len(ds[x])-2and
if(param.startswith('{{')and
find('|')==-1):
param.find('}}')==len(ds[x])-2and
utils.warning("It is unnecessary to use '{{' in conditionals, leave variables in loop expressions bare.")
param.find('|')==-1):
utils.warning("It is unnecessary to use '{{' in conditionals, leave variables in loop expressions bare.")
elifx.startswith("when_"):
elifx.startswith("when_"):
utils.deprecated("The 'when_' conditional has been removed. Switch to using the regular unified 'when' statements as described on docs.ansible.com.","1.5",removed=True)
utils.deprecated("The 'when_' conditional has been removed. Switch to using the regular unified 'when' statements as described on docs.ansible.com.","1.5",removed=True)