Git Product home page Git Product logo

roles's Introduction

Ansible roles for Rails production deployment

Tested on Ubuntu 18.04

hosts

[sampleapp]
1.1.1.1 domain=api.sample.com frontend_domain=sample.com
2.2.2.2 domain=api.staging.sample.com staging=yes frontend_domain=staging.sample.com
[all:vars]
ansible_ssh_user=root
ansible_python_interpreter=/usr/bin/python3

site.yml

---
- hosts: sampleapp
  vars_files:
    - ssh_keys.yml
  vars:
    ruby_version: 2.6
    postgresql_version: 11
    nodejs_version: 12.x
    app_name: sample_app
    hostname: "{{domain}}"
    deploy_user: "{{app_name}}"
    app_path: /home/{{deploy_user}}/{{app_name}}
    app_log_path: "{{app_path}}/log"
    database: "{{app_name}}"
    dbuser: "{{app_name}}"
    dbpass: password
    railsapp_webpack: on
    ssl: on
    rpush: on
    additional_packages:
      - imagemagick
    postgresql_extentions:
      - pg_trgm
      - fuzzystrmatch
    passenger_max_pool_size: 3
    passenger_max_requests: 1000
    frontend:
      user: react
      app_path: /home/react/{{app_name}}
      frontenders:
        - ssh-rsa AAAABxxx== developer_name
    revoke_ssh_keys: ["{{developers.developer_name}}"]
    remote_postgres_backup:
      minute: 21
      server: backup.host
      user: remote_backup
      password: xxx
  roles:
    - { role: common, tags: [ 'common' ] }
    - { role: motd, tags: [ 'motd' ] }
    - { role: nodejs, tags: [ 'nodejs' ] }
    - { role: railsapp, tags: [ 'railsapp' ] }
    - { role: sshkeys, tags: [ 'sshkeys' ] }
    - { role: ruby, tags: [ 'ruby' ] }
    - { role: postgresql, tags: [ 'postgresql' ] }
    - { role: passenger, tags: [ 'passenger' ] }
    - { role: logrotate, tags: [ 'logrotate' ] }
    - { role: ufw, tags: [ 'ufw' ] }
    - { role: yarn, tags: [ 'yarn' ] }
    - { role: remote-postgres-backup, tags: [ 'remote-postgres-backup' ] }
    - { role: redis-server, tags: [ 'redis-server' ] }
    - { role: certbot, tags: [ 'certbot' ] }
    - { role: sidekiq, tags: [ sidekiq ] }
    - { role: bash, tags: [ 'bash' ] }
    - { role: frontend, tags: [ 'frontend' ] }

roles's People

Contributors

nleo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.