2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-23 23:18:24 +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 - hosts: localhost
become: yes become: yes
become_user: root become_user: root
vars: vars:
bench_repo_path: "/Users/{{ ansible_user_id }}/.bench" bench_repo_path: "/Users/{{ ansible_user_id }}/.bench"
bench_path: "/Users/{{ ansible_user_id }}/frappe-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 tasks:
- name: cask installs - name: install prequisites
homebrew_cask: name={{ item }} state=present homebrew:
with_items: name:
- wkhtmltopdf - cmake
- redis
- mariadb
- nodejs
state: present
- name: install wkhtmltopdf
homebrew_cask:
name:
- wkhtmltopdf
state: present
- name: configure mariadb - name: configure mariadb
include: roles/mariadb/tasks/main.yml include: roles/mariadb/tasks/main.yml

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,9 +1,10 @@
--- ---
- name: Install deps - name: Install deps
yum: name="{{item}}" state=present yum:
with_items: name:
- policycoreutils-python - policycoreutils-python
- selinux-policy-devel - selinux-policy-devel
state: present
when: ansible_distribution == 'CentOS' when: ansible_distribution == 'CentOS'
- name: Check enabled SELinux modules - 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 template: src=mariadb_centos.repo.j2 dest=/etc/yum.repos.d/mariadb.repo owner=root group=root mode=0644
- name: Install MariaDB - name: Install MariaDB
yum: name={{ item }} enablerepo=mariadb state=present yum:
with_items: name:
- MariaDB-server - MariaDB-server
- MariaDB-client - MariaDB-client
enablerepo: mariadb
state: present
- name: Install MySQLdb Python package for secure installations. - 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 when: mysql_secure_installation and mysql_root_password is defined

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,10 +5,11 @@
state: present state: present
- name: Install dependencies - name: Install dependencies
yum: name={{ item }} state=present yum:
with_items: name:
- kernel-devel - kernel-devel
- deltarpm - deltarpm
state: present
- copy: src=virtualbox_centos.repo dest=/etc/yum.repos.d/virtualbox.repo owner=root group=root mode=0644 force=no - 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 - name: install base fonts
yum: name={{ item }} state=present yum:
with_items: name:
- libXrender - libXrender
- libXext - libXext
- xorg-x11-fonts-75dpi - xorg-x11-fonts-75dpi
- xorg-x11-fonts-Type1 - xorg-x11-fonts-Type1
state: present
when: ansible_os_family == 'RedHat' when: ansible_os_family == 'RedHat'
- name: install base fonts - name: install base fonts
apt: name={{ item }} state=present force=yes apt:
with_items: pkg:
- libxrender1 - libxrender1
- libxext6 - libxext6
- xfonts-75dpi - xfonts-75dpi
- xfonts-base - xfonts-base
state: present
force: yes
when: ansible_os_family == 'Debian' when: ansible_os_family == 'Debian'
# wkhtmltopdf has been locked down to 0.12.3 intentionally since 0.12.4 has problems. # wkhtmltopdf has been locked down to 0.12.3 intentionally since 0.12.4 has problems.