1.4 KiB
1.4 KiB
Ansible Deployment for Kekbot
This directory contains Ansible configuration for deploying the Discord bot to a server.
Prerequisites
-
Ansible must be installed on your local machine. Install it with:
# On macOS brew install ansible # On Ubuntu/Debian sudo apt-get install ansible -
Make sure your
.envfile contains all necessary Discord bot tokens and configuration.
Files
-
playbook.yml: Contains all the deployment tasks including:- Installing Node.js and npm
- Setting up the application directory
- Installing dependencies
- Creating and managing a systemd service
- Deploying Discord bot commands
-
inventory.ini: Contains the server connection details
Deployment
To deploy the bot, run:
ansible-playbook -i inventory.ini playbook.yml
Service Management
After deployment, you can manage the bot service on the server using:
# Check status
sudo systemctl status kekbot
# Stop the bot
sudo systemctl stop kekbot
# Start the bot
sudo systemctl start kekbot
# View logs
sudo journalctl -u kekbot
Troubleshooting
-
If the deployment fails due to SSH connection issues:
- Verify that you can SSH into the server manually
- Check that the server details in
inventory.iniare correct
-
If the bot fails to start:
- Check the logs using
sudo journalctl -u kekbot - Verify that the
.envfile was properly copied and contains valid tokens
- Check the logs using