|
22 | 22 | no_log: true
|
23 | 23 | register: ipaddr
|
24 | 24 |
|
25 |
| - - name: Set required ansible version as a fact |
| 25 | + - name: Extract ansible version from requirements |
26 | 26 | set_fact:
|
27 |
| - required_ansible_version: "{{ item | regex_replace('^ansible[\\s+]?(?P<op>[=,>,<]+)[\\s+]?(?P<ver>\\d.\\d+(.\\d+)?)$', '{\"op\": \"\\g<op>\",\"ver\"\ |
28 |
| - : \"\\g<ver>\" }') }}" |
| 27 | + ansible_requirement: "{{ item }}" |
29 | 28 | when: '"ansible" in item'
|
30 | 29 | with_items: "{{ lookup('file', 'requirements.txt').splitlines() }}"
|
31 | 30 |
|
| 31 | + - name: Parse ansible version requirement |
| 32 | + set_fact: |
| 33 | + required_ansible_version: |
| 34 | + op: "{{ ansible_requirement | regex_replace('^ansible\\s*([~>=<]+)\\s*.*$', '\\1') }}" |
| 35 | + ver: "{{ ansible_requirement | regex_replace('^ansible\\s*[~>=<]+\\s*(\\d+\\.\\d+(?:\\.\\d+)?).*$', '\\1') }}" |
| 36 | + when: ansible_requirement is defined |
| 37 | + |
32 | 38 | - name: Just get the list from default pip
|
33 | 39 | community.general.pip_package_info:
|
34 | 40 | register: pip_package_info
|
35 | 41 |
|
36 | 42 | - name: Verify Python meets Algo VPN requirements
|
37 | 43 | assert:
|
38 |
| - that: (ansible_python.version.major|string + '.' + ansible_python.version.minor|string) is version('3.8', '>=') |
| 44 | + that: (ansible_python.version.major|string + '.' + ansible_python.version.minor|string) is version('3.11', '>=') |
39 | 45 | msg: >
|
40 | 46 | Python version is not supported.
|
41 |
| - You must upgrade to at least Python 3.8 to use this version of Algo. |
| 47 | + You must upgrade to at least Python 3.11 to use this version of Algo. |
42 | 48 | See for more details - https://trailofbits.github.io/algo/troubleshooting.html#python-version-is-not-supported
|
43 | 49 |
|
44 | 50 | - name: Verify Ansible meets Algo VPN requirements
|
|
0 commit comments