From 3e0214ff18d91b4630c48c23da83a7018b82e60c Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Wed, 20 Apr 2016 16:12:04 -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: I4fda03a3f403e6b3b491365a2473caafff4d3843 --- handlers/main.yml | 2 +- tasks/cinder_backends.yml | 2 +- tasks/cinder_install.yml | 6 +++--- tasks/cinder_install_apt.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index a1d30df5..f763a843 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -18,7 +18,7 @@ name: "{{ item }}" state: restarted pattern: "{{ item }}" - with_items: cinder_service_names + with_items: "{{ cinder_service_names }}" failed_when: false - name: Ensure tgt service restarted diff --git a/tasks/cinder_backends.yml b/tasks/cinder_backends.yml index 936d69ef..e04b4b96 100644 --- a/tasks/cinder_backends.yml +++ b/tasks/cinder_backends.yml @@ -31,7 +31,7 @@ {{ cinder_bin }}/cinder {{ keystone_service_adminuri_insecure | bool | ternary('--insecure','') }} type-create "{{ item.key }}" {{ cinder_bin }}/cinder {{ keystone_service_adminuri_insecure | bool | ternary('--insecure','') }} type-key "{{ item.key }}" set volume_backend_name="{{ item.value.volume_backend_name }}" fi - with_dict: cinder_backends|default({}) + with_dict: "{{ cinder_backends|default({}) }}" tags: - cinder-backends - cinder-backends-types diff --git a/tasks/cinder_install.yml b/tasks/cinder_install.yml index 70ef4485..934929e4 100644 --- a/tasks/cinder_install.yml +++ b/tasks/cinder_install.yml @@ -73,7 +73,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: cinder_requires_pip_packages + with_items: "{{ cinder_requires_pip_packages }}" tags: - cinder-install - cinder-pip-packages @@ -190,7 +190,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: cinder_pip_packages + with_items: "{{ cinder_pip_packages }}" when: - cinder_venv_enabled | bool - cinder_get_venv | failed or cinder_developer_mode | bool @@ -208,7 +208,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: cinder_pip_packages + with_items: "{{ cinder_pip_packages }}" when: - not cinder_developer_mode | bool - not cinder_venv_enabled | bool diff --git a/tasks/cinder_install_apt.yml b/tasks/cinder_install_apt.yml index e2e62225..8489c35d 100644 --- a/tasks/cinder_install_apt.yml +++ b/tasks/cinder_install_apt.yml @@ -34,7 +34,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: cinder_apt_packages + with_items: "{{ cinder_apt_packages }}" - name: Install apt packages apt: @@ -44,7 +44,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: cinder_lvm_volume_apt_packages + with_items: "{{ cinder_lvm_volume_apt_packages }}" when: - inventory_hostname in groups['cinder_volume'] - cinder_backend_lvm_inuse | bool