🏃 Disable Code Server runbook
This runbook provides step-by-step instructions to stop and disable Code Server using Ansible.
1️⃣ Login to an Ansible Control Node
Start by logging into an Ansible control node and prepare the environment:
cd ~/ansible
source /opt/python_3.12/bin/activate
INV=inventory/ansible/inventory.ini
⚡ Important: Always begin on the control node so all commands run in the correct environment.
2️⃣ Pull the Latest Code
Ensure your local Ansible repository is up to date:
git pull origin main
⚡ Important: Pulling the latest code first prevents conflicts and ensures you’re working with the most recent configuration.
3️⃣ Run the Ansible Playbook
Run the Ansible playbook to stop and disable Code Server version:
ansible-playbook -i $INV -k playbooks/disable_code_server.yml
⚡ Note: The
-koption will prompt for an SSH password if required.
6️⃣ Verify Code Server is Disabled
Verify that Code Server is not available.
- Open a web browser and navigate to: https://code.refol.us/
- A 502 Bad Gateway should be what is shown.
✅ Notes
- Always pull and commit version changes before deploying.
- Ensure the inventory variable (
INV) points to the correct hosts. - If the deployment fails, review the Ansible output for errors before retrying.