# 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_"):
ifisinstance(ds[x],basestring)and'{{'inds[x]:
utils.warning("It is unneccessary 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:
ds['items_lookup_plugin']=plugin_name
ds['items_lookup_plugin']=plugin_name
...
@@ -90,6 +94,8 @@ class Task(object):
...
@@ -90,6 +94,8 @@ 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']:
ifisinstance(ds[x],basestring)and'{{'inds[x]:
utils.warning("It is unneccessary to use '{{' in conditionals, leave variables in loop expressions bare.")
ds[x]="jinja2_compare %s"%(ds[x])
ds[x]="jinja2_compare %s"%(ds[x])
elifx.startswith("when_"):
elifx.startswith("when_"):
utils.deprecated("The 'when_' conditional is a deprecated syntax as of 1.2. Switch to using the regular unified 'when' statements as described in ansibleworks.com/docs/.","1.5")
utils.deprecated("The 'when_' conditional is a deprecated syntax as of 1.2. Switch to using the regular unified 'when' statements as described in ansibleworks.com/docs/.","1.5")
utils.deprecated("Legacy variable subsitution, such as using ${foo} or $foo instead of {{ foo }} is currently valid but will be phased out and has been out of favor since version 1.2. This is the last of legacy features on our deprecation list. You may continue to use this if you have specific needs for now","1.6")
utils.deprecated("Legacy variable subsitution, such as using ${foo} or $foo instead of {{ foo }} is currently valid but will be phased out and has been out of favor since version 1.2. This is the last of legacy features on our deprecation list. You may continue to use this if you have specific needs for now","1.6")