Hi Everyone. I am a complete noob to this so please be patient with me.
I’m trying to learn Devops and my mentor asked me to research and attempt to get a vagrant machine online with a LEMP stack using only ansible to configure the machine. I am completely confused where to start with this.
I’ve read that you shouldn’t install anything to your host machine (my laptop) and to work in a virtual environment. No problem. I’ve downloaded and installed Virtualbox to my laptop.
Now what do i do?
I"m assuming i should install a linux distribution (centos,ubuntu) on my VB and use that as my management machine?
from there i should install Ansible on my management machine and install Vagrant.
I am completely in the dark on how now i use ansible / Vagrant. I am currently reading: Ansible: From Beginner to Pro (2016) and it’s not telling me exactly how i should have my test environment set up.
Can someone please help to get me started first with my setup. Then I can possibly ask/search for answers on how to use Ansible/Vagrant
Good morning Pangaea,
Installing Virtualbox is the first step towards working with Ansible and Vagrant. In addition to installing Virtualbox, you’ll also need to install Vagrant from http://vagrantup.com/
From this point onwards, you won’t interact with Virtualbox directly at all. Instead, you’ll create and manage virtual machines with Vagrant.
Once Vagrant is installed, run “vagrant init ubuntu/xenial64; vagrant up --provider virtualbox”. This will initialise and run an Ubuntu based virtual machine for you. If you don’t already have the image downloaded, it will also download it to your machine (so it could take a while!)
After those commands have completed, you should be able to run “vagrant ssh” to log in to the virtual machine.
At this point, you will have Vagrant and Virtualbox installed and working, and should be able to continue working along with your book
Cheers, Michael
Have a look at some of our Ansible roles (e.g. php-cli-ondrej). All of them have a Vagrantfile for testing purposes. This should give you an idea of how to put everything together.
Regards, Mischa
Also here’s an example of a playbook (using multiple roles) we use for our production wordpress environment:
---
- hosts: tiers-production-wordpress
roles:
- limits
- percona-client
- percona-server
- percona-toolkit
- common-schema
- innotop
- mydumper
- mydumper-backup
- duplicity
- duply
- duply-backup
- apache-mod-php-56
- php-cli-ondrej
- composer
- memcached
- netcat
- haproxy
- adminer
- zend-opcache-dashboards
- phpmemcachedadmin
- wordpress
- mainwp-crons