forked from evolix/ansible-roles
Install python 2 or 3 libraries according to running python version
This commit is contained in:
parent
dc1a01ce37
commit
b293cf2cf9
|
@ -47,7 +47,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
* Change version pattern
|
* 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
|
* Remove embedded GPG keys only if legacy keyring is present
|
||||||
* apt: remove workaround for Evolix public repositories with Debian 11
|
* apt: remove workaround for Evolix public repositories with Debian 11
|
||||||
* apt: use the new security repository for Bullseye
|
* apt: use the new security repository for Bullseye
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
||||||
- name: Install docker and python-docker
|
- name: Install Docker
|
||||||
apt:
|
apt:
|
||||||
name:
|
name:
|
||||||
- docker-ce
|
- docker-ce
|
||||||
|
@ -48,13 +48,13 @@
|
||||||
apt:
|
apt:
|
||||||
name: python-docker
|
name: python-docker
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution_major_version is version('10', '<=')
|
when: ansible_python_version is version('3', '<')
|
||||||
|
|
||||||
- name: python3-docker is installed
|
- name: python3-docker is installed
|
||||||
apt:
|
apt:
|
||||||
name: python3-docker
|
name: python3-docker
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution_major_version is version('10', '>=')
|
when: ansible_python_version is version('3', '>=')
|
||||||
|
|
||||||
- name: Copy Docker daemon configuration file
|
- name: Copy Docker daemon configuration file
|
||||||
template:
|
template:
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
apt:
|
apt:
|
||||||
name: python-lxc
|
name: python-lxc
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution_major_version is version('10', '<=')
|
when: ansible_python_version is version('3', '<')
|
||||||
|
|
||||||
- name: python3-lxc is installed (Debian >= 10)
|
- name: python3-lxc is installed (Debian >= 10)
|
||||||
apt:
|
apt:
|
||||||
name: python3-lxc
|
name: python3-lxc
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution_major_version is version('10', '>=')
|
when: ansible_python_version is version('3', '>=')
|
||||||
|
|
||||||
- name: Install additional packages (Debian >= 10)
|
- name: Install additional packages (Debian >= 10)
|
||||||
apt:
|
apt:
|
||||||
|
|
|
@ -1,26 +1,24 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
# dependency for mysql_user and mysql_db
|
- name: Python2 dependencies for Ansible are installed
|
||||||
- name: python modules is installed (Ansible dependency)
|
|
||||||
apt:
|
apt:
|
||||||
name:
|
name:
|
||||||
- python-mysqldb
|
- python-mysqldb
|
||||||
- python-pymysql
|
- python-pymysql
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution_major_version is version('10', '<=')
|
|
||||||
tags:
|
tags:
|
||||||
- mysql
|
- mysql
|
||||||
|
when: ansible_python_version is version('3', '<')
|
||||||
|
|
||||||
# dependency for mysql_user and mysql_db
|
- name: Python3 dependencies for Ansible are installed
|
||||||
- name: python3 modules is installed (Ansible dependency)
|
|
||||||
apt:
|
apt:
|
||||||
name:
|
name:
|
||||||
- python3-mysqldb
|
- python3-mysqldb
|
||||||
- python3-pymysql
|
- python3-pymysql
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution_major_version is version('10', '>=')
|
|
||||||
tags:
|
tags:
|
||||||
- mysql
|
- mysql
|
||||||
|
when: ansible_python_version is version('3', '>=')
|
||||||
|
|
||||||
- name: create a password for mysqladmin
|
- name: create a password for mysqladmin
|
||||||
command: "apg -n 1 -m 16 -M lcN"
|
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:
|
apt:
|
||||||
name:
|
name:
|
||||||
- python-mysqldb
|
- python-mysqldb
|
||||||
- python-pymysql
|
- 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-mysqldb
|
||||||
- python3-pymysql
|
- python3-pymysql
|
||||||
state: present
|
state: present
|
||||||
tags:
|
tags:
|
||||||
- mysql
|
- mysql
|
||||||
|
when: ansible_python_version is version('3', '>=')
|
||||||
|
|
||||||
- name: create a password for mysqladmin
|
- name: create a password for mysqladmin
|
||||||
command: "apg -n 1 -m 16 -M lcN"
|
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:
|
apt:
|
||||||
name:
|
name:
|
||||||
- python-mysqldb
|
- python-mysqldb
|
||||||
|
@ -8,6 +8,17 @@
|
||||||
state: present
|
state: present
|
||||||
tags:
|
tags:
|
||||||
- mysql
|
- 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
|
- name: create a password for mysqladmin
|
||||||
command: "apg -n 1 -m 16 -M lcN"
|
command: "apg -n 1 -m 16 -M lcN"
|
||||||
|
|
|
@ -13,13 +13,13 @@
|
||||||
apt:
|
apt:
|
||||||
name: python-psycopg2
|
name: python-psycopg2
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution_major_version is version('10', '<=')
|
when: ansible_python_version is version('3', '<')
|
||||||
|
|
||||||
- name: python3-psycopg2 is installed (Ansible dependency)
|
- name: python3-psycopg2 is installed (Ansible dependency)
|
||||||
apt:
|
apt:
|
||||||
name: python3-psycopg2
|
name: python3-psycopg2
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution_major_version is version('10', '>=')
|
when: ansible_python_version is version('3', '>=')
|
||||||
|
|
||||||
- name: Is nrpe present ?
|
- name: Is nrpe present ?
|
||||||
stat:
|
stat:
|
||||||
|
|
|
@ -4,13 +4,13 @@
|
||||||
apt:
|
apt:
|
||||||
name: python-requests
|
name: python-requests
|
||||||
state: present
|
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)
|
- name: python3-requests is installed (check_rabbitmq dependency)
|
||||||
apt:
|
apt:
|
||||||
name: python3-requests
|
name: python3-requests
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution_major_version is version('10', '>=')
|
when: ansible_python_version is version('3', '>=')
|
||||||
|
|
||||||
- include_role:
|
- include_role:
|
||||||
name: evolix/remount-usr
|
name: evolix/remount-usr
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
- python-mysqldb
|
- python-mysqldb
|
||||||
- python-pymysql
|
- python-pymysql
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution_major_version is version('10', '<=')
|
|
||||||
tags:
|
tags:
|
||||||
- redmine
|
- redmine
|
||||||
|
when: ansible_python_version is version('3', '<')
|
||||||
|
|
||||||
# dependency for mysql_user and mysql_db
|
# dependency for mysql_user and mysql_db
|
||||||
- name: python3 modules is installed (Ansible dependency)
|
- name: python3 modules is installed (Ansible dependency)
|
||||||
|
@ -36,6 +36,6 @@
|
||||||
- python3-mysqldb
|
- python3-mysqldb
|
||||||
- python3-pymysql
|
- python3-pymysql
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution_major_version is version('10', '>=')
|
|
||||||
tags:
|
tags:
|
||||||
- redmine
|
- redmine
|
||||||
|
when: ansible_python_version is version('3', '>=')
|
|
@ -26,9 +26,9 @@
|
||||||
- python-mysqldb
|
- python-mysqldb
|
||||||
- python-pymysql
|
- python-pymysql
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution_major_version is version('10', '<=')
|
|
||||||
tags:
|
tags:
|
||||||
- nextcloud
|
- nextcloud
|
||||||
|
when: ansible_python_version is version('3', '<)
|
||||||
|
|
||||||
# dependency for mysql_user and mysql_db
|
# dependency for mysql_user and mysql_db
|
||||||
- name: python3 modules is installed (Ansible dependency)
|
- name: python3 modules is installed (Ansible dependency)
|
||||||
|
@ -37,9 +37,9 @@
|
||||||
- python3-mysqldb
|
- python3-mysqldb
|
||||||
- python3-pymysql
|
- python3-pymysql
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution_major_version is version('10', '>=')
|
|
||||||
tags:
|
tags:
|
||||||
- nextcloud
|
- nextcloud
|
||||||
|
when: ansible_python_version is version('3', '>=')
|
||||||
|
|
||||||
- include: user.yml
|
- include: user.yml
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue