From 2701d29caf95f0b2d803c4ce581f03a67e799fb9 Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Wed, 15 Jun 2016 11:13:57 -0400 Subject: [PATCH] Address Ansible bare variable usage When executing the role with Ansible 2.1, the following deprecation warning is issued in the output for some tasks. [DEPRECATION WARNING]: Using bare variables is deprecated. This patch addresses the tasks to fix the behaviour appropriately. Change-Id: I7ef4e446d6fc509420d5b297378f4fa91a519fc8 --- handlers/main.yml | 2 +- tasks/nova_compute_key_distribute.yml | 2 +- tasks/nova_compute_kvm_install.yml | 6 +++--- tasks/nova_compute_powervm_install.yml | 8 ++++---- tasks/nova_console_novnc_install.yml | 6 +++--- tasks/nova_console_spice_install.yml | 2 +- tasks/nova_install.yml | 8 ++++---- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 50260447..84db3350 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -24,5 +24,5 @@ name: "{{ item }}" state: restarted pattern: "{{ item }}" - with_items: nova_service_names + with_items: "{{ nova_service_names }}" failed_when: false diff --git a/tasks/nova_compute_key_distribute.yml b/tasks/nova_compute_key_distribute.yml index 1d390169..fba191e4 100644 --- a/tasks/nova_compute_key_distribute.yml +++ b/tasks/nova_compute_key_distribute.yml @@ -17,7 +17,7 @@ authorized_key: user: "{{ nova_system_user_name }}" key: "{{ hostvars[item]['nova_pubkey'] | b64decode }}" - with_items: groups['nova_compute'] + with_items: "{{ groups['nova_compute'] }}" when: hostvars[item]['nova_pubkey'] is defined tags: - nova-key diff --git a/tasks/nova_compute_kvm_install.yml b/tasks/nova_compute_kvm_install.yml index fb896832..491dc508 100644 --- a/tasks/nova_compute_kvm_install.yml +++ b/tasks/nova_compute_kvm_install.yml @@ -61,7 +61,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: nova_compute_kvm_apt_packages + with_items: "{{ nova_compute_kvm_apt_packages }}" tags: - nova-apt-packages - nova-compute-kvm-apt-packages @@ -101,7 +101,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: nova_compute_pip_packages + with_items: "{{ nova_compute_pip_packages }}" when: - nova_venv_enabled | bool - nova_get_venv | failed or nova_developer_mode | bool @@ -137,7 +137,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: nova_compute_pip_packages + with_items: "{{ nova_compute_pip_packages }}" when: not nova_venv_enabled | bool tags: - nova-install diff --git a/tasks/nova_compute_powervm_install.yml b/tasks/nova_compute_powervm_install.yml index d2cb6eee..3d7a8bec 100644 --- a/tasks/nova_compute_powervm_install.yml +++ b/tasks/nova_compute_powervm_install.yml @@ -22,7 +22,7 @@ retries: 5 delay: 2 ignore_errors: True - with_items: novalink_gpg_keys + with_items: "{{ novalink_gpg_keys }}" tags: - novalink-apt-keys @@ -66,7 +66,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: nova_compute_powervm_apt_packages + with_items: "{{ nova_compute_powervm_apt_packages }}" tags: - nova-apt-packages - nova-compute-powervm-apt-packages @@ -101,7 +101,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: nova_compute_powervm_pip_packages + with_items: "{{ nova_compute_powervm_pip_packages }}" when: - nova_venv_enabled | bool tags: @@ -117,7 +117,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: nova_compute_powervm_pip_packages + with_items: "{{ nova_compute_powervm_pip_packages }}" when: not nova_venv_enabled | bool tags: - nova-install diff --git a/tasks/nova_console_novnc_install.yml b/tasks/nova_console_novnc_install.yml index 5cf94d3a..27668d77 100644 --- a/tasks/nova_console_novnc_install.yml +++ b/tasks/nova_console_novnc_install.yml @@ -64,7 +64,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: nova_novnc_apt_packages + with_items: "{{ nova_novnc_apt_packages }}" tags: - nova-install - nova-apt-packages @@ -81,7 +81,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: nova_novnc_pip_packages + with_items: "{{ nova_novnc_pip_packages }}" when: - nova_venv_enabled | bool - nova_get_venv | failed or nova_developer_mode | bool @@ -98,7 +98,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: nova_novnc_pip_packages + with_items: "{{ nova_novnc_pip_packages }}" when: not nova_venv_enabled | bool tags: - nova-install diff --git a/tasks/nova_console_spice_install.yml b/tasks/nova_console_spice_install.yml index ea2e462f..bcfeaa75 100644 --- a/tasks/nova_console_spice_install.yml +++ b/tasks/nova_console_spice_install.yml @@ -40,7 +40,7 @@ until: remove_packages|success retries: 5 delay: 2 - with_items: nova_spice_apt_packages + with_items: "{{ nova_spice_apt_packages }}" tags: - nova-apt-packages - nova-spice-apt-packages diff --git a/tasks/nova_install.yml b/tasks/nova_install.yml index 51c7c2ed..0e45e82b 100644 --- a/tasks/nova_install.yml +++ b/tasks/nova_install.yml @@ -38,7 +38,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: nova_apt_packages + with_items: "{{ nova_apt_packages }}" tags: - nova-install - nova-apt-packages @@ -96,7 +96,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: nova_requires_pip_packages + with_items: "{{ nova_requires_pip_packages }}" tags: - nova-install - nova-pip-packages @@ -213,7 +213,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: nova_pip_packages + with_items: "{{ nova_pip_packages }}" when: - nova_venv_enabled | bool - nova_get_venv | failed or nova_developer_mode | bool @@ -231,7 +231,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: nova_pip_packages + with_items: "{{ nova_pip_packages }}" when: - not nova_developer_mode | bool - not nova_venv_enabled | bool