ansible

Deploying a Simple Rails App with Ansible

Ruby on Rails is quickly becoming my framework of choice for my personal websites and projects. It's a pleasure to work with and has been easy to learn. But no framework is without its challenges. One of those challenges is of course deploying the app to a server. There are a lot of options for hosting and deploying a Rails app. But, I like to run my own servers which means I have to also take care of deploying to those servers.

Continue reading →

How to Run Rails App Server with Systemd and Ansible

Create a systemd service to run your rails app server. Ansible tasks to create the service: --- …snip… vars: rails_root: “/myapp” rails_user: “webuser” tasks: - name: Setup Rails Web Service template: dest: /usr/lib/systemd/system/rails-web.service src: templates/rails-web.systemd.j2 - name: Enable Rails Web Service systemd: name: rails-web daemon_reload: yes enabled: yes masked: no The ansible template "rails-web.systemd.j2": [Unit] Description=Rails Web [Service] Type=simple SyslogIdentifier=rails-web User={{ rails_user }} PIDFile={{ rails_root }}/tmp/pids/web.pid WorkingDirectory={{ rails_root }} ExecStart=/bin/bash -l -c “{{ rails_root }}/bin/rails s -b 0.

Continue reading →