Install python 2 or 3 libraries according to running python version

pull/136/head
Jérémy Lecour 1 year ago committed by Jérémy Lecour
parent dc1a01ce37
commit b293cf2cf9
  1. 2
      CHANGELOG.md
  2. 6
      docker-host/tasks/main.yml
  3. 4
      lxc/tasks/main.yml
  4. 10
      mysql-oracle/tasks/users.yml
  5. 11
      mysql/tasks/users_buster.yml
  6. 13
      mysql/tasks/users_stretch.yml
  7. 4
      postgresql/tasks/nrpe.yml
  8. 4
      rabbitmq/tasks/nrpe.yml
  9. 6
      redmine/tasks/packages.yml
  10. 4
      webapps/nextcloud/tasks/main.yml

@ -47,7 +47,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
### Changed
* Change version pattern
* Use python3 modules for Debian 11 and later
* Install python 2 or 3 libraries according to running python version
* Remove embedded GPG keys only if legacy keyring is present
* apt: remove workaround for Evolix public repositories with Debian 11
* apt: use the new security repository for Bullseye

@ -36,7 +36,7 @@
owner: root
group: root
- name: Install docker and python-docker
- name: Install Docker
apt:
name:
- docker-ce
@ -48,13 +48,13 @@
apt:
name: python-docker
state: present
when: ansible_distribution_major_version is version('10', '<=')
when: ansible_python_version is version('3', '<')
- name: python3-docker is installed
apt:
name: python3-docker
state: present
when: ansible_distribution_major_version is version('10', '>=')
when: ansible_python_version is version('3', '>=')
- name: Copy Docker daemon configuration file
template:

@ -10,13 +10,13 @@
apt:
name: python-lxc
state: present
when: ansible_distribution_major_version is version('10', '<=')
when: ansible_python_version is version('3', '<')
- name: python3-lxc is installed (Debian >= 10)
apt:
name: python3-lxc
state: present
when: ansible_distribution_major_version is version('10', '>=')
when: ansible_python_version is version('3', '>=')
- name: Install additional packages (Debian >= 10)
apt:

@ -1,26 +1,24 @@
---
# dependency for mysql_user and mysql_db
- name: python modules is installed (Ansible dependency)
- name: Python2 dependencies for Ansible are installed
apt:
name:
- python-mysqldb
- python-pymysql
state: present
when: ansible_distribution_major_version is version('10', '<=')
tags:
- mysql
when: ansible_python_version is version('3', '<')
# dependency for mysql_user and mysql_db
- name: python3 modules is installed (Ansible dependency)
- name: Python3 dependencies for Ansible are installed
apt:
name:
- python3-mysqldb
- python3-pymysql
state: present
when: ansible_distribution_major_version is version('10', '>=')
tags:
- mysql
when: ansible_python_version is version('3', '>=')
- name: create a password for mysqladmin
command: "apg -n 1 -m 16 -M lcN"

@ -1,15 +1,24 @@
---
- name: Python dependencies for Ansible are installed
- name: Python2 dependencies for Ansible are installed
apt:
name:
- python-mysqldb
- python-pymysql
state: present
tags:
- mysql
when: ansible_python_version is version('3', '<')
- name: Python3 dependencies for Ansible are installed
apt:
name:
- python3-mysqldb
- python3-pymysql
state: present
tags:
- mysql
when: ansible_python_version is version('3', '>=')
- name: create a password for mysqladmin
command: "apg -n 1 -m 16 -M lcN"

@ -1,6 +1,6 @@
---
- name: Python dependencies for Ansible are installed
- name: Python2 dependencies for Ansible are installed
apt:
name:
- python-mysqldb
@ -8,6 +8,17 @@
state: present
tags:
- mysql
when: ansible_python_version is version('3', '<')
- name: Python3 dependencies for Ansible are installed
apt:
name:
- python3-mysqldb
- python3-pymysql
state: present
tags:
- mysql
when: ansible_python_version is version('3', '>=')
- name: create a password for mysqladmin
command: "apg -n 1 -m 16 -M lcN"

@ -13,13 +13,13 @@
apt:
name: python-psycopg2
state: present
when: ansible_distribution_major_version is version('10', '<=')
when: ansible_python_version is version('3', '<')
- name: python3-psycopg2 is installed (Ansible dependency)
apt:
name: python3-psycopg2
state: present
when: ansible_distribution_major_version is version('10', '>=')
when: ansible_python_version is version('3', '>=')
- name: Is nrpe present ?
stat:

@ -4,13 +4,13 @@
apt:
name: python-requests
state: present
when: ansible_distribution_major_version is version('10', '<=')
when: ansible_python_version is version('3', '<')
- name: python3-requests is installed (check_rabbitmq dependency)
apt:
name: python3-requests
state: present
when: ansible_distribution_major_version is version('10', '>=')
when: ansible_python_version is version('3', '>=')
- include_role:
name: evolix/remount-usr

@ -25,9 +25,9 @@
- python-mysqldb
- python-pymysql
state: present
when: ansible_distribution_major_version is version('10', '<=')
tags:
- redmine
when: ansible_python_version is version('3', '<')
# dependency for mysql_user and mysql_db
- name: python3 modules is installed (Ansible dependency)
@ -36,6 +36,6 @@
- python3-mysqldb
- python3-pymysql
state: present
when: ansible_distribution_major_version is version('10', '>=')
tags:
- redmine
- redmine
when: ansible_python_version is version('3', '>=')

@ -26,9 +26,9 @@
- python-mysqldb
- python-pymysql
state: present
when: ansible_distribution_major_version is version('10', '<=')
tags:
- nextcloud
when: ansible_python_version is version('3', '<)
# dependency for mysql_user and mysql_db
- name: python3 modules is installed (Ansible dependency)
@ -37,9 +37,9 @@
- python3-mysqldb
- python3-pymysql
state: present
when: ansible_distribution_major_version is version('10', '>=')
tags:
- nextcloud
when: ansible_python_version is version('3', '>=')
- include: user.yml

Loading…
Cancel
Save