# Project Notes ### Problem Statement :::warning You are a DevOps engineer at XYZ Ltd. Your company is working mostly on WordPress projects. A lot of development hours are lost to perform WordPress setup with all dependencies like PHP, MySQL, etc. The Company wants to automate it with the help of a configuration management tool so that they can follow a standard installation procedure for WordPress and its components whenever a new requirement or client comes in. The below mentioned components should be included: PHP Nginx/Apache Web Server MySQL WordPress ::: ### Steps to Perform: :::warning - Establish configuration management master connectivity with WordPress server - Validate connectivity from master to slave machine - Prepare IaC scripts to install WordPress and its dependent components - Execute scripts to perform installation of complete WordPress environment - Validate installation using the public IP of VM by accessing WordPress application ::: ### Steps to be performed for the Solution Document :::warning 1. Create 2 VMs - Controller node --> Ansible Controller (I-a-C) - Worker node --> Wordpress server 2. Install Ansible on controller 3. Configure Password-less authentication between Controller and Worker node 4. Configure Ansible inventory to talk to Worker node 5. Install required roles for - PHP - Apache / Nginx - MySQL - Wordpress 6. Write an Ansible Playbook to call the roles to install Wordpress and all of it's dependencies 7. Run the playbook 8. Access wordpress application via a web browser to validate ::: ````yaml= Step 1. Install relevant roles: ansible-galaxy install geerlingguy.mysql ansible-galaxy install geerlingguy.apache ansible-galaxy install geerlingguy.php ansible-galaxy install inmotionhosting.wordpress Step 2. Write a playbook to call the roles: vi wordpress.yaml --- ## Playbook to install and configure Wordpress using Ansible roles - hosts: nodes roles: - geerlingguy.apache - geerlingguy.mysql - geerlingguy.php - inmotionhosting.wordpress Step 3. Run the playbook: ansible-playbook wordpress.yaml Step 4. Validate: which php which apache2 which mysql ```` :bulb: ***Important Notes:*** - *You might have to check if all the above mentioned roles are available on Ansible Galaxy. If not, please search for the relevant roles and replace them appropriately.* - *By running the playbook, the roles will handle the installation and configuration of the necessary components for WordPress. Adjust the inventory file to match your server's details, such as the server's IP address and SSH username.* - *Please note that you may need to provide additional variables or configuration options depending on your specific setup.* ### References :::warning - https://docs.fuga.cloud/how-to-install-wordpress-using-ansible - https://github.com/MakarenaLabs/ansible-role-wordpress - https://www.happycoders.eu/devops/ansible-tutorial-setup-docker-mysql-wordpress/ :::