You'll need to have the following prerequisites installed on your workstation:
- VirtualBox
- Vagrant
- Ansible
- Add an appropriate vagrant box (optional)
vagrant box add bento/ubuntu-16.04
$ git clone [email protected]:Mayccoll/Vagrant-Ansible-Wordpress.git
$ cd Vagrant-Ansible-Wordpress
$ vagrant up
DONE!!!
Once the process is finished you will see the installation data in your terminal
In your browser go to http://192.168.70.70 and follow the installation process.
Optional: you can add the next rule to your host file and go to http://mywordpress.local
192.168.70.70 mywordpress.local
use this command line to add the rule:
$ echo "\n192.168.70.70 mywordpress.local" | sudo tee -a /etc/hosts
Inside your repository in ./www/wordpress/
folder you will find all the wordpress files
.
├── ansible
├── config.yaml
├── README
├── share
├── Vagrantfile
└── www
└── wordpress
├── index.php
├── license.txt
├── readme.html
├── wp-activate.php
├── wp-admin
├── wp-blog-header.php
├── wp-comments-post.php
├── wp-config-sample.php
├── wp-content
├── wp-cron.php
├── wp-includes
├── wp-links-opml.php
├── wp-load.php
├── wp-login.php
├── wp-mail.php
├── wp-settings.php
├── wp-signup.php
├── wp-trackback.php
└── xmlrpc.php
There are one configuration file CONFIG.yml
.
.
└── CONFIG.yml
./CONFIG.yaml
- name : vag-wordpress
box : bento/ubuntu-16.04
box_version : 2.2.9
box_check_update : false
ram : 1028
cpus : 1
./CONFIG.yaml
ports :
- guest : 3000
host : 3000
- guest : 80
host : 8080
./CONFIG.yaml
syncDir :
- host : share
guest : /home/vagrant/share
- host : www
guest : /home/vagrant/www
owner : vagrant
group : vagrant
dmode : 775
fmode : 775
This playbook will install all the dependencies for wordpress.
It can be found in:
./ansible/playbook.yaml
You can config wordpress database, user and password in CONFIG.yml
./CONFIG.yml
---
# | ······ Set Domain URL
wpDomain : 'mywordpress.local'
# | ······ MySQL Config
mysqlUser : 'root'
mysqlPass : 'vagrant'
mysqlTemplatePath : 'templates/my.cnf'
# | ······ MySQL Database
dbName : 'wordpress'
dbUser : 'wordpress'
dbPass : 'vagrant'
# | ······ Wordpress Config
wordpressPath : '/home/vagrant/www'
wordpressTemPath : 'templates/wp-config.php'
vhostTemplatePath : 'templates/vhost.conf'
# | ······ Vagrant User and Group
home : '/home/vagrant'
owner : 'vagrant'
group : 'vagrant'
- Username: wordpress
- Password: vagrant
Local folder: ./html