2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

fix(ansible): python api deprecated warnings

This commit is contained in:
Gavin D'souza 2019-12-04 18:24:56 +05:30
parent 0a6ffd168b
commit 3dc8b48da7
20 changed files with 255 additions and 203 deletions

View File

@ -2,24 +2,26 @@
- hosts: localhost
become: yes
become_user: root
vars:
bench_repo_path: "/Users/{{ ansible_user_id }}/.bench"
bench_path: "/Users/{{ ansible_user_id }}/frappe-bench"
tasks:
# install pre-requisites
- name: install prequisites
homebrew: name={{ item }} state=present
with_items:
- cmake
- redis
- mariadb
- nodejs
# install wkhtmltopdf
- name: cask installs
homebrew_cask: name={{ item }} state=present
with_items:
- wkhtmltopdf
tasks:
- name: install prequisites
homebrew:
name:
- cmake
- redis
- mariadb
- nodejs
state: present
- name: install wkhtmltopdf
homebrew_cask:
name:
- wkhtmltopdf
state: present
- name: configure mariadb
include: roles/mariadb/tasks/main.yml

View File

@ -31,10 +31,12 @@
# For Ubuntu / Debian
- name: Install ufw
apt: name={{ item }} state=present force=yes
with_items:
- python-selinux
- ufw
apt:
state: present
force: yes
pkg:
- python-selinux
- ufw
when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian'
- name: Enable Firewall

View File

@ -4,26 +4,30 @@
pip: name=pyOpenSSL version=16.2.0
- name: install pillow prerequisites for Debian < 8
apt: pkg={{ item }} state=present
with_items:
- libjpeg8-dev
- libtiff4-dev
- tcl8.5-dev
- tk8.5-dev
apt:
pkg:
- libjpeg8-dev
- libtiff4-dev
- tcl8.5-dev
- tk8.5-dev
state: present
when: ansible_distribution_version | version_compare('8', 'lt')
- name: install pillow prerequisites for Debian >= 8
apt: pkg={{ item }} state=present
with_items:
- libjpeg62-turbo-dev
- libtiff5-dev
- tcl8.5-dev
- tk8.5-dev
apt:
pkg:
- libjpeg62-turbo-dev
- libtiff5-dev
- tcl8.5-dev
- tk8.5-dev
state: present
when: ansible_distribution_version | version_compare('8', 'ge')
- name: install pdf prerequisites debian
apt: pkg={{ item }} state=present force=yes
with_items:
- libssl-dev
apt:
pkg:
- libssl-dev
state: present
force: yes
...

View File

@ -3,35 +3,37 @@
- name: Install prerequisites using apt-get
become: yes
become_user: root
apt: pkg={{ item }} state=present force=yes
with_items:
- dnsmasq
- fontconfig
- git # Version control
- htop # Server stats
- libcrypto++-dev
- libfreetype6-dev
- liblcms2-dev
- libwebp-dev
- libxext6
- libxrender1
- libxslt1-dev
- libxslt1.1
- libffi-dev
- ntp # Clock synchronization
- postfix # Mail Server
- python3-dev # Installing python developer suite
- python-tk
- screen # To aid ssh sessions with connectivity problems
- vim # Is that supposed to be a question!?
- xfonts-75dpi
- xfonts-base
- zlib1g-dev
- apt-transport-https
- libsasl2-dev
- libldap2-dev
- libcups2-dev
- pv # Show progress during database restore
apt:
pkg:
- dnsmasq
- fontconfig
- git # Version control
- htop # Server stats
- libcrypto++-dev
- libfreetype6-dev
- liblcms2-dev
- libwebp-dev
- libxext6
- libxrender1
- libxslt1-dev
- libxslt1.1
- libffi-dev
- ntp # Clock synchronization
- postfix # Mail Server
- python3-dev # Installing python developer suite
- python-tk
- screen # To aid ssh sessions with connectivity problems
- vim # Is that supposed to be a question!?
- xfonts-75dpi
- xfonts-base
- zlib1g-dev
- apt-transport-https
- libsasl2-dev
- libldap2-dev
- libcups2-dev
- pv # Show progress during database restore
state: present
force: yes
- include_tasks: debian.yml
when: ansible_distribution == 'Debian'

View File

@ -9,18 +9,20 @@
tasks:
# install pre-requisites
- name: install prequisites
homebrew: name={{ item }} state=present
with_items:
- cmake
- redis
- mariadb
- nodejs
homebrew:
name:
- cmake
- redis
- mariadb
- nodejs
state: present
# install wkhtmltopdf
- name: cask installs
homebrew_cask: name={{ item }} state=present
with_items:
- wkhtmltopdf
homebrew_cask:
name:
- wkhtmltopdf
state: present
- name: configure mariadb
include_tasks: roles/mariadb/tasks/main.yml

View File

@ -10,42 +10,43 @@
- name: "Setup prerequisites using yum"
become: yes
become_user: root
yum: name={{ item }} state=present
with_items:
- bzip2-devel
- cronie
- dnsmasq
- freetype-devel
- git
- htop
- lcms2-devel
- libjpeg-devel
- libtiff-devel
- libffi-devel
- libwebp-devel
- libXext
- libXrender
- libzip-devel
- libffi-devel
- ntp
- openssl-devel
- postfix
- python36u
- python-devel
- python-setuptools
- python-pip
- redis
- screen
- sudo
- tcl-devel
- tk-devel
- vim
- which
- xorg-x11-fonts-75dpi
- xorg-x11-fonts-Type1
- zlib-devel
- openssl-devel
- openldap-devel
- libselinux-python
- cups-libs
yum:
name:
- bzip2-devel
- cronie
- dnsmasq
- freetype-devel
- git
- htop
- lcms2-devel
- libjpeg-devel
- libtiff-devel
- libffi-devel
- libwebp-devel
- libXext
- libXrender
- libzip-devel
- libffi-devel
- ntp
- openssl-devel
- postfix
- python36u
- python-devel
- python-setuptools
- python-pip
- redis
- screen
- sudo
- tcl-devel
- tk-devel
- vim
- which
- xorg-x11-fonts-75dpi
- xorg-x11-fonts-Type1
- zlib-devel
- openssl-devel
- openldap-devel
- libselinux-python
- cups-libs
state: present
...

View File

@ -1,34 +1,41 @@
---
- name: install pillow prerequisites for Ubuntu < 14.04
apt: pkg={{ item }} state=present force=yes
with_items:
- libjpeg8-dev
- libtiff4-dev
- tcl8.5-dev
- tk8.5-dev
apt:
pkg:
- libjpeg8-dev
- libtiff4-dev
- tcl8.5-dev
- tk8.5-dev
state: present
force: yes
when: ansible_distribution_version | version_compare('14.04', 'lt')
- name: install pillow prerequisites for Ubuntu >= 14.04
apt: pkg={{ item }} state=present force=yes
with_items:
- libjpeg8-dev
- libtiff5-dev
- tcl8.6-dev
- tk8.6-dev
apt:
pkg:
- libjpeg8-dev
- libtiff5-dev
- tcl8.6-dev
- tk8.6-dev
state: present
force: yes
when: ansible_distribution_version | version_compare('14.04', 'ge')
- name: install pdf prerequisites for Ubuntu < 18.04
apt: pkg={{ item }} state=present force=yes
with_items:
- libssl-dev
apt:
pkg:
- libssl-dev
state: present
force: yes
when: ansible_distribution_version | version_compare('18.04', 'lt')
- name: install pdf prerequisites for Ubuntu >= 18.04
apt: pkg={{ item }} state=present force=yes
with_items:
- libssl1.0-dev
apt:
pkg:
- libssl1.0-dev
state: present
force: yes
when: ansible_distribution_version | version_compare('18.04', 'ge')
...

View File

@ -1,9 +1,10 @@
---
- name: Install deps
yum: name="{{item}}" state=present
with_items:
- policycoreutils-python
- selinux-policy-devel
yum:
name:
- policycoreutils-python
- selinux-policy-devel
state: present
when: ansible_distribution == 'CentOS'
- name: Check enabled SELinux modules

View File

@ -3,11 +3,16 @@
template: src=mariadb_centos.repo.j2 dest=/etc/yum.repos.d/mariadb.repo owner=root group=root mode=0644
- name: Install MariaDB
yum: name={{ item }} enablerepo=mariadb state=present
with_items:
- MariaDB-server
- MariaDB-client
yum:
name:
- MariaDB-server
- MariaDB-client
enablerepo: mariadb
state: present
- name: Install MySQLdb Python package for secure installations.
yum: name=MySQL-python state=present
yum:
name:
- MySQL-python
state: present
when: mysql_secure_installation and mysql_root_password is defined

View File

@ -21,11 +21,13 @@
shell: export DEBIAN_FRONTEND=noninteractive
- name: apt-get install
apt: pkg={{ item }} update_cache=yes state=present
with_items:
- mariadb-server
- mariadb-client
- mariadb-common
- libmariadbclient18
- python3-mysqldb
apt:
pkg:
- mariadb-server
- mariadb-client
- mariadb-common
- libmariadbclient18
- python3-mysqldb
update_cache: yes
state: present
...

View File

@ -16,12 +16,16 @@
changed_when: false
- name: Install MariaDB
apt: pkg={{ item }} state=present
with_items:
- mariadb-server
- mariadb-client
- libmariadbclient18
apt:
pkg:
- mariadb-server
- mariadb-client
- libmariadbclient18
state: present
- name: Install MySQLdb Python package for secure installations.
apt: pkg=python3-mysqldb state=present
apt:
pkg:
- python3-mysqldb
state: present
when: mysql_secure_installation and mysql_root_password is defined

View File

@ -16,12 +16,16 @@
changed_when: false
- name: Install MariaDB
apt: pkg={{ item }} state=present
with_items:
- mariadb-server
- mariadb-client
- libmariadbclient18
apt:
pkg:
- mariadb-server
- mariadb-client
- libmariadbclient18
state: present
- name: Install MySQLdb Python package for secure installations.
apt: pkg=python3-mysqldb state=present
apt:
pkg:
- python3-mysqldb
state: present
when: mysql_secure_installation and mysql_root_password is defined

View File

@ -7,7 +7,7 @@
- name: Install nodejs {{ node_version }}
apt:
name: nodejs
pkg: nodejs
state: present
update_cache: yes
force: yes

View File

@ -1,9 +1,10 @@
---
- name: Install ntpd
yum: name="{{item}}" state=installed
with_items:
- ntp
- ntpdate
yum:
name:
- ntp
- ntpdate
state: installed
when: ansible_distribution == 'CentOS'
- name: Enable ntpd
@ -11,10 +12,11 @@
when: ansible_distribution == 'CentOS'
- name: Install ntpd
apt: name="{{item}}" state=installed
with_items:
- ntp
- ntpdate
apt:
pkg:
- ntp
- ntpdate
state: installed
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Enable ntpd

View File

@ -1,6 +1,8 @@
---
- name: Install unzip
apt: pkg={{ item }} update_cache=yes state=present
with_items:
- unzip
apt:
pkg:
- unzip
update_cache: yes
state: present
...

View File

@ -1,7 +1,8 @@
---
- name: Install unzip
yum: name={{ item }} state=present
with_items:
- unzip
yum:
name:
- unzip
state: present
...

View File

@ -1,21 +1,25 @@
---
- name: Install yum packages
yum: name={{ item }} state=present
with_items:
- redis
yum:
name:
- redis
state: present
when: ansible_os_family == 'RedHat'
# Prerequisite for Debian and Ubuntu
- name: Install apt packages
apt: pkg={{ item }} state=present force=yes
with_items:
- redis-server
apt:
pkg:
- redis-server
state: present
force: yes
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
# Prerequisite for MACOS
- name: install prequisites for macos
homebrew: name={{ item }} state=present
with_items:
- redis
homebrew:
name:
- redis
state: present
when: ansible_distribution == 'MacOSX'
...

View File

@ -1,9 +1,10 @@
---
- name: Install dependencies
apt: pkg={{ item }} state=present
with_items:
- apt-transport-https
- ca-certificates
apt:
pkg:
- apt-transport-https
- ca-certificates
state: present
- name: Add VirtualBox to sources.list
apt_repository:
@ -23,7 +24,9 @@
when: (ansible_distribution == "Debian" and ansible_distribution_major_version < "8") or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version < "16")
- name: Install VirtualBox
apt: pkg={{ item }} update_cache=yes state=present
with_items:
- virtualbox-{{ virtualbox_version }}
apt:
pkg:
- virtualbox-{{ virtualbox_version }}
update_cache: yes
state: present
...

View File

@ -5,10 +5,11 @@
state: present
- name: Install dependencies
yum: name={{ item }} state=present
with_items:
- kernel-devel
- deltarpm
yum:
name:
- kernel-devel
- deltarpm
state: present
- copy: src=virtualbox_centos.repo dest=/etc/yum.repos.d/virtualbox.repo owner=root group=root mode=0644 force=no

View File

@ -1,20 +1,23 @@
---
- name: install base fonts
yum: name={{ item }} state=present
with_items:
- libXrender
- libXext
- xorg-x11-fonts-75dpi
- xorg-x11-fonts-Type1
yum:
name:
- libXrender
- libXext
- xorg-x11-fonts-75dpi
- xorg-x11-fonts-Type1
state: present
when: ansible_os_family == 'RedHat'
- name: install base fonts
apt: name={{ item }} state=present force=yes
with_items:
- libxrender1
- libxext6
- xfonts-75dpi
- xfonts-base
apt:
pkg:
- libxrender1
- libxext6
- xfonts-75dpi
- xfonts-base
state: present
force: yes
when: ansible_os_family == 'Debian'
# wkhtmltopdf has been locked down to 0.12.3 intentionally since 0.12.4 has problems.