docs: rewrite README with structured overview and quick start guide

Replaces the minimal project description with a comprehensive README
including a component overview table, quick start instructions, common
Ansible operations, and links to detailed documentation. Aligns with
Red Panda Approval™ standards.
This commit is contained in:
2026-03-03 12:49:06 +00:00
parent c7be03a743
commit b4d60f2f38
219 changed files with 34586 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
# Django Configuration
SECRET_KEY={{ vault_mcp_switchboard_secret_key }}
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1,oberon.incus,{{ ansible_default_ipv4.address }}
# Database Configuration
DB_ENGINE=django.db.backends.postgresql
DB_NAME={{ mcp_switchboard_db_name }}
DB_USER={{ mcp_switchboard_db_user }}
DB_PASSWORD={{ mcp_switchboard_db_password }}
DB_HOST={{ mcp_switchboard_db_host }}
DB_PORT={{ mcp_switchboard_db_port }}
# Docker Configuration
DOCKER_HOST={{ mcp_switchboard_docker_host }}
# RabbitMQ Configuration
RABBITMQ_HOST={{ mcp_switchboard_rabbitmq_host }}
RABBITMQ_PORT={{ mcp_switchboard_rabbitmq_port }}
RABBITMQ_USER={{ mcp_switchboard_rabbitmq_user }}
RABBITMQ_PASSWORD={{ mcp_switchboard_rabbitmq_password }}
CELERY_BROKER_URL=amqp://{{ mcp_switchboard_rabbitmq_user }}:{{ mcp_switchboard_rabbitmq_password }}@{{ mcp_switchboard_rabbitmq_host }}:{{ mcp_switchboard_rabbitmq_port }}//
# Application Configuration
BIND_HOST=0.0.0.0
BIND_PORT={{ mcp_switchboard_port }}

View File

@@ -0,0 +1,105 @@
---
- name: Deploy MCP Switchboard
hosts: ubuntu
tasks:
- name: Check if host has mcp_switchboard service
ansible.builtin.set_fact:
has_mcp_switchboard_service: "{{'mcp_switchboard' in services}}"
- name: Skip hosts without mcp_switchboard service
ansible.builtin.meta: end_host
when: not has_mcp_switchboard_service
- name: Create mcp_switchboard user and group
become: true
ansible.builtin.group:
name: "{{mcp_switchboard_group}}"
state: present
- name: Create mcp_switchboard user
become: true
ansible.builtin.user:
name: "{{mcp_switchboard_user}}"
group: "{{mcp_switchboard_group}}"
home: "{{mcp_switchboard_directory}}"
shell: /bin/bash
system: true
create_home: false
- name: Add ansible_user to mcp_switchboard group
become: true
ansible.builtin.user:
name: "{{ansible_user}}"
groups: "{{mcp_switchboard_group}}"
append: true
- name: Add mcp_switchboard user to docker group
become: true
ansible.builtin.user:
name: "{{mcp_switchboard_group}}"
groups: docker
append: true
- name: Create required directories
become: true
ansible.builtin.file:
path: "{{mcp_switchboard_directory}}"
owner: "{{mcp_switchboard_user}}"
group: "{{mcp_switchboard_group}}"
state: directory
mode: '750'
- name: Transfer and unarchive git archive
become: true
ansible.builtin.unarchive:
src: "~/rel/mcp_switchboard_{{mcp_switchboard_rel}}.tar"
dest: "{{mcp_switchboard_directory}}"
owner: "{{mcp_switchboard_user}}"
group: "{{mcp_switchboard_group}}"
mode: '550'
- name: Install mcp_switchboard package in virtual environment
become: true
become_user: "{{mcp_switchboard_user}}"
vars:
ansible_common_remote_group: "{{mcp_switchboard_group}}"
allow_world_readable_tmpfiles: true
ansible.builtin.pip:
name: .
virtualenv: "{{mcp_switchboard_directory}}/.venv"
virtualenv_command: python3 -m venv
chdir: "{{mcp_switchboard_directory}}"
- name: Template .env file
become: true
ansible.builtin.template:
src: .env.j2
dest: "{{mcp_switchboard_directory}}/.env"
owner: "{{mcp_switchboard_user}}"
group: "{{mcp_switchboard_group}}"
mode: '550'
- name: Template systemd service file
become: true
ansible.builtin.template:
src: mcp_switchboard.service.j2
dest: /etc/systemd/system/mcp_switchboard.service
owner: root
group: root
mode: '644'
notify: restart mcp_switchboard
- name: Enable and start mcp_switchboard service
become: true
ansible.builtin.systemd:
name: mcp_switchboard
enabled: true
state: started
daemon_reload: true
handlers:
- name: restart mcp_switchboard
become: true
ansible.builtin.systemd:
name: mcp_switchboard
state: restarted

View File

@@ -0,0 +1,17 @@
[Unit]
Description=MCP Switchboard - Django Application
After=network.target postgresql.service rabbitmq-server.service
[Service]
Type=notify
User={{ mcp_switchboard_user }}
Group={{ mcp_switchboard_group }}
WorkingDirectory={{ mcp_switchboard_directory }}
Environment="PATH={{ mcp_switchboard_directory }}/.venv/bin:/usr/local/bin:/usr/bin:/bin"
EnvironmentFile={{ mcp_switchboard_directory }}/.env
ExecStart={{ mcp_switchboard_directory }}/.venv/bin/gunicorn mcp_switchboard.wsgi:application --bind {{ mcp_switchboard_bind_host | default('0.0.0.0') }}:{{ mcp_switchboard_port }} --workers 4 --timeout 120
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,29 @@
---
- name: Stage MCP Switchboard release tarball
hosts: localhost
gather_facts: false
vars:
mcp_switchboard_repo_dir: "{{repo_dir}}/mcp_switchboard"
archive_path: "{{rel_dir}}/mcp_switchboard_{{mcp_switchboard_rel}}.tar"
tasks:
- name: Ensure release directory exists
file:
path: "{{rel_dir}}"
state: directory
mode: '755'
- name: Fetch all remote branches and tags
ansible.builtin.command: git fetch --all
args:
chdir: "{{mcp_switchboard_repo_dir}}"
- name: Pull latest changes
ansible.builtin.command: git pull
args:
chdir: "{{mcp_switchboard_repo_dir}}"
- name: Create MCP Switchboard archive for specified release
ansible.builtin.command: git archive -o "{{archive_path}}" "{{mcp_switchboard_rel}}"
args:
chdir: "{{mcp_switchboard_repo_dir}}"