Installing the WordPress on Ubuntu using Ansible

In this post,we’ll learn that how we can install the WordPress on Ubuntu 14.04 LTS using Ansible. If you don’t know about Ansible, please check this link.

If you want manual step by step procedure to install the WordPress on Ubuntu, please refer this post.

Note: This role depends on LEMP Stack role, it will automatically install the LEMP Stack before installing the WordPress.

First, download this Repository from the GitHub:

git clone https://github.com/arbabnazar/ansible-roles.git

Note: If git is not installed then you can simply download the zip file.

To use this role, edit the site.yml file:

vi site.yml

1

Mentioned the wordpress role:

---
 - hosts: server
   sudo: True
   gather_facts: True
   roles:
    - wordpress

2
After that, edit the hosts file and enter the ip of your remote server, on which you want to perform all these tasks:

vi hosts

In my case, it is 192.168.33.10:

[server]
192.168.33.10

After that edit the wordpress/vars/main.yml file:

Change these values as per your requirement. These are self explanatory.

---
 website_name: rbgeek.com
 wordpress_dir: /var/www
 wordpress_url: http://wordpress.org/latest.tar.gz
 wordpress_user: rbgeek_user
 wordpress_passwd: wordpress_password
 wordpress_db: rbgeek_database

Then run this command:

ansible-playbook -i hosts -u arbab site.yml

3Note: Please don’t forget to change arbab with your username

After successful completion of these tasks, it will show you the summary, something like this:

4

Navigate to the site in web browser using the IP address or fqdn, and verify that the wordpress is installed successfully:

http://rbgeek.com

5Enjoy :-)

Hope this will help you!

Please Remember me in your prayers!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: