From 9f53e04687d5cab829e5dcf9c2049fddd5f44ed7 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Thu, 12 Jul 2018 16:44:21 +0200 Subject: [PATCH] Fix usage of "|" for tests With the more recent versions of ansible, we should now use "is" instead of the "|" sign for the tests. This should fix it. Change-Id: If3e4366c22e900557e4730a7e8838f55ffe30ecc --- handlers/main.yml | 4 ++-- tasks/consoles/nova_console_novnc_install.yml | 4 ++-- tasks/consoles/nova_console_spice_install.yml | 2 +- .../ironic/nova_compute_ironic_source.yml | 2 +- tasks/drivers/lxd/nova_compute_lxd.yml | 2 +- tasks/drivers/lxd/nova_compute_lxd_source.yml | 2 +- tasks/drivers/powervm/nova_compute_powervm.yml | 2 +- tasks/nova_db_setup.yml | 2 +- tasks/nova_install.yml | 2 +- tasks/nova_install_apt_powervm.yml | 6 +++--- tasks/nova_install_source.yml | 14 +++++++------- tasks/nova_selinux.yml | 4 ++-- tasks/nova_service_setup.yml | 16 ++++++++-------- tasks/nova_uwsgi.yml | 2 +- tests/test-nova-resources-upgrade.yml | 2 +- 15 files changed, 33 insertions(+), 33 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 65343ee8..d00301e3 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -28,7 +28,7 @@ daemon_reload: yes with_items: "{{ filtered_nova_services }}" register: _stop - until: _stop | success + until: _stop is success retries: 5 delay: 2 listen: "Restart nova services" @@ -59,7 +59,7 @@ daemon_reload: yes with_items: "{{ filtered_nova_services }}" register: _start - until: _start | success + until: _start is success retries: 5 delay: 2 listen: "Restart nova services" diff --git a/tasks/consoles/nova_console_novnc_install.yml b/tasks/consoles/nova_console_novnc_install.yml index 64a01b04..97d55b90 100644 --- a/tasks/consoles/nova_console_novnc_install.yml +++ b/tasks/consoles/nova_console_novnc_install.yml @@ -48,7 +48,7 @@ force: yes accept_hostkey: yes register: git_clone - until: git_clone|success + until: git_clone is success retries: 5 delay: 2 notify: @@ -68,7 +68,7 @@ {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} {{ pip_install_options|default('') }} register: install_packages - until: install_packages|success + until: install_packages is success retries: 5 delay: 2 when: diff --git a/tasks/consoles/nova_console_spice_install.yml b/tasks/consoles/nova_console_spice_install.yml index 2a1c3a6a..8436b27c 100644 --- a/tasks/consoles/nova_console_spice_install.yml +++ b/tasks/consoles/nova_console_spice_install.yml @@ -48,7 +48,7 @@ force: yes accept_hostkey: yes register: git_clone - until: git_clone|success + until: git_clone is success retries: 5 delay: 2 notify: diff --git a/tasks/drivers/ironic/nova_compute_ironic_source.yml b/tasks/drivers/ironic/nova_compute_ironic_source.yml index 8b80a245..2a304462 100644 --- a/tasks/drivers/ironic/nova_compute_ironic_source.yml +++ b/tasks/drivers/ironic/nova_compute_ironic_source.yml @@ -24,7 +24,7 @@ {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} {{ pip_install_options | default('') }} register: install_packages - until: install_packages|success + until: install_packages is success retries: 5 delay: 2 tags: diff --git a/tasks/drivers/lxd/nova_compute_lxd.yml b/tasks/drivers/lxd/nova_compute_lxd.yml index 45f96f4e..0c218f2c 100644 --- a/tasks/drivers/lxd/nova_compute_lxd.yml +++ b/tasks/drivers/lxd/nova_compute_lxd.yml @@ -38,6 +38,6 @@ - name: Configure lxd init command: "{{ nova_system_home_folder }}/lxd-init.sh" - when: lxd_init_script | changed + when: lxd_init_script is changed tags: - nova-lxd diff --git a/tasks/drivers/lxd/nova_compute_lxd_source.yml b/tasks/drivers/lxd/nova_compute_lxd_source.yml index 110ce70e..1baaa137 100644 --- a/tasks/drivers/lxd/nova_compute_lxd_source.yml +++ b/tasks/drivers/lxd/nova_compute_lxd_source.yml @@ -24,7 +24,7 @@ {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} {{ pip_install_options | default('') }} register: install_packages - until: install_packages|success + until: install_packages is success retries: 5 delay: 2 tags: diff --git a/tasks/drivers/powervm/nova_compute_powervm.yml b/tasks/drivers/powervm/nova_compute_powervm.yml index d7f4c075..89516b84 100644 --- a/tasks/drivers/powervm/nova_compute_powervm.yml +++ b/tasks/drivers/powervm/nova_compute_powervm.yml @@ -24,7 +24,7 @@ {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} {{ pip_install_options|default('') }} register: install_packages - until: install_packages|success + until: install_packages is success retries: 5 delay: 2 tags: diff --git a/tasks/nova_db_setup.yml b/tasks/nova_db_setup.yml index f1f8f5b8..e757c09e 100644 --- a/tasks/nova_db_setup.yml +++ b/tasks/nova_db_setup.yml @@ -112,7 +112,7 @@ value: False when: - not data_migrations | skipped - - data_migrations | succeeded + - data_migrations is succeeded - name: Create the cell1 mapping entry in the nova API DB command: >- diff --git a/tasks/nova_install.yml b/tasks/nova_install.yml index 956f3b2c..92b217ac 100644 --- a/tasks/nova_install.yml +++ b/tasks/nova_install.yml @@ -39,7 +39,7 @@ update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}" cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}" register: install_packages - until: install_packages|success + until: install_packages is success retries: 5 delay: 2 tags: diff --git a/tasks/nova_install_apt_powervm.yml b/tasks/nova_install_apt_powervm.yml index 79b6e0f3..aaa5916a 100644 --- a/tasks/nova_install_apt_powervm.yml +++ b/tasks/nova_install_apt_powervm.yml @@ -18,7 +18,7 @@ url: "{{ item.url }}" state: "{{ item.state }}" register: add_nv_keys - until: add_nv_keys|success + until: add_nv_keys is success retries: 5 delay: 2 with_items: "{{ novalink_gpg_keys }}" @@ -45,9 +45,9 @@ - name: Update Apt cache apt: update_cache: yes - when: add_nv_repos | changed + when: add_nv_repos is changed register: update_apt_cache - until: update_apt_cache | success + until: update_apt_cache is success retries: 5 delay: 2 tags: diff --git a/tasks/nova_install_source.yml b/tasks/nova_install_source.yml index 8091a37d..8b136af4 100644 --- a/tasks/nova_install_source.yml +++ b/tasks/nova_install_source.yml @@ -34,7 +34,7 @@ {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} {{ pip_install_options | default('') }} register: install_packages - until: install_packages|success + until: install_packages is success retries: 5 delay: 2 tags: @@ -68,7 +68,7 @@ path: "{{ nova_bin | dirname }}" state: absent when: - - nova_get_venv | changed + - nova_get_venv is changed tags: - nova-pip-packages @@ -78,7 +78,7 @@ state: directory register: nova_venv_dir when: - - nova_get_venv | changed + - nova_get_venv is changed tags: - nova-pip-packages @@ -88,7 +88,7 @@ dest: "{{ nova_bin | dirname }}" copy: "no" when: - - nova_get_venv | changed + - nova_get_venv is changed notify: - Manage LB - Restart nova services @@ -106,7 +106,7 @@ {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} {{ pip_install_options | default('') }} register: install_packages - until: install_packages|success + until: install_packages is success retries: 5 delay: 2 when: @@ -123,7 +123,7 @@ state: "absent" when: - ansible_pkg_mgr in ['yum', 'dnf', 'zypper'] - - nova_get_venv | changed + - nova_get_venv is changed # NOTE(odyssey4me): # We reinitialize the venv to ensure that the right @@ -142,7 +142,7 @@ --no-setuptools \ --no-wheel when: - - nova_get_venv | changed + - nova_get_venv is changed tags: - skip_ansible_lint - nova-pip-packages diff --git a/tasks/nova_selinux.yml b/tasks/nova_selinux.yml index 704a441e..c5991e09 100644 --- a/tasks/nova_selinux.yml +++ b/tasks/nova_selinux.yml @@ -41,7 +41,7 @@ - name: Apply updated SELinux contexts on /var/lib/nova command: restorecon -R /var/lib/nova when: - - selinux_equivalence | changed or selinux_file_context_ssh_keys | changed + - selinux_equivalence | changed or selinux_file_context_ssh_keys is changed - name: Stat nova's log directory stat: @@ -58,7 +58,7 @@ - name: Apply updated SELinux contexts on nova log directory command: "restorecon -Rv {{ (nova_log_dir_check.stat.islnk) | ternary(nova_log_dir_check.stat.lnk_target, nova_log_dir) }}" when: - - selinux_file_context_log_files | changed + - selinux_file_context_log_files is changed - name: Copy OSA SELinux policy copy: diff --git a/tasks/nova_service_setup.yml b/tasks/nova_service_setup.yml index 6f6c9010..ba808c60 100644 --- a/tasks/nova_service_setup.yml +++ b/tasks/nova_service_setup.yml @@ -26,7 +26,7 @@ description: "{{ nova_service_description }}" insecure: "{{ keystone_service_adminuri_insecure }}" register: add_service - until: add_service|success + until: add_service is success retries: 5 delay: 2 no_log: True @@ -50,7 +50,7 @@ register: add_service when: - not nova_service_in_ldap | bool - until: add_service|success + until: add_service is success retries: 5 delay: 10 no_log: True @@ -74,7 +74,7 @@ register: add_service when: - not nova_service_in_ldap | bool - until: add_service|success + until: add_service is success retries: 5 delay: 10 no_log: True @@ -103,7 +103,7 @@ - url: "{{ nova_service_adminurl }}" interface: "admin" register: add_service - until: add_service|success + until: add_service is success retries: 5 delay: 10 no_log: True @@ -125,7 +125,7 @@ description: "{{ nova_placement_service_description }}" insecure: "{{ keystone_service_adminuri_insecure }}" register: add_service - until: add_service|success + until: add_service is success retries: 5 delay: 2 no_log: True @@ -147,7 +147,7 @@ insecure: "{{ keystone_service_adminuri_insecure }}" register: add_service when: not nova_placement_service_in_ldap | bool - until: add_service|success + until: add_service is success retries: 5 delay: 10 no_log: True @@ -169,7 +169,7 @@ insecure: "{{ keystone_service_adminuri_insecure }}" register: add_service when: not nova_placement_service_in_ldap | bool - until: add_service|success + until: add_service is success retries: 5 delay: 10 no_log: True @@ -197,7 +197,7 @@ - url: "{{ nova_placement_service_adminurl }}" interface: "admin" register: add_service - until: add_service|success + until: add_service is success retries: 5 delay: 10 no_log: True diff --git a/tasks/nova_uwsgi.yml b/tasks/nova_uwsgi.yml index 7400ddca..c6d2ba7f 100644 --- a/tasks/nova_uwsgi.yml +++ b/tasks/nova_uwsgi.yml @@ -52,5 +52,5 @@ service: name: nginx state: restarted - when: nginx_conf_removed | changed + when: nginx_conf_removed is changed failed_when: false diff --git a/tests/test-nova-resources-upgrade.yml b/tests/test-nova-resources-upgrade.yml index 70dec535..6ccbe1e8 100644 --- a/tests/test-nova-resources-upgrade.yml +++ b/tests/test-nova-resources-upgrade.yml @@ -36,7 +36,7 @@ {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} {{ pip_install_options | default('') }} register: install_packages - until: install_packages | success + until: install_packages is success retries: 5 delay: 2