Git Product home page Git Product logo

lobsters-ansible's Introduction

Lobste.rs Ansible Playbook

Ansible playbook for lobste.rs. Lobsters is a technology-focused link aggregation site.

See the notes below if you're using this to set up your own site.

To run:

$ ansible-playbook -K prod.yml

When working on staging:

$ ansible-playbook --inventory=inventories/staging.ini -K staging.yml

Inventory

The following host groups are available:

db              - SQL server
dns             - authoritative DNS
mx*             - incoming email
smtp*           - outgoing email
www*            - http over SSL

groups marked with an asterisk (*) use public SSL certificates.

The following variables are available:

db_server       - SQL server
dns_server      - authoritative DNS server
mx_server       - incoming mail server
smtp_server     - outgoing mail server
www_server      - http/s

When a host group has more than one hostname, the _server variable contains the authoritative name for the hosted sevice. This playbook tries not to distinguish between host variables and group variables.

https://docs.ansible.com/ansible/latest/intro_inventory.html

Roles

mariadb         - SQL database.
lobsters        - web application.
nginx           - http proxy and SSL termination.
sysadm          - accounts and ssh shell acess for system administrators.
postfix         - MX and smtp server.
lobsters-puma   - App server

https://docs.ansible.com/ansible/latest/playbooks.html https://docs.ansible.com/ansible/latest/playbooks_reuse_roles.html

SSH Keys

To use this playbook, you'll need an account in the sysadm role along with an SSH key pair.

Setup Notes

This is a rough checklist for turning a new Ubuntu LTS VPS into a running instance of Lobsters. If you're familiar with Linux sysadmin and Rails it should be pretty self-explanatory. You can drop by #lobsters on Freenode if you have questions.

  ssh root@now box
   apt-get update
   apt-get upgrade
   reboot # will almost certainly be a new kernel
   apt-get install certbot

 time ansible-playbook -K prod.yml # should get an error about connecting to database
 
 mysql -u root
   create database lobsters;
   select sha1(concat('mash keyboard', rand()));
   create user lobsters@'localhost' identified by "[hash]"; # may need to be @'%' for any host, an ip, etc
   grant all privileges on lobsters.* to 'lobsters'@'localhost'; # match host from prev

 create /srv/lobste.rs/http/config/database.yml
 create /srv/lobste.rs/http/config/initializers/production.rb
 create /srv/lobste.rs/http/config/secrets.yml

 bundle exec rails credentials:edit to create secret key base
 chown -R lobsters:lobsters /srv/lobste.rs/http/config
 echo "[email protected]" > /root/.forward
 run ansible again to deploy code + build assets
 reboot again # to see everything comes up properly automatically

lobsters-ansible's People

Contributors

alanpost avatar backtrace-ci-bot avatar bbuccianti avatar hmadison avatar jstoja avatar law avatar pushcx avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.