All Projects → ceejbot → mastodon-ansible

ceejbot / mastodon-ansible

Licence: other
How I set up a mastodon instance on AWS with ansible on ubuntu trusty

Programming Languages

Nginx
273 projects
shell
77523 projects

ansible for mastodon

Install Mastodon on Ubuntu Trusty with upstart instead of anything more recent and [insert muttering here].

A work in progress as I make this more like a typical ansible role instead of a set of one-off playbooks. Seems to work just fine (I'm using this for my own instance, at least).

  1. Clone this repo. Edit the vars.yml file.
  2. Register a domain name. Buy a cert for it.
  3. Spin up Ubuntu Trusty 14.04 on AWS & point DNS at the instance. Don't bother making user accounts or anything; only somebody with your key should be able to ssh in. Add security group rules allowing https from anywhere, or maybe http if you want to redirect.
  4. Make an EBS volume or raid up some instance stores and mount them on {{install_dir}}, owned by ubuntu.
  5. Clone this repo.
  6. Edit the inventory file to replace the hostname with your name. This is just to make running the playbooks easier.
  7. Edit the vars.yml file.
  8. Note that I have assumed your cert files are named yourhost.tld.pem and yourhost.tld.key, which they might not be. Edit host-setup.yml if not.
  9. Run ansible-playbook -i inventory host-setup.yml. You should now have a host with all required dependencies installed.
  10. you might get ruby 2.3.3 instead of 2.3.1 in which case you should just edit the Gemfile.
  11. Open up templates/env.production. Edit. Set up any implied required external services, like S3 buckets & a mailer. This will take you a bit. Have the Mastodon production readme up while you do this.
  12. NOTE that you need to replace mastodon with ubuntu in the postgres setup. This still needs to be done by hand. (Sorry!)
  13. Run ansible-playbook -i inventory mastodon.yml. This does initial checkout & db creation.
  14. Run ansible-playbook -i inventory services.yml. This sets up upstart services & the nginx config.

The ansible plays set up the required cron jobs for you. They also create a handy script scripts/checkout.sh to pull source, run migrations, and restart all services for updating.

BUGS

  • Postgres is still on the default volume! Argh.
  • No backups. Argh.
  • Need to write handlers so we stop/start only when the files change.
  • Should use rbenv to get ruby 2.3.1 instead of ruby 2.3.3.

LICENCE

ISC. Copy and edit at will!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].