A docker deploy for ansible
Go to file
2022-09-13 17:20:07 -04:00
examples Federation on by default. (#33) 2022-03-29 15:23:11 +00:00
templates Add logging limitation (#49) 2022-07-14 15:27:39 -04:00
.drone.yml Route any of the application accepts to lemmy. 2021-11-10 09:46:52 -05:00
.gitignore Move password into domain folder. 2021-10-09 12:13:23 -04:00
ansible.cfg Adding a note about priviledges to README. (#18) 2021-11-26 12:36:37 +00:00
lemmy.yml Update lemmy.yml (#36) 2022-04-12 21:25:40 +00:00
LICENSE Adding AGPL license. Fixes #37 (#39) 2022-05-09 22:45:52 +00:00
README.md Adding link to ansible docs. Fixes #46 (#48) 2022-06-03 11:32:02 +00:00
uninstall.yml Removing extra from uninstall. 2021-10-12 13:03:21 -04:00
VERSION Updating VERSION 2022-09-13 17:20:07 -04:00

Lemmy-Ansible

This provides an easy way to install Lemmy on any server. It automatically sets up an nginx server, letsencrypt certificates, and email.

Requirements

To run this ansible playbook, you need to:

  • Have a server / VPS where lemmy will run.
  • Configure a DNS A Record to point at your server's IP address.
  • Make sure you can ssh to it, with a sudo user: ssh <your-user>@<your-domain>
  • Install Ansible on your local machine (do not install it on your destination server).

Install

Clone this repo:

git clone https://github.com/LemmyNet/lemmy-ansible.git
cd lemmy-ansible

Make a directory to hold your config:

mkdir -p inventory/host_vars/<your-domain>

Copy the sample configuration file:

cp examples/config.hjson inventory/host_vars/<your-domain>/config.hjson

Edit that file and change the config to your liking. Note: Do not edit anything inside the {{ }} braces.

Here are all the config options.

Copy the sample inventory hosts file:

cp examples/hosts inventory/hosts

Edit the inventory hosts file (inventory/hosts) to your liking.

Run the playbook:

ansible-playbook -i inventory/hosts lemmy.yml

Note: if you are not the root user or don't have password-less sudo, use this command:

ansible-playbook -i inventory/hosts lemmy.yml --become --ask-become-pass

Note: if you haven't set up ssh keys, and ssh using a password, use the command:

ansible-playbook -i inventory/hosts lemmy.yml --become --ask-pass --ask-become-pass

Full ansible command-line docs

If the command above fails, you may need to comment out this line In the ansible.cfg file:

interpreter_python=/usr/bin/python3

Upgrading

  • Run git pull
  • Check out the Lemmy Releases Changelog to see if there are any config changes with the releases since your last.
  • Run ansible-playbook -i inventory/hosts lemmy.yml --become

Migrating your existing install to use this deploy

  • Follow this guide to backup your existing install.
  • Run docker-compose stop to stop lemmy.
  • Move your docker folders on the server to <lemmy_base_dir>/<your-domain>.
  • Copy your postgres password to inventory/host_vars/<your-domain>/passwords/postgres.
  • Follow the install guide above, making sure your config.hjson is the same as your backup.

Uninstall

ansible-playbook -i inventory/hosts uninstall.yml --become

License