On 11. mai 2016 11:55, Mark Maas wrote:
I've always been following along with the examples here: http://docs.ansible.com/ansible/playbooks_conditionals.html#the-when-statementfor instance: ``` - name: Disable requiretty lineinfile: dest: /etc/sudoers regexp: "Defaults requiretty" line: "# Defaults requiretty" when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "7" ``` But when I run that with Ansible > 2.0 it gives me a deprecation message: ``` [DEPRECATION WARNING]: Using bare variables is deprecated. Update your playbooks so that the environment value uses the full variable syntax ('{{ansible_os_family}}'). This feature will be removed in a future release. ```
Are you sure that this message is because of the when statement and not from other places you have used a variable?
According to Brian Coca in this post {{ and }} is implied in when and should not be used.
https://groups.google.com/forum/#!msg/ansible-project/1DyCROTgMF0/6siUigwuAQAJ -- Kai Stian Olstad -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5349a0df-7402-0bd4-9650-6431688dd0c1%40olstad.com. For more options, visit https://groups.google.com/d/optout.
