Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dc17c3a

Browse files
authored
Bgmot python version (ansible-collections#890)
* Bump Python version to 3.9 to satisfy ansible 7.0. * Bump ansible from 4.6.0 to 7.0.0 in /molecule. * Bump ansible-core from 2.11.5 to 2.14.2 in /molecule. * In new Ansible version need to specify Python interpreter explicitely for some (like Rocky linux) distros of Linux. * Remove warn: for module command for Ansible 2.14 in molecule tests. * Ansible does not set correct Python interpreter only for rockylinux. * Deal with Python versions mess on different OS/versions.
1 parent 5643347 commit dc17c3a

File tree

14 files changed

+41
-15
lines changed

14 files changed

+41
-15
lines changed

.github/workflows/agent.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ jobs:
5353
- name: Check out code
5454
uses: actions/checkout@v1
5555

56-
- name: Set up Python 3.7
56+
- name: Set up Python 3.9
5757
uses: actions/setup-python@v1
5858
with:
59-
python-version: 3.7
59+
python-version: 3.9
6060

6161
- name: Install dependencies
6262
run: |

.github/workflows/javagateway.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
- name: Check out code
3333
uses: actions/checkout@v1
3434

35-
- name: Set up Python 3.7
35+
- name: Set up Python 3.9
3636
uses: actions/setup-python@v1
3737
with:
38-
python-version: 3.7
38+
python-version: 3.9
3939

4040
- name: Install dependencies
4141
run: |

.github/workflows/proxy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ jobs:
5555
- name: Check out code
5656
uses: actions/checkout@v1
5757

58-
- name: Set up Python 3.7
58+
- name: Set up Python 3.9
5959
uses: actions/setup-python@v1
6060
with:
61-
python-version: 3.7
61+
python-version: 3.9
6262

6363
- name: Install dependencies
6464
run: |

.github/workflows/server.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ jobs:
4545
- name: Check out code
4646
uses: actions/checkout@v1
4747

48-
- name: Set up Python 3.7
48+
- name: Set up Python 3.9
4949
uses: actions/setup-python@v1
5050
with:
51-
python-version: 3.7
51+
python-version: 3.9
5252

5353
- name: Install dependencies
5454
run: |

.github/workflows/web.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ jobs:
4444
- name: Check out code
4545
uses: actions/checkout@v1
4646

47-
- name: Set up Python 3.7
47+
- name: Set up Python 3.9
4848
uses: actions/setup-python@v1
4949
with:
50-
python-version: 3.7
50+
python-version: 3.9
5151

5252
- name: Install dependencies
5353
run: |

molecule/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Install CI dependencies for the Zabbix Roles
2-
ansible==4.6.0
2+
ansible==7.0.0
33
ansible-compat==0.5.0
4-
ansible-core==2.11.5
4+
ansible-core==2.14.2
55
docker==5.0.2
66
molecule==3.5.1
77
molecule-docker==1.0.2

molecule/zabbix_agent_tests/common/molecule.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ provisioner:
2929
inventory:
3030
group_vars:
3131
all:
32+
ansible_python_interpreter: "{{ '${MY_MOLECULE_CONTAINER}' | regex_search('centos8') | ternary('/usr/bin/python3', 'auto') }}"
3233
zabbix_agent_src_reinstall: false
3334
zabbix_install_pip_packages: false
3435
zabbix_agent_server: 192.168.3.33

molecule/zabbix_javagateway/molecule.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ provisioner:
2020
env:
2121
ANSIBLE_COLLECTIONS_PATHS: $HOME/.ansible/collections/ansible_collections/community/zabbix
2222
ANSIBLE_ROLES_PATH: $HOME/.ansible/collections/ansible_collections/community/zabbix/roles
23+
inventory:
24+
group_vars:
25+
all:
26+
ansible_python_interpreter: /usr/bin/python3
2327

2428
verifier:
2529
name: testinfra

molecule/zabbix_javagateway/prepare.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,16 @@
2727
when:
2828
- ansible_os_family != 'RedHat'
2929

30+
- name: Check if warn parameter can be used for shell module
31+
set_fact:
32+
produce_warn: False
33+
when: ansible_version.full is version("2.14", "<")
34+
3035
# https://github.com/geerlingguy/ansible-role-java/issues/64
3136
- name: "Apt update"
3237
shell: "apt-get update && mkdir -p /usr/share/man/man1"
3338
args:
34-
warn: false
39+
warn: "{{ produce_warn | default(omit) }}"
3540
register: installation_dependencies
3641
until: installation_dependencies is succeeded
3742
when:

molecule/zabbix_proxy/molecule.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ provisioner:
2424
ANSIBLE_ROLES_PATH: $HOME/.ansible/collections/ansible_collections/community/zabbix/roles
2525
inventory:
2626
group_vars:
27+
all:
28+
ansible_python_interpreter: /usr/bin/python3
2729
mysql:
2830
zabbix_proxy_database: mysql
2931
zabbix_proxy_database_long: mysql

0 commit comments

Comments
 (0)