This guide deploys Libravatar as a Django web application with PostgreSQL and Redis.
- name: Install Libravatar on Debian family
hosts: libravatar_debian
become: true
vars:
libravatar_dir: /opt/libravatar
libravatar_repo: "https://git.linux-kernel.at/libravatar/libravatar.git"
tasks:
- name: Install dependencies
ansible.builtin.apt:
update_cache: true
name:
- python3
- python3-venv
- python3-pip
- postgresql
- redis-server
- git
state: present
- name: Clone Libravatar source
ansible.builtin.git:
repo: "{{ libravatar_repo }}"
dest: "{{ libravatar_dir }}"
version: master
force: false
failed_when: false
- name: Create Python virtual environment
ansible.builtin.command: python3 -m venv {{ libravatar_dir }}/venv
args:
creates: "{{ libravatar_dir }}/venv/bin/activate"
- name: Install Python dependencies
ansible.builtin.pip:
requirements: "{{ libravatar_dir }}/requirements.txt"
virtualenv: "{{ libravatar_dir }}/venv"
failed_when: false
- name: Install Libravatar on RHEL family
hosts: libravatar_rhel
become: true
tasks:
- name: Install dependencies
ansible.builtin.dnf:
name:
- python3
- python3-pip
- python3-virtualenv
- postgresql-server
- redis
- git
state: present
ansible-playbook -i inventory.ini libravatar-install.yml
libravatar_debian.We develop tailored automation solutions for:
Let’s discuss your requirements: office@linux-server-admin.com | Contact