🏃 Deploy Code Server Runbook
This runbook provides step-by-step instructions to deploy or update 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️⃣ Set Version to Deploy
-
Open the Code Server releases page to identify the latest version: https://github.com/coder/code-server/releases
-
Edit the following file:
inventory/ansible/group_vars/code_server/main.yml -
Update the version variable:
code_server_version: 4.100.2
4️⃣ Commit Version Change
After updating the version, commit the change:
git add inventory/ansible/group_vars/code_server/main.yml
git commit -m "Update Code Server version to 4.100.2"
git push origin main
⚡ Important: Always commit version changes before deployment.
5️⃣ Deploy the Update
Run the Ansible playbook to deploy the new Code Server version:
ansible-playbook -i $INV -k playbooks/deploy_code_server.yml
⚡ Note: The
-koption will prompt for an SSH password if required.
6️⃣ Verify Update
Code Server is disabled by default when deployed. Enable Code Server by following the Enable Code Server runbook.
Verify the update completed successfully:
- Open a web browser and navigate to: https://code.refol.us/
- Click the ellipsis (⋯) menu.
- Select Help → About.
- Confirm the displayed version matches the version you deployed.
✅ 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.