This is a DIY Cloud-Photobooth that is driven by Ansible Automation for Ingram Micro NZ Showcase 2019. Ansible Tower is used as the "remote control" and data entry via Tower Survey.
- Good enough IP Camera (1080p) that supports MJPEG Stream. Make sure this can be mounted on a tripod if you use a tripod
- A mini-PC/Desktop/Laptop for Ansible Tower Server with minimum 2 connections. One for camera, one for internet. An Intel NUC is recommended due to its small size, has WiFi built in and has another ethernet port.
- Cloud webserver and dbserver (can be all-in-one server as well)
- The Tower server can not be combined with the Cloud Web/DBServer
- USB printer that works with Linux if you are printing a flyer
- You will need to create a webserver and dbserver (can be separated or all-in-one) on a cloud provider of your choice
- Make sure Ansible Tower can connect to it (provide credentials, key, public IP access, etc)
- The compute size of your webserver/dbserver will depend on your requirement. On low traffic, 1 vCPU and 1GB of RAM is enough
- This github repo provides "very basic" example of the webserver framework using CodeIgniter. It is an MVC PHP web framework (https://www.codeigniter.com/user_guide/overview/mvc.htm). For details on how it works, visit codeigniter website
- Visitor enters details via Tower Survey: name, company, position, email, phone, etc
- Tower template job: run showcase-photobooth playbook
- Ansible task: create unique-ID for visitor
- Ansible task: replaces past photo result with a JPEG showing "GET READY" text
- Ansible task: calls VLC media player and playback countdown video
- Ansible task: waits for a few second (follows countdown length)
- Ansible task: plays camera shutter sound
- Ansible task: capture photo - a jpeg stream from MJPEG
- Ansible task: append captured jpeg with a banner for branding
- Ansible task: uploads original photo and appended photo (with banner) to cloud webserver
- Ansible task: create database entry on cloud dbserver using SQL template
- Ansible task: use firefox to generate flyer jpeg by using "screenshot" of flyer web page
- Ansible task: print flyer
- A mini-PC that meets Tower minimum requirements. Example: Core i5 with 8GB of RAM
- The PC will need 2 connections. One for the internet (software install and to cloud servers), one for the MJPEG stream from the camera
- CentOS 7 installation, with post-install updates (# yum udpate)
- Desktop GUI installation (root)# yum groupinstall "Server with GUI"
- Set-default target to graphical/GUI (root)# systemctl set-default graphical
- After reboot, Tower GUI will asks to create a normal user. So do this
- Install EPEL repo for ansible installation (root)# yum install epel-release (root)# yum install ansible
- Install Ansible Tower and provide your Tower license key Follow the steps here: https://docs.ansible.com/ansible-tower/latest/html/quickinstall/prepare.html
- Disable Tower Job Isolation (Settings - Jobs - Enable Job Isolation: Off)
- Run these playbooks from your Ansible control node (or locally on tower)
- photobooth_prepare.yml : installation of photobooth software components on Tower server
- webserver_deploy.yml : installation of webserver and its components
- webserver_update_page.yml : copying the websource directory to the webserver
- dbserver_deploy.yml : install mysql server
- dbserver_init_db.yml : create database and initial test entries
- Playbooks to run via Tower (with Template)
- photobooth.yml : the actual photobooth run. See yaml file for variables required
- dbserver_backup.yml : create database dump for backup
- dbserver_draw.yml : select a random winner from visitor entries
- Printer setup. Please make sure your USB printer is connected to the Tower server and driver is installed. Please visit the vendor's website for instruction on how to install the Linux driver.
- Make sure you provide the cloud account credentials to Tower
- Make sure Tower can connect to the cloud VMs. Whether you use static inventory or dynamic inventory is up to you
- Slideshow (with rotation with the last 5 photos): http://<your_ip_or_domain>/slideshow/0 You do this slideshow using another PC/laptop connected to a different monitor
- Visitor Leads (with download and flyer pages): http://<your_ip_or_domain>/leads
- Do below steps everytime your Tower server is booted up and you are preparing for the event.
- Make sure no firefox instance is present. Do ps -ef and kill those processes if they exist
- use GUI application menu, run single firefox and browse the MJPEG http stream. Example (on my Forticam IP Camera): http://192.168.4.245:8008
- Open chromium web browser, and browse https://localhost for Tower GUI
- Open vlc from menu (in preferences: make sure single instance, no resize, no OSD, minimum GUI)
- Using Files application, open /tmp/output_append.png (this is to show GET READY as well as most recent shot)
- The Tower PC needs to be connected to a monitor, and the GUI needs to show real-time MJPEG stream (as mirror) using firefox, VLC media player (for countdown), and an a JPEG viewer (for recent photo result). You will need to resize those application windows accordingly.
- Another laptop is connected to another monitor, and running the photobooth slideshow from the internet
- Please ensure we enable rewrite on Apache config <Directory "/var/www/html"> .... AllowOverride All
- Please put the timezone info on /etc/php.ini date.timezone = Pacific/Auckland