Commit 2df798cd authored by rexxnor's avatar rexxnor

updates

parent 9a5b352a
---
- name: Install MariaDB on target and create Database
- name: Install PPM with MariaDB
hosts: prepaidmatedb
become: True
tasks:
- name: Install required packages
apt:
name: [mariadb-server, python3-mysqldb]
name: [mariadb-server, python3-mysqldb, python3-dev, libmysqlclient-dev, apache2, libapache2-mod-wsgi-py3, python3-venv, git, virtualenv]
state: present
update_cache: yes
- name: Clone repository
git:
repo: https://git.chaostreffbern.ch/rexxnor/prepaid-mate-website
dest: /var/www/html/ppm/
- name: Install Virtualenv and requirements.txt
pip:
requirements: /var/www/html/ppm/requirements.txt
virtualenv: /var/www/prepaidmatevenv/
virtualenv_python: python3
ignore_errors: yes
- name: Adding prepaidmate config for apache
template:
src: templates/prepaidmate.conf.j2
dest: /etc/apache2/sites-available/prepaidmate.conf
owner: root
group: root
mode: 0644
- name: Deactivate default apache2 site
file:
dest: /etc/apache2/sites-enabled/000-default.conf
state: absent
- name: Deactivate default SSL apache2 site
file:
dest: /etc/apache2/sites-enabled/default-ssl.conf
state: absent
- name: Restarting apache and enabling it
systemd:
name: apache2
state: restarted
enabled: yes
- name: Activate apache2 site for Prepaidmate
file:
src: /etc/apache2/sites-available/prepaidmate.conf
dest: /etc/apache2/sites-enabled/prepaidmate.conf
state: link
- name: Ensuring correct file access rights for /var/www/html
file:
dest: /var/www/html/
owner: www-data
group: www-data
recurse: yes
- name: Generating run secret with script
shell: bash gen_safe_secret.sh
args:
chdir: /var/www/html/ppm/prepaidmatewebsite/prepaidmatewebsite/
creates: /var/www/html/ppm/prepaidmatewebsite/prepaidmatewebsite/secret.txt
- name: Starting mariadb-server and enabling it
systemd:
name: mariadb
......
......@@ -4,6 +4,7 @@ WSGIPythonPath /var/www/html/ppm/prepaidmatewebsite
WSGIDaemonProcess {{ ansible_eth0.ipv4.address }} python-home=/var/www/prepaidmatevenv/ python-path=/var/www/html/ppm/prepaidmatewebsite/
WSGIProcessGroup {{ ansible_eth0.ipv4.address }}
Alias /static/ /var/www/html/ppm/prepaidmatewebsite/prepaid/static
<VirtualHost *:80>
DocumentRoot /var/www/html
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment