From 696414750b8a5f8f55c95cd703128b7b2f7a5623 Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Thu, 21 Apr 2016 14:43:20 -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: I7475fbbfcf04ba528ea8718117b8d6afdd6f4971 --- defaults/main.yml | 13 +++++++++---- handlers/main.yml | 2 +- tasks/glance_install.yml | 6 +++--- tasks/glance_install_apt.yml | 2 +- tasks/glance_post_install.yml | 8 ++------ 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 14065dba..32987089 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -153,10 +153,15 @@ glance_policy_file: policy.json glance_policy_default_rule: default glance_policy_dirs: policy.d -## Define nfs information for glance. When the glance_nfs_client dictionary is -## defined it will enable nfs shares as mounted directories. The -## ``glance_nfs_client`` value is a list of dictionaries that must be filled -## out completely to enable the persistent NFS mounts. + +# Define nfs information to enable nfs shares as mounted directories for +# glance. The ``glance_nfs_client`` value is a list of dictionaries that must +# be filled out completely to enable the persistent NFS mounts. + +glance_nfs_client: [] + +# Example of the expected dict structure: +# # glance_nfs_client: # - server: "127.0.0.1" ## Hostname or IP address of NFS Server # remote_path: "/images" ## Remote path from the NFS server's export diff --git a/handlers/main.yml b/handlers/main.yml index 51a586ef..0035c550 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -30,4 +30,4 @@ name: "{{ item }}" state: "restarted" pattern: "{{ item }}" - with_items: glance_service_names + with_items: "{{ glance_service_names }}" diff --git a/tasks/glance_install.yml b/tasks/glance_install.yml index 67f81563..e9481462 100644 --- a/tasks/glance_install.yml +++ b/tasks/glance_install.yml @@ -74,7 +74,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: glance_requires_pip_packages + with_items: "{{ glance_requires_pip_packages }}" tags: - glance-install - glance-pip-packages @@ -192,7 +192,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: glance_pip_packages + with_items: "{{ glance_pip_packages }}" when: - glance_venv_enabled | bool - glance_get_venv | failed or glance_developer_mode | bool @@ -211,7 +211,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: glance_pip_packages + with_items: "{{ glance_pip_packages }}" when: - not glance_venv_enabled | bool - not glance_developer_mode | bool diff --git a/tasks/glance_install_apt.yml b/tasks/glance_install_apt.yml index 95f71e25..9ba688dd 100644 --- a/tasks/glance_install_apt.yml +++ b/tasks/glance_install_apt.yml @@ -34,4 +34,4 @@ until: install_packages|success retries: 5 delay: 2 - with_items: glance_apt_packages + with_items: "{{ glance_apt_packages }}" diff --git a/tasks/glance_post_install.yml b/tasks/glance_post_install.yml index df336080..12e10fb9 100644 --- a/tasks/glance_post_install.yml +++ b/tasks/glance_post_install.yml @@ -77,9 +77,7 @@ file: path: "{{ item.local_path }}" state: directory - with_items: glance_nfs_client - when: > - glance_nfs_client is defined + with_items: "{{ glance_nfs_client }}" tags: - glance-nfs - glance-nfs-local-path @@ -91,9 +89,7 @@ fstype: "{{ item.type }}" opts: "{{ item.options }}" state: "mounted" - with_items: glance_nfs_client - when: > - glance_nfs_client is defined + with_items: "{{ glance_nfs_client }}" tags: - glance-nfs - glance-nfs-local-path