From a204f4f2972e80506fbc7ab69b82f9967aca6923 Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Tue, 19 Apr 2016 17:04:47 -0400 Subject: [PATCH] Ansible 2.x - Address deprecation warning of bare variables Ansible 2.2 will not allow "bare" variable references in with_* loops. See https://docs.ansible.com/ansible/porting_guide_2.0.html#deprecated for details. Change-Id: Ia50dc962f19de2d04fa0bf483cff9cd2c7d79f7d --- tasks/container_create.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/container_create.yml b/tasks/container_create.yml index dd48a6f8..2bcc0f1f 100644 --- a/tasks/container_create.yml +++ b/tasks/container_create.yml @@ -111,7 +111,7 @@ ifdown {{ item.value.interface }} ifup {{ item.value.interface }} fi - with_dict: container_networks|default({}) + with_dict: "{{ container_networks|default({}) }}" delegate_to: "{{ physical_host }}" tags: - lxc-container-networks @@ -123,7 +123,7 @@ owner: "root" group: "root" mode: "0644" - with_dict: container_networks|default({}) + with_dict: "{{ container_networks|default({}) }}" notify: - Lxc container restart delegate_to: "{{ physical_host }}" @@ -148,9 +148,9 @@ dest: "/var/lib/lxc/{{ inventory_hostname }}/config" line: "lxc.include = /var/lib/lxc/{{ inventory_hostname }}/{{ item.value.interface }}.ini" backup: "true" - with_dict: container_networks|default({}) - when: > - item.value.interface is defined + with_dict: "{{ container_networks|default({}) }}" + when: + - item.value.interface is defined notify: - Lxc container restart delegate_to: "{{ physical_host }}" @@ -211,7 +211,7 @@ if ! grep '{{ item.key }}={{ item.value }}' /etc/environment; then echo '{{ item.key }}={{ item.value }}' | tee -a /etc/environment fi - with_dict: global_environment_variables | default({}) + with_dict: "{{ global_environment_variables | default({}) }}" when: global_environment_variables is defined delegate_to: "{{ physical_host }}" tags: