Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

A Vagrant managed Centos 7 VM running OsTicket for development using Ansible for provisioning

Hello All,

Over the last few months, I have created my own development environment for OsTicket which I would like to share with everyone. I have found it very useful for learning OsTicket and for when testing out plugins and/or code modifications. Everything is on my GitHub here:


I also used this as an opportunity to learn a number of different technologies, here are the main ones:

Vagrant: This software automates the provisioning and building of a Virtualbox VM. I use it to create a VM on my laptop for example which is then completely standalone. The idea is to replicate production, however, then add in other features such as email catching with Mailhog. Vagrant managed VMs can be created and destroyed quickly, allowing for easy testing of something and then resetting back to a known good state. Sometimes I will have this set with a basically empty database and completely stock code, at other times it will have a copy of the production database along with many plugins and code changes.

Ansible: I've used Ansible for the provisioning of the VM as it allows for being run multiple times and the script produced is easy to read and maintain. Another nice feature is I was able to package the main script as a "role" and then reuse this role when building a provisioning setup for production. Templates and variables allow for the different systems to have different passwords and setups etc. I have also used Ansible for all of the "helper" scripts. These do things like importing a database, apply GitHub PRs, and stopping email collection. You may just want to read and understand the Ansible side of things as you install OsTicket yourself so you can see how I have done things in a Centos 7 environment.

There are hopefully enough details on the Readme to use this without too much extra explanation. Perhaps take care to ensure Virtualbox, Vagrant, and Ansible are all installed with fairly new and up to date versions of each.

One important part of this is the workflow for when setting up a blank new database or importing an already existing database.  If it is a new setup, there is a helper script to run after to remove the setup folder and complete the installation. If importing an already existing database this needs to exist as a specific filename and there is no need to run the remove setup helper script afterwards.

There are 8-9 plugins which will be installed, if you are using a blank new database you will need to configure these plugins to use them. If you are importing an already existing database then having these plugins already available should help for keeping these active also in this dev environment.

There is an optional helper script called something like "modify_source" which has taken a while to develop and some care needs to be taken with its use. It applies a large collection of PRs (50+) from the official OsTIcket GitHub which I feel are useful or important enough to include. Please note some of these PRs are not approved code modifications by the OsTicket developers. There are code modifications from my own OsTicket fork also which are very likely that most people will not want to apply so please review this helper script carefully before using.

Just as a disclaimer this isn't an official OsTicket setup, I'll be happy to try to answer and reply to issues raised on my GitHub, however, only as I have time and the knowledge to do so. I'm fairly "time poor" in general! OsTicket devs and staff on the official Github and forums here will generally not be able to assist with anything relating to the environment setup and in particular, may need you to revert to testing with stock code and zero modifications before they can help.

That being said, I'm hopeful I can maintain this project for a little while, particularly whilst I look after an OsTicket instance in production. I need this working for myself. If/when I have time, I'll look at adding a Docker based setup also as I've been using Docker recently and would like to learn it further.

If anyone has any suggestions, improvements, feedback, criticism etc I am happy to discuss or further explain any parts of this if anyone wants.

Cheers.

Perry

Comments

Sign In or Register to comment.