From 402c012b9f77141d418485e2afd5c4f3fec35c7c 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: Iee01cc384368c76cf191244f4988ef735ee3d5d7 --- tasks/monasca_alarms_setup.yml | 2 +- tasks/monasca_install.yml | 14 +++++++------- tasks/monasca_kafka_setup.yml | 2 +- tasks/monasca_thresh_install.yml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tasks/monasca_alarms_setup.yml b/tasks/monasca_alarms_setup.yml index 5b806fe..dd2ddf6 100644 --- a/tasks/monasca_alarms_setup.yml +++ b/tasks/monasca_alarms_setup.yml @@ -16,7 +16,7 @@ url: "{{ monasca_service_internalurl }}" status_code: 401 register: result - until: result|success + until: result is success retries: 5 delay: 2 diff --git a/tasks/monasca_install.yml b/tasks/monasca_install.yml index 0dc6e05..b1930bd 100644 --- a/tasks/monasca_install.yml +++ b/tasks/monasca_install.yml @@ -23,7 +23,7 @@ update_cache: "{{ (ansible_pkg_mgr == 'apt') | 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 @@ -56,21 +56,21 @@ file: path: "{{ monasca_bin | dirname }}" state: absent - when: monasca_get_venv | changed + when: monasca_get_venv is changed - name: Create monasca venv dir file: path: "{{ monasca_bin | dirname }}" state: directory register: monasca_venv_dir - when: monasca_get_venv | changed + when: monasca_get_venv is changed - name: Unarchive pre-built venv unarchive: src: "/var/cache/{{ monasca_venv_download_url | basename }}" dest: "{{ monasca_bin | dirname }}" copy: "no" - when: monasca_get_venv | changed + when: monasca_get_venv is changed notify: - Restart monasca services @@ -85,7 +85,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: monasca_get_venv | failed or monasca_get_venv | skipped @@ -98,7 +98,7 @@ state: "absent" when: - ansible_pkg_mgr == 'yum' - - monasca_get_venv | changed + - monasca_get_venv is changed # NOTE(odyssey4me): # We reinitialize the venv to ensure that the right @@ -116,6 +116,6 @@ --no-pip \ --no-setuptools \ --no-wheel - when: monasca_get_venv | changed + when: monasca_get_venv is changed tags: - skip_ansible_lint diff --git a/tasks/monasca_kafka_setup.yml b/tasks/monasca_kafka_setup.yml index 8150dcc..5dce321 100644 --- a/tasks/monasca_kafka_setup.yml +++ b/tasks/monasca_kafka_setup.yml @@ -30,4 +30,4 @@ command: "/opt/kafka/bin/kafka-topics.sh --create --zookeeper {{ zookeeper_hosts }} --replication-factor {{ item.value.replicas }} --partitions {{ item.value.partitions }} --topic {{ item.key }}" with_dict: "{{ kafka_topics }}" when: - - check_result | failed + - check_result is failed diff --git a/tasks/monasca_thresh_install.yml b/tasks/monasca_thresh_install.yml index 90a8d454..5ef29d6 100644 --- a/tasks/monasca_thresh_install.yml +++ b/tasks/monasca_thresh_install.yml @@ -21,7 +21,7 @@ force: yes accept_hostkey: yes register: git_clone - until: git_clone|success + until: git_clone is success retries: 5 delay: 2 with_items: