Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ If you wish to see another distribution on the list, please test on the latest c

| Distribution | Version | Playbook |
| ------------ | --------- | --------------------- |
| Debian | 10 | `lemmy.yml` |
| Debian | 11 | `lemmy.yml` |
| Debian | 12 | `lemmy.yml` |
| Debian | 13 | `lemmy.yml` |
| Ubuntu | 22.04 LTS | `lemmy.yml` |
| RHEL | 9 | `lemmy-almalinux.yml` |

Expand Down
4 changes: 3 additions & 1 deletion examples/customPostgresql.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This is an example from: https://pgtune.leopard.in.ua/ (You should create your own)

# DB Version: 15
# OS Type: linux
# DB Type: web
Expand All @@ -6,7 +8,7 @@
# Data Storage: ssd

max_connections = 200
# This needs to match your shm_size in docker-compose.yml
# This needs to match your `postgres_shm: 2g` in `vars.yml` (It's 'GB' here, and 'g' in vars.yml)
shared_buffers = 2GB
effective_cache_size = 6GB
maintenance_work_mem = 512MB
Expand Down
6 changes: 4 additions & 2 deletions lemmy-almalinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
- name: Install Lemmy
hosts: all
gather_facts: true
vars_files:
- "inventory/host_vars/{{ domain }}/vars.yml"
pre_tasks:
- name: Assert that Ansible version is >= 2.11.0
delegate_to: localhost
Expand Down Expand Up @@ -51,6 +49,10 @@
and https://github.com/LemmyNet/lemmy-ansible#upgrading
when: not vars_file.stat.exists
become: false

- name: Load the vars.yml files
ansible.builtin.include_vars:
file: "inventory/host_vars/{{ domain }}/vars.yml"
handlers:
- name: Reload nginx
ansible.builtin.systemd:
Expand Down
37 changes: 31 additions & 6 deletions lemmy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
# Install python if required
# https://www.josharcher.uk/code/ansible-python-connection-failure-ubuntu-server-1604/
gather_facts: false
vars_files:
- "inventory/host_vars/{{ domain }}/vars.yml"
pre_tasks:
- name: Assert that Ansible version is >= 2.11.0
delegate_to: localhost
Expand Down Expand Up @@ -65,6 +63,10 @@
tags:
- always

- name: Load the vars.yml files
ansible.builtin.include_vars:
file: "inventory/host_vars/{{ domain }}/vars.yml"

- name: Install python for Ansible
# python2-minimal instead of python-minimal for ubuntu 20.04 and up
ansible.builtin.raw: test -e /usr/bin/python || test -e /usr/bin/python3 || (apt -y update && apt install -y python3-minimal python3-setuptools)
Expand Down Expand Up @@ -108,7 +110,6 @@
- "ca-certificates"
- "curl"
- "gnupg"
- "software-properties-common"
- "python3-pip"
- "virtualenv"
- "python3-setuptools"
Expand Down Expand Up @@ -144,8 +145,8 @@
# based on https://docs.docker.com/engine/install/debian/
# and https://docs.docker.com/engine/install/ubuntu/
# note that Debian and Ubuntu use the same key
- name: Configure Docker apt repo for Debian or Ubuntu >= 22.04
when: (ansible_distribution == 'Debian') or
- name: Configure Docker apt repo for Debian < 12 or Ubuntu >= 22.04
when: (ansible_distribution == 'Debian' and ansible_distribution_version | int < 12) or
(ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '22.04')
tags:
- dependencies
Expand All @@ -164,11 +165,35 @@
https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable
state: present

- name: Configure Docker apt repo for Debian >= 13 (Trixie)
when: (ansible_distribution == 'Debian' and ansible_distribution_version | int >= 12)
tags:
- dependencies
- docker
block:
- name: Download Docker GPG Key
ansible.builtin.get_url:
url: https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg
dest: /etc/apt/keyrings/docker.asc
checksum: sha256:1500c1f56fa9e26b9b8f42452a553675796ade0807cdce11975eb98170b3a570
mode: "0644"
- name: Add Docker apt repo
ansible.builtin.deb822_repository:
name: docker
types: deb
uris: https://download.docker.com/linux/{{ ansible_distribution | lower }}
suites: "{{ ansible_distribution_release }}"
components: stable
signed_by: /etc/apt/keyrings/docker.asc
state: present

- name: Install docker-ce and docker-compose
ansible.builtin.apt:
name:
- containerd.io
- docker-ce
- docker-compose
- docker-buildx-plugin
- docker-compose-plugin
state: present
update_cache: true
tags:
Expand Down
2 changes: 2 additions & 0 deletions templates/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ services:
{% endfor %}
{% endif %}
volumes:
# starting postgres 18+ this will need to be `/volumes/postgres:/var/lib/postgresql:Z`
# ref: https://github.com/pgautoupgrade/docker-pgautoupgrade?tab=readme-ov-file#error-message-when-mounting-data-to-varlibpostgresqldata-on-postgres-v18
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't have any objections to you doing a postgres v18 upgrade here also. Then there's no need for the comment.

Alternatively, just remove this comment and do the postgres v18 upgrade in another PR.

- ./volumes/postgres:/var/lib/postgresql/data:Z
- ./customPostgresql.conf:/etc/postgresql.conf:Z
restart: always
Expand Down