Ansible playbooks for managing Actlys staging and production servers.
This repository manages server infrastructure for Actlys using Ansible. It handles deployment and configuration of:
- Web servers (nginx, PHP)
- Backend services (MySQL, Redis)
- Supporting services (Xvfb, VNC)
Separate inventories for staging and production environments.
- Create and activate Python virtual environment:
python3 -m venv venv
source venv/bin/activate- Install Python dependencies:
pip install ansible- Install Ansible Galaxy requirements:
ansible-galaxy install -r requirements.yml- Set up vault password file (ask team for password):
echo "your-vault-password" > .vault_passRun make help to see all available commands.
Common commands:
# Staging
make stg-deploy # Deploy to staging
make stg-check # Dry-run staging changes
make stg-diff # Preview staging changes
make stg-webservers # Deploy staging webservers only
make stg-backends # Deploy staging backends only
# Production
make prod-deploy # Deploy to production
make prod-check # Dry-run production changes
make prod-diff # Preview production changes
make prod-webservers # Deploy production webservers only
make prod-backends # Deploy production backends onlyView encrypted passwords:
ansible-vault view inventories/stg/vars/secrets.yml
ansible-vault view inventories/prod/vars/secrets.ymlEdit encrypted passwords:
ansible-vault edit inventories/stg/vars/secrets.yml
ansible-vault edit inventories/prod/vars/secrets.ymlWhere are server IPs defined?
In inventories/{env}/hosts.ini
How do I add a new server? Add it to the appropriate hosts.ini file and group_vars.
What if deployment fails?
Check the error message, run with -vvv for verbose output, or use make {env}-check to preview changes.
How do I deploy only specific roles?
Use --tags flag: ansible-playbook -i inventories/stg/hosts.ini playbook-stg.yml --tags nginx