fabiel-leon / base

algarete site ansible base role

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Base Ansible Role

Build Status Ansible Galaxy

This is a basic Ansible role that installs some common development tools and system configurations for doing full stack web development. It installs or sets up:

  • Some common BASH profile tweaks
  • Ruby
  • Node.js
  • Yarn
  • Git
  • Vim
  • SASS
  • Bower
  • Grunt
  • Gulp
  • A swap file
  • Sysctl settings
  • The default timezone
  • APT unattended upgrades

Role Variables

The role is designed to create a basic development environment out of the box, however there are some additional variables that can be set as required:

  • env_name — Whether the server is going to be used for "development" or "production" or other. Default is "dev".
  • timezone — What timezone the server is in. Default is "Etc/UTC".
  • console_user — If you are setting up a new user for your server, you can use this value to install the BASH profile for that user. Default is ansible_user
  • swap_mb — Size of swap file to create. Default is 0 (ie, no swap).
  • swap_path— Location to store the swap file. Default is "/swap".
  • shmmax_percent — Percentage of available memory to use for kernel.shmmax. Default is "50".
  • shmall_percent — Percentage of available memory to use for kernel.shmall. Default is "50".
  • default_groups — Groups to add the Ansible user or console_user to. Values are "web-admin" and "www-data".

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: servers
  roles:
     - { role: bbatsche.Base }

License

MIT

Testing

Included with this role is a set of specs for testing each task individually or as a whole. To run these tests you will first need to have Vagrant and VirtualBox installed. The spec files are written using Serverspec so you will need Ruby and Bundler.

To run the full suite of specs:

$ gem install bundler
$ bundle install
$ rake

The spec suite will target both Ubuntu Trusty Tahr (14.04) and Xenial Xerus (16.04).

To see the available rake tasks (and specs):

$ rake -T

These specs are not meant to test for idempotence. They are meant to check that the specified tasks perform their expected steps. Idempotency is tested independently via integration testing.

About

algarete site ansible base role


Languages

Language:Ruby 68.0%Language:HTML 22.7%Language:Vim Script 8.9%Language:Perl 0.5%