Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible : [DEPRECATION WARNING]: Using bare variables is deprecated [duplicate]

Tags:

ansible

I think this is the part of the playbook that is generating the error. How should I be re-writing this part?

roles: 
- role: json-transform
  json_transforms: '{{ clientValidation.json_transforms}}'

It throws the following warning:

[DEPRECATION WARNING]: Using bare variables is deprecated. Update your playbooks so that the environment value uses the full variable syntax ('{{json_transforms}}'). This feature will be removed in a 
future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
like image 222
anuiq Avatar asked Apr 26 '16 17:04

anuiq


1 Answers

It doesn't look like there's anything wrong with your top level- it's probably something inside your role. Deprecated bare variables usually occur on a with_xxx loop; eg:

- hosts: blar
  vars:
    items:
    - one
    - two
  tasks:
  - debug: msg="hi from {{ item }}"
    with_items: items

In this case, it's telling you that with_items: items should be with_items: "{{ items }}".

like image 103
nitzmahone Avatar answered Sep 30 '22 22:09

nitzmahone