VAP (Vagrant Ansible Programming languages) is Ansible playbooks for website developer and programmer.
Ruby ApacheConf Shell
Permalink
Failed to load latest commit information.
command
config.sample
config
group_vars
hosts
roles
spec
.gitignore
LICENSE
Rakefile
Vagrantfile
readme.md
site.yml

readme.md

VAP (Vagrant Ansible Programming languages)

VAP (Vagrant Ansible Programming languages) is Ansible playbooks for website developer and programmer.

Features

1. OS Distribution Compatibility

VAP support CentOS, Debian and Ubuntu Boxes.

2. Build Server and Database environment

VAP will build server from Apache or nginx, and build database from MySQL, MariaDB or Percona MySQL.

Server nginx is a FastCGI configuration as a reverse proxy. And building a PHP execution environment from PHP-FPM (FastCGI Process Manager).

By default, the server and the databese is installed in the default settings. Also you can edit configuration files.

3. Build Programming environment

VAP will build a Programming languages that specifies the version.

4. Develop & Deploy Tools

You can install the develop tools or the deploy tools by usage. See Specification for list of installed tools.

Requirements

Usage

1. Install Virtualbox

Download the VirtualBox form www.virtualbox.org and install.

2. Install Vagrant

Download the Vagrant form www.vagrantup.com and install.

3. Install Vagrant plugin

Install the Vagrant plugin on the terminal as necessary.

vagrant plugin install vagrant-hostsupdater
vagrant plugin install vagrant-cachier
vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-serverspec

4. Download Ansible playbooks of VAP

Download a Vagrantfile and Ansible playbooks from the following link.

Download Zip format file

5. Launch a virtual environment

cd vap-x.x.x
vagrant up

If you don't have a Box at first, begins from the download of Box. After provisioning, you can launch a Programming environment.

6. Access to the website

Access to the website http://vap.local/, if the server is running.

Default configuration Variables

ID and password for the initial setting is as follows. Can be set in the provisioning configuration file.

Database

  • ROOT USER root
  • ROOT PASSWORD admin
  • HOST localhost

Customize Options

You can build a variety of environment that edit the configuration file of VAP.

There are two configuration files you can customize.

Run vagrant up or vagrant provision, after editing the configuration file.

Vagrant configuration file (Ruby)

Vagrant configuration file is Vagrantfile.

Vagrantfile will set the vagrant Box, private IP address, hostname and the document root.

If you launch multiple environments, change the name of the directory. you should rewrite vm_ip andvm_hostname. Note not to overlap with other environments.

You can accesse from a terminal in the same LAN to use the public network to Vagrant virtual environment. To use public networks, set IP address for bridged connection to public_ip. In that case, recommended that configure the same IP address to vm_hostname.

You can choose the ansible install mode, the default or the pip.

The default is to install Ansible from the operating system package manager, via yum or apt. The pip is to install Ansible from the Python package manager. In this case, you can install a specific version of Ansible.

## Vagrant Settings ##

vm_box                = 'bento/centos-7.2'
vm_ip                 = '192.168.59.63'
vm_box_version        = '>= 0'
vm_hostname           = 'vap.local'
vm_document_root      = '/var/www/html'

public_ip             = ''

vbguest_auto_update = false

ansible_install_mode  = :default    # :default|:pip
ansible_version       = 'latest'    # only :pip
  • vm_box (required) name of Vagrant Box (default: bento/centos-7.2)
  • vm_box_version (required) version of Vagrant Box (default: >= 0)
  • vm_ip (required) private IP address (default: 192.168.59.63)
  • vm_hostname (required) hostname (default: vap.local)
  • vm_document_root (required) document root path (default: /var/www/html)
    • auto create html directory and synchronized
  • public_ip IP address of bridged connection (default: ``)
  • vbguest_auto_update update VirtualBox Guest Additions (default: false / value: true | false)
  • ansible_install_mode (required) the way to install Ansible (default: :default / value: :default | :pip)
  • ansible_version version of Ansible to install (default: latest)

Provisioning configuration file (YAML)

Provisioning configuration file is group_vars/all.yml.

In YAML format, you can set server, database and Programming environment. And can enable the develop and deploy tools.

## Server & Database Settings ##

server             : 'none'   # none|apache|nginx
fastcgi            : 'none'   # none|php-fpm
database           : 'none'   # none|mysql|mariadb|percona

db_root_password   : 'admin'

## Programming languages Settings ##
# If the version is set to 0, the programming language does not install

ruby_version       : 2.3.1       # 2.3.1
python_version     : 3.5.1       # 3.5.1
php_version        : 7.0.7       # 7.0.7
perl_version       : 5.25.1      # 5.25.1
node_version       : 6.9.1       # 6.9.1
go_version         : 1.6.3       # 1.6.3
java_version       : 1.8         # 1.8
scala_version      : 2.11.8      # 2.11.8 (require java)

## Develop & Deploy Settings ##

ssl                : false   # true|false
phpmyadmin         : false   # true|false (require PHP and mysql)

## That's all, stop setting. Let's vagrant up!! ##

Server & Database Settings

  • server (required) name of web server (default: none / value: none | apache | nginx)
  • fastcgi name of fastCGI (default: none / value: none | php-fpm)
    • fastcgi is possible only server 'nginx'
  • database (required) name of databese (default: none / value: none | mysql | mariadb | percona)

Programming languages Settings

  • ruby_version version of Ruby (default: 2.3.1)
  • python_version version of Python (default: 3.5.1)
  • php_version version of PHP (default: 7.0.7)
  • perl_version version of Perl (default: 5.25.1)
  • node_version version of Node.js (default: 6.9.1)
  • go_version version of Go (default: 1.6.3)
  • java_version version of Java (default: 1.8)
  • scala_version version of Scala (default: 2.11.8) require Java

If the version is set to 0, the programming language does not installation

Develop & Deploy Settings

  • ssl activate ssl (default: false / value: true | false)
  • phpmyadmin activate phpMyAdmin (default: false / value: true | false)

Directory Layout

Directory structure of VAP is as follows.

This directory synchronize to the guest OS side /vagrant. html creates automatically and synchronize to vm_document_root.

Full Layout

  • command (stores shell script)
  • config (stores Custom Config)
  • config.sample (sample Custom Config)
  • group_vars (stores the provisioning configuration file of Ansible)
    • all.yml (provisioning configuration file)
  • hosts
    • local (inventory file)
  • html (synchronize to the Document Root. create automatically at vagrant up, if it does not exist.)
  • Rakefile (Rakefile of ServerSpec)
  • readme.md
  • roles (stores Ansible playbook of each role)
  • site.yml (Ansible playbook core file)
  • spec (stores ServerSpec spec file)
    • localhost
    • spec_helper.rb
  • Vagrantfile (Vagrant configuration file)

Minimum Layout

VAP will be built in the directory structure of the following minimum unit.

  • group_vars (stores the provisioning configuration file of Ansible)
    • all.yml (provisioning configuration file)
  • html (synchronize to the Document Root. create automatically at vagrant up, if it does not exist.)
  • roles (stores Ansible playbook of each role)
  • site.yml (Ansible playbook core file)
  • Vagrantfile (Vagrant configuration file)

Vagrant Boxs

VAP support CentOS, Debian and Ubuntu Boxes. Details are as follows:

  • CentOS 7
  • CentOS 6
  • Debian 8 jessie
  • Ubuntu 16.04 Xenial
  • Ubuntu 14.04 Trusty

Specification

Server (Selectable)

FastCGI (Selectable, Only nginx)

  • PHP-FPM (FastCGI Process Manager)

Database (Selectable)

Programming languages

Develop & Deploy Tools (Activatable)

Pre-installing

Helper command

  • after_provision.sh
  • before_provision.sh
  • phpenv.sh
  • plenv.sh
  • pyenv.sh
  • rbenv.sh

Helper command

VAP offers a useful scripts. Just run the script on a terminal. Multiple versions installation of Python, Ruby, PHP and Perl, you can switch the execution environment.

pyenv.sh

pyenv.sh will prepare the specified version of Python execution environment.

/vagrant/command/pyenv.sh 3.5.1

rbenv.sh

rbenv.sh will prepare the specified version of Ruby execution environment.

/vagrant/command/rbenv.sh 2.2.0
/vagrant/command/rbenv.sh mruby-1.1.0

phpenv.sh

phpenv.sh will prepare the specified version of PHP execution environment. You can install the specified version of PHP. Switching the PHP version. And then restart Apache or PHP-FPM by switching the server configuration environment.

/vagrant/command/phpenv.sh 5.6.21

plenv.sh

plenv.sh will prepare the specified version of Perl execution environment.

/vagrant/command/plenv.sh 5.19.11

Custom Config

You can edit the configuration files. When you add tuning configuration files in the directory config, tuning configuration files are placed at provisioning time.

As follows editable configuration files.

  • apache2.000-default.conf.j2
  • apache2.conf.j2
  • apache2.default-ssl.conf.j2
  • apache2.envvars.j2
  • default-node-packages.j2
  • default-ruby-gems.j2
  • httpd.conf.centos6.j2
  • httpd.conf.centos7.j2
  • httpd.www.conf.centos7.j2
  • my.cnf.j2
  • nginx.conf.j2
  • nginx.www.conf.j2
  • php-build.default_configure_options.j2

Contribute

Small patches and bug reports can be submitted a issue tracker in Github. Forking on Github is another good way. You can send a pull request.

If you would like to contribute, here are some notes and guidlines.

  • All development happens on the develop branch, so it is always the most up-to-date
  • The master branch only contains tagged releases
  • If you are going to be submitting a pull request, please submit your pull request to the develop branch
  • See about forking and pull requests

Changelog

  • version 0.2.0 - 2017.01.26
    • fix openssl, add vap.crt and server.crt
    • support Debian and Ubuntu
    • add develop-tools
  • version 0.1.3 - 2016.10.15
    • fix tests
    • fix the inline script to get the major version number
    • fix sudo user
    • fix shebang
  • version 0.1.2 - 2016.09.10
    • fix node version
    • add jenv and scalaenv
    • add Java (OpenJDK)
    • add prestissimo
    • add custom php.conf.j2 and php-build.default_configure_options.j2
    • fix file name
  • version 0.1.1 - 2016.08.09
    • rename to default-node-packages.j2 from default_node_packages.j2
    • add synced_folder /vagrant
    • add vagrant-vbguest plugin
    • fix mariadb yum repository
    • fix rbenv, plenv, pyenv and phpenv
    • add nodenv and goenv
    • remove RepoForge repository
    • change to package module from yum module
  • version 0.1.0 - 2016.06.22
    • initial release

License

VAP is distributed under GPLv3.

Copyright (c) 2017 thingsym