This role installs and configures a ripple-rest server. The user can modify the configuration parameters to more closely match their production environment. Any number of servers and environments (e.g., production, staging) can be added with separate configurations.
This role requires Ansible 1.4 or higher and requires Ubuntu (currently tested on Trusty64).
Configurations are defined at the role level and inventory level. For specifying configurations that are different across hosts or groups (e.g., production vs. staging) it is recommended to define these as group variables and reference them in the individual roles.
Default configurations for can be found in the group_vars/all/main.yml
.
These variables are available at the role level.
The tasks in this role are generic and required in any environment and platform.
NGINX is configured as a reverse-proxy in front of the ripple-rest node process.
NGINX is configured to terminate SSL connections and requires valid SSL certificates.
SSL settings can be found in group_vars/all/main.yml
.
# group_vars/all/main.yml
rest:
server:
listen: 443
server_name: "{{ rest.url_base }}"
ssl: "on"
ssl_certificate: "/etc/nginx/ssl/server.crt"
ssl_certificate_key: "/etc/nginx/ssl/server.key"
ssl_protocols: "TLSv1 TLSv1.1 TLSv1.2"
ssl_ciphers: "ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA"
SSL certificates should be purchased and managed on the server outside of Ansible.
NodeJS is installed using the Ansible role published by NodeSource
The Ripple-Rest role follows closely the configuration instructions for deployment in the Ripple developer portal. For understanding how the playbook specifies the Ripple-Rest version to deploy, see Running the Playbook.
When working with multiple environments, it is best practice to keep the inventory files separate. For managing dynamic inventory (e.g., AWS) see the Ansible documentation.
Provisioning and starting a server is simply:
$ ansible_playbook ripple-rest.yml -i staging.yml
where staging.yml
is a hosts file for the staging servers.
See group_vars/all/main.yml
for the default release version
By default, the ripple-rest.yml
playbook will update code on the server. To disable this, simply pass update=false
on the command-line.
$ ansible_playbook ripple-rest.yml -i staging.yml --extra-vars "update=false"
To specify a version to deploy, use the version
variable:
$ ansible_playbook ripple-rest.yml -i staging.yml --extra-vars "version=master"
The version can be the full 40-character SHA-1 hash, the literal string HEAD, a branch name, or a tag name for the ripple-rest repository. See http://docs.ansible.com/git_module.html#examples
Testing requires Vagrant and VirtualBox.
After installing these, just run vagrant up
from the root of this project.
$ vagrant up
See Vagrant-Ansible documentation for more configuration options.