Skip to content

Automate the deployment of a WordPress application using Ansible and Vagrant.

Notifications You must be signed in to change notification settings

AbderrahmaneOd/ansible-vagrant-wordpress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Project: WordPress Deployment

This Ansible project automates the deployment of a WordPress application using Vagrant. The project consists of three VMs:

  1. Ansible Controller: Responsible for managing and configuring the other VMs.
  2. MySQL Server: Database server for the WordPress application.
  3. WordPress: Web server hosting the WordPress application.

Requirements

Usage

  1. Clone the repository:

    git clone https://github.com/AbderrahmaneOd/ansible-vagrant-wordpress
    cd ansible-vagrant-wordpress
  2. Spin up the VMs using Vagrant:

    vagrant up
  3. Generate an SSH key pair on the Ansible Controller VM

    ssh-keygen

    Follow the prompts to generate the key pair. By default, the keys will be stored in the ~/.ssh/ directory. Then, copy the public key to the other VM.

     ssh vagrant@192.168.33.11
     ssh vagrant@192.168.33.10

    Note: Ensure that you can connect to both VMs without entering a password.

  4. Connect to the Ansible Controller VM:

    vagrant ssh ansible-controller
  5. Navigate to the Ansible project directory:

    cd /ansible
  6. Install requirements:

    ansible-galaxy install -r requirements.yml
    
  7. Run the Ansible playbook to configure the MySQL Server and deploy WordPress:

    ansible-playbook -i hosts wordpress.yml
  8. Access WordPress in your web browser:

Directory Structure

  • hosts: Ansible inventory file specifying VM details.
  • wordpress.yml: Main Ansible playbook orchestrating the deployment.
  • roles/: Ansible roles containing tasks for WordPress.
  • Vagrantfile: Vagrant configuration file for VM setup.

Author

  • Abderrahmane Ouaday

About

Automate the deployment of a WordPress application using Ansible and Vagrant.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages