Hi,
running the following play generate this not so useful DEPRECATION WARNING
---
- hosts: localhost
vars:
# - mounts:
# - '1'
# - '2'
tasks:
- name: "Tasks generating fatal error"
debug: var=mounts
with_items:
- "{{ mounts }}"
when: mounts is defined
tags: "mounts"
$ ansible --version
ansible 2.0.1.0
config file = /vagrant/sysadmin/ansible/coremedia7/ansible.cfg
configured module search path = Default w/o overrides
$ ansible-playbook fatal.yml
[WARNING]: provided hosts list is empty, only localhost is available
PLAY ***************************************************************************
TASK [Tasks generating fatal error] ********************************************
Thursday 21 April 2016 13:47:46 +0200 (0:00:00.034) 0:00:00.034 ********
[DEPRECATION WARNING]: Skipping task due to undefined Error, in the future this will be a fatal
error.. This feature will be removed in a future release. Deprecation warnings can be disabled by
setting deprecation_warnings=False in ansible.cfg.
It only happen if the mount variable is undefined...
But the when clause should prevent it to run, isn't it ?
What am I missing ?
Should I file an issue for this ?
thanks for any tips.
Julien.