Browse Source

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: I2f92ab5520fb2e9822fcd0bbc3382305066c5d21
Jean-Philippe Evrard 9 months ago
parent
commit
2949cae220
2 changed files with 10 additions and 10 deletions
  1. 3
    3
      handlers/main.yml
  2. 7
    7
      tasks/gnocchi_install.yml

+ 3
- 3
handlers/main.yml View File

@@ -24,7 +24,7 @@
24 24
     - "item.value.group in group_names"
25 25
     - item.value.service_enabled | bool
26 26
   register: _stop
27
-  until: _stop | success
27
+  until: _stop  is success
28 28
   retries: 5
29 29
   delay: 2
30 30
   listen: Restart gnocchi services
@@ -58,7 +58,7 @@
58 58
     - "item.value.group in group_names"
59 59
     - item.value.service_enabled | bool
60 60
   register: _start
61
-  until: _start | success
61
+  until: _start  is success
62 62
   retries: 5
63 63
   delay: 2
64 64
   listen: Restart gnocchi services
@@ -71,6 +71,6 @@
71 71
     daemon_reload: "{{ (ansible_service_mgr == 'systemd') | ternary('yes', omit) }}"
72 72
   when: gnocchi_use_mod_wsgi | bool
73 73
   register: _restart
74
-  until: _restart | success
74
+  until: _restart  is success
75 75
   retries: 5
76 76
   delay: 2

+ 7
- 7
tasks/gnocchi_install.yml View File

@@ -20,7 +20,7 @@
20 20
     update_cache: "{{ (ansible_pkg_mgr in ['apt', 'zypper']) | ternary('yes', omit) }}"
21 21
     cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(cache_timeout, omit) }}"
22 22
   register: install_packages
23
-  until: install_packages|success
23
+  until: install_packages is success
24 24
   retries: 5
25 25
   delay: 2
26 26
 
@@ -52,7 +52,7 @@
52 52
   file:
53 53
     path: "{{ gnocchi_bin | dirname }}"
54 54
     state: absent
55
-  when: gnocchi_get_venv | changed
55
+  when: gnocchi_get_venv  is changed
56 56
 
57 57
 - name: Create gnocchi venv dir
58 58
   file:
@@ -60,14 +60,14 @@
60 60
     state: directory
61 61
     mode: "0755"
62 62
   register: gnocchi_venv_dir
63
-  when: gnocchi_get_venv | changed
63
+  when: gnocchi_get_venv  is changed
64 64
 
65 65
 - name: Unarchive pre-built venv
66 66
   unarchive:
67 67
     src: "/var/cache/{{ gnocchi_venv_download_url | basename }}"
68 68
     dest: "{{ gnocchi_bin | dirname }}"
69 69
     copy: "no"
70
-  when: gnocchi_get_venv | changed
70
+  when: gnocchi_get_venv  is changed
71 71
   notify:
72 72
     - Restart gnocchi services
73 73
     - Restart web server
@@ -82,7 +82,7 @@
82 82
       {{ gnocchi_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
83 83
       {{ pip_install_options | default('') }}
84 84
   register: install_packages
85
-  until: install_packages|success
85
+  until: install_packages is success
86 86
   retries: 5
87 87
   delay: 2
88 88
   when: gnocchi_get_venv | failed or gnocchi_get_venv | skipped
@@ -96,7 +96,7 @@
96 96
     state: "absent"
97 97
   when:
98 98
     - ansible_pkg_mgr in ['yum', 'dnf', 'zypper']
99
-    - gnocchi_get_venv | changed
99
+    - gnocchi_get_venv  is changed
100 100
 
101 101
 # NOTE(odyssey4me):
102 102
 # We reinitialize the venv to ensure that the right
@@ -114,7 +114,7 @@
114 114
         --no-pip \
115 115
         --no-setuptools \
116 116
         --no-wheel
117
-  when: gnocchi_get_venv | changed
117
+  when: gnocchi_get_venv  is changed
118 118
   tags:
119 119
     - skip_ansible_lint
120 120
 

Loading…
Cancel
Save