1

I'm using ansible 2.1.0. I'm looking at this page http://ryaneschinger.com/blog/securing-a-server-with-ansible/ and running the playbook of the following part:

- name: Add authorized keys for deploy user
  authorized_key: user={{ username }}
                  key="{{ lookup('file', item) }}"
  with_items: public_keys

When I run this, I get [DEPRECATION WARNING]: Using bare variables is deprecated. Update your playbooks so that the environment value uses the full variable syntax ('{{public_keys}}'). What is the not deprecated way to do the same?

beatak
  • 9,185
  • 10
  • 33
  • 42

1 Answers1

3

As stated in the documentation, bare variables in with_ loops should instead use the “{{var}}” syntax, which helps eliminate ambiguity.

So, It is just telling you to change this:

with_items: public_keys

to this:

with_items: "{{ public_keys }}"
Abdelaziz Dabebi
  • 1,624
  • 1
  • 16
  • 21