Skip to content
Ashwin Date edited this page Dec 21, 2016 · 6 revisions

The repository contains a toolkit to automate various IT tasks. Each activity is defined in an ansible script. Following is a list of tools available

environment-setup.yml

Sets up the target environment with required development tools like Geany, GIT and a LAMP + LEMP stack.

The ansible script installs the following software

  • Google Chrome Browser
  • Geany Editor and Plugins
  • GIT
  • Composer, and also makes composer available globally i.e. you can simply type composer
  • Codeception
  • PhantomJS
  • Filezilla
  • Meld
  • Apache 2
  • NGINX
  • PHP 5.6 & 7.0
  • PHPCS & the Joomla standard

create-site.yml

Once the software is set up a virtual host needs to be created so that users can start using their localhost. To do this, run the create-site.yml ansible script. The script needs the following variables

  • site_server_name (The domain that needs to be used eg: ttpl55.local)
  • site_id (Alphanumeric only. No spaces or special chars. Usually same as which_host, unless you expect to create more than 1 host eg: in case of PHP 5.6 & 7.0)
  • php_install_version (The version of PHP to use for this host. Must be either 5.6 or 7.0)
  • site_ssl (Decides if the site needs to be set up with https support 0 = no ssl, 1 = ssl)
  • ssl_key_file_path (The SSL key path in case you want to use a pre-created key & cert)
  • ssl_cert_file_path (The SSL certificate path in case you want to use a pre-created key & cert)
  • ssl_selfsigned (Set this to 1 in case you wish to use a self-signed certificate)

Examples

Set up a PHP 5.6 virtualhost on ttpl55, with self signed SSL certificate so it loads on https://ttpl55.local/

ansible-playbook -i inventories/devs create-site.yml --extra-vars='{"which_host":"ttpl55", "site_server_name":"ttpl55.local", "site_id":"ttpl5556", "site_ssl": 1, "ssl_selfsigned": 1, "php_install_version":"5.6"}'

Set up a PHP 7.0 virtualhost on ttpl55, without SSL that loads on http://ttpl55-php7.local/

ansible-playbook -i inventories/devs create-site.yml --extra-vars='{"which_host":"ttpl55", "site_server_name":"ttpl55-php7.local", "site_id":"ttpl5570", "php_install_version":"7.0"}'

Note that both the above commands can be run for the same host, one after the other to set up 2 hosts running PHP 5.6 & PHP 7.0 on the same machine.

Clone this wiki locally