Before you begin, ensure you have the following installed:
-
Ansible:
- Version: core 2.16.1
- Python version: 3.10.12
- Jinja version: 3.0.3
- pip install passlib
-
Vagrant:
- Version: 2.3.7
-
Install Vagrant: If Vagrant is not already installed, download and install it from Vagrant's official website.
-
Configure Network with Custom CIDR: To set a specific CIDR range, configure the network in the /etc/vbox/networks.conf
-
Launch Vagrant Box: Run the following command to start and provision the Vagrant box:
git clone [email protected]:adamsipo/xitee.git cd xitee/ vagrant up
-
Accessing the Vagrant Box: Once the box is up and running, you can access it with:
vagrant ssh
This Ansible playbook is designed to automate the installation of Docker and WordPress on AlmaLinux 8 (version 8.8.20230606). It also includes functionality for creating backups of the WordPress instance.
- Docker Installation: Installs and configures Docker on AlmaLinux 8.
- WordPress Deployment: Deploys WordPress within a Docker container.
- Backup Creation: Automates the creation of backups for WordPress.
- Ansible environment set up on the control machine.
- Target servers running AlmaLinux 8.
Define the target server(s) in the Ansible inventory. Specify the IP address and necessary SSH details for each server. Example inventory setup:
all:
children:
servers:
vars:
firewall_services:
- http
- ssh
user_name: xitest
ssh_public_keys:
- "ssh-ed25519 AAAA... marek@GUADALAJARA-WSL"
- "ssh-ed25519 AAAA...tkuba"
hosts:
192.168.100.23:
ansible_user: vagrant
ansible_ssh_private_key_file: ~/.ssh/id_rsa
ansible_ssh_common_args: "-o StrictHostKeyChecking=no"
To execute the playbook:
- Navigate to the playbook directory.
- Secrets are stored in the
secrets.yaml
file. - The password for decrypting the secrets file is "password".
- When running the playbook, use the following command to provide the vault password:
git clone [email protected]:adamsipo/xitee.git ansible-playbook xitee/ansible/xitee_homework.yaml -i xitee/ansible/inventory/inventory.yaml --ask-vault-pass
Once the playbook execution is complete, WordPress will be accessible via the IP address of the virtual machine (e.g., http://192.168.100.23
).
- The playbook includes tasks for setting up automatic backups of the WordPress database.
- Backups are stored in a specified directory within the virtual machine.