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

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


Mentioned the wordpress role:

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

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


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

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

 wordpress_dir: /var/www
 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:


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

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: Logo

You are commenting using your 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 )

Connecting to %s

%d bloggers like this: