Got Ideas from here An Ansible Tutorial

Just wrapped up setting up two RedHat servers (version 7) and one CentOS Virtual box so I could deploy a Laravel site.

Code is here

Thanks to Ansible it was not as bad as it could have been.

I am not an ansible expert just getting into it as we need to do this more. What these scripts will do is

  • Setup a CentOS Vagrant box
  • Setup a Server for Laravel and Queues SupervisorD
  • Setup up SSHD to be key based only you can remove this
  • Setup Cron to run scheduler
  • Setup SSL if you make the keys for this
  • Redirect to https for site

Local VM

Step one is to install Ansible on your Mac and then vim /etc/ansible/hosts

In there I have




Local is the VM

I needed a local VM to run CentOS since I did not have RedHat but it is close enough. I downloaded the ISO installed it the old fashion way on VirtualBox then I ran my ansible scripts against it. You can see this line in the

ansible-playbook --limit local -s centos.yml -u centos -k --ask-sudo-pass --extra-vars "user=centos"

Now that that is set I can hit it with my nginx config

ansible-playbook --limit local -s nginx.yml -u centos --extra-vars "user=centos version=centos"

Okay now it should work?


As I note in the I then setup the RedHat servers. They where a bit tougher but it all worked out. Note SELinux might be on that is why I have some lines to allow things but they may not be enough for your setup.