Skip to content

Commit

Permalink
fix(ansible): python api deprecated warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Dec 4, 2019
1 parent 0a6ffd1 commit 3dc8b48
Show file tree
Hide file tree
Showing 20 changed files with 254 additions and 202 deletions.
28 changes: 15 additions & 13 deletions playbooks/macosx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
Expand Down
10 changes: 6 additions & 4 deletions playbooks/roles/bench/tasks/setup_firewall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 19 additions & 15 deletions playbooks/roles/common/tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

...
60 changes: 31 additions & 29 deletions playbooks/roles/common/tasks/debian_family.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
20 changes: 11 additions & 9 deletions playbooks/roles/common/tasks/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
77 changes: 39 additions & 38 deletions playbooks/roles/common/tasks/redhat_family.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
...
45 changes: 26 additions & 19 deletions playbooks/roles/common/tasks/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -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')

...
9 changes: 5 additions & 4 deletions playbooks/roles/frappe_selinux/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 10 additions & 5 deletions playbooks/roles/mariadb/tasks/centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading

0 comments on commit 3dc8b48

Please sign in to comment.