bbatsche.Ruby

Ansible Ruby Site Role

Build Status License Role Name Release Version Downloads

This role helps you install Rbenv and a specific version of Ruby. It also sets up an Nginx site to run Ruby using Phusion Passenger.

Requirements

To install Rbenv, you need to have Git on your server. Hopefully, you've already done that!

This role uses Linux filesystem ACLs and a group called "web-admin" to manage access to certain directories. You can either set this up manually or use the bbatsche.Base role.

Role Variables

  • domain — Domain name for the site.
  • ruby_version — Version of Ruby to install (default is "2.3.1").
  • rbenv_version — Version of Rbenv to install (default is "v1.0.0").
  • ruby_build_version — Version of the ruby-build plugin (default is "v20160426").
  • default_gems_version — Version of the default-gems plugin (default is a Git SHA: "4f68eae").
  • rbenv_vars_version — Version of the rbenv-vars plugin (default is "v1.2.0").
  • binstubs_version — Version of the binstubs plugin (default is "v1.4").
  • copy_configru — Choose whether to copy a basic config.ru file to the site for testing (default is no).
  • http_root — Directory where all site directories will be created (default is "/srv/http").
  • rbenv_root — Directory for installing Rbenv and its files (default is "/usr/local/rbenv").

Dependencies

This role requires bbatsche.Nginx, so install that role first using:

ansible-galaxy install bbatsche.Nginx

Example Playbook

- hosts: servers
  roles:
     - { role: bbatsche.Ruby, domain: my-node-site.dev }

License

MIT

Testing

This role includes tests for each task. To run these tests, you'll need to have Vagrant and VirtualBox set up. The test files use Serverspec, so you'll also need Ruby and Bundler.

To run all tests:

$ gem install bundler
$ bundle install
$ rake

The tests will cover Ubuntu Trusty (14.04), Xenial (16.04), and Bionic (18.04).

To see available rake tasks (and tests):

$ rake -T

These tests are not meant to check if tasks can be run multiple times without issues (idempotence). They will make sure that each task works as expected. Idempotency is tested separately through integration testing.

Informazioni sul progetto

Install Rbenv, Ruby, and create an Nginx site running it through Phusion Passenger

Installa
ansible-galaxy install bbatsche.Ruby
Licenza
mit
Download
138
Proprietario