66 vars :
77 requirements_path : " {{ kayobe_config_path }}/../../requirements.txt"
88 tasks :
9- - name : Get package info
10- community.general.pip_package_info :
11- register : packages
12-
13- - name : Check if pip is version 24.0 or newer
14- ansible.builtin.assert :
15- that : " {{ packages.packages.pip.pip[0].version is version('24.0', '>=') }}"
16- fail_msg : |
17- Pip must be 24.0 or newer to run this check. Upgrade pip by running
18- pip install -U pip and reinstall Kayobe by running:
19- pip install --force-reinstall -r {{ requirements_path }}
20-
21- - name : Get installed Kayobe commit
22- ansible.builtin.shell :
23- cmd : set -o pipefail && pip freeze | grep kayobe | cut -d @ -f 3
24- executable : /usr/bin/bash
25- register : kayobe_git_commit
26-
27- - name : Clone Kayobe
28- ansible.builtin.git :
29- repo : https://github.com/stackhpc/kayobe.git
30- dest : /tmp/kayobe-git
31- version : stackhpc/{{ openstack_release }}
32-
33- - name : Get tag from Kayobe commit
34- ansible.builtin.command :
35- cmd : git describe --tags {{ kayobe_git_commit.stdout }}
36- chdir : /tmp/kayobe-git
37- register : kayobe_current_version
38-
39- - name : Get latest Kayobe version
40- ansible.builtin.shell :
41- cmd : set -o pipefail && grep -o kayobe@stackhpc\/.*$ {{ requirements_path }} | cut -d @ -f 2
42- executable : /usr/bin/bash
43- register : kayobe_latest_version
44-
45- - name : Check installed Kayobe version is the latest
46- ansible.builtin.assert :
47- that : " kayobe_latest_version.stdout in kayobe_current_version.stdout"
48- fail_msg : |
49- Kayobe must use the expected version before continuing.
50-
51- Current Kayobe version: {{ kayobe_current_version.stdout }}
52- Expected Kayobe version: {{ kayobe_latest_version.stdout }}
53-
54- Recreate the Kayobe environment, or install the expected version
55- by running: pip install --force-reinstall -r {{ requirements_path }}
56- success_msg : |
57- Kayobe running at version: {{ kayobe_current_version.stdout }}
9+ - name : Check version
10+ block :
11+ - name : Get package info
12+ community.general.pip_package_info :
13+ register : packages
14+
15+ - name : Check if pip is version 24.0 or newer
16+ ansible.builtin.assert :
17+ that : " {{ packages.packages.pip.pip[0].version is version('24.0', '>=') }}"
18+ fail_msg : |
19+ Pip must be 24.0 or newer to run this check. Upgrade pip by running
20+ pip install -U pip and reinstall Kayobe by running:
21+ pip install --force-reinstall -r {{ requirements_path }}
22+
23+ - name : Get installed Kayobe commit
24+ ansible.builtin.shell :
25+ cmd : set -o pipefail && pip freeze | grep kayobe | cut -d @ -f 3
26+ executable : /usr/bin/bash
27+ register : kayobe_git_commit
28+
29+ - name : Clone Kayobe
30+ ansible.builtin.git :
31+ repo : https://github.com/stackhpc/kayobe.git
32+ dest : /tmp/kayobe-git
33+ version : stackhpc/{{ openstack_release }}
34+
35+ - name : Get tag from Kayobe commit
36+ ansible.builtin.command :
37+ cmd : git describe --tags {{ kayobe_git_commit.stdout }}
38+ chdir : /tmp/kayobe-git
39+ register : kayobe_current_version
40+
41+ - name : Get latest Kayobe version
42+ ansible.builtin.shell :
43+ cmd : set -o pipefail && grep -o kayobe@stackhpc\/.*$ {{ requirements_path }} | cut -d @ -f 2
44+ executable : /usr/bin/bash
45+ register : kayobe_latest_version
46+
47+ - name : Check installed Kayobe version is the latest
48+ ansible.builtin.assert :
49+ that : " kayobe_latest_version.stdout in kayobe_current_version.stdout"
50+ fail_msg : |
51+ Kayobe must use the expected version before continuing.
52+
53+ Current Kayobe version: {{ kayobe_current_version.stdout }}
54+ Expected Kayobe version: {{ kayobe_latest_version.stdout }}
55+
56+ Recreate the Kayobe environment, or install the expected version
57+ by running: pip install --force-reinstall -r {{ requirements_path }}
58+ success_msg : |
59+ Kayobe running at version: {{ kayobe_current_version.stdout }}
60+ when : stackhpc_enable_kayobe_check
0 commit comments