chuckyz / ansible-mastodon-docker

Ansible module for setting up Mastodon on a single server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ansible-mastodon-docker

A playbook to deploy mastodon as a docker-compose in a simple, opinionated way to a single server.

Note

Running rake commands (e.g.: rake mastodon:make_admin) should be done through docker-compose.

An example would be, while SSH'd as a user with access to docker-compose in mastodon_path:

docker-compose run --rm web -e USER_EMAIL=myuser@email.tld rake mastodon:make_admin

Dropping to a bash shell is similar to check/run different rake commands:

docker-compose run --rm web bash

Then hit enter to drop to shell.

Requirements

  • docker
  • docker-compose
  • git
  • letsencrypt (certbot)
  • At least 4GB memory (can include swap) for compiling assets

Role Variables

Required variables

  • mastodon_domain: Your domain.

  • letsencrypt_email: Your email for letsencrypt certificates.

Optional variables

email default:

email: {
  server: "127.0.0.1"
  port: "25"
  from_address: "notification@localhost"
  auth_method: "none"
  openssl_verify_mode: "none"
}

email example (sparkpost):

email: {
  server: "smtp.sparkpostmail.com"
  port: 587
  login: "SMTP_Injection"
  password: "my_API_key"
  from_address: "notifications@mymastodon.tld"
}

Dependencies

None

Example Playbook

- hosts: mastodon
  become: yes
  become_user: root
  roles:
  - { 
     	 role: "chuckyz.ansible-mastodon-docker", 
     	 mastodon_domain: "mymastodon.tld",
     	 postgres_data_path: "/var/lib/mastodon/postgres",
     	 redis_data_path: "/var/lib/mastodon/redis",
     	 email: {
               server: "smtp.sparkpostmail.com",
               port: 587,
               login: "SMTP_Injection",
               password: "my_API_key",
               from_address: "notifications@mymastodon.tld"
             }  
     }

License

BSD

Author Information

chuckyz

About

Ansible module for setting up Mastodon on a single server


Languages

Language:Shell 100.0%