Semaphore ist plattformübergreifend verfügbar und unterstützt:
Semaphore erfordert eine relationale Datenbank zur Persistierung:
Empfehlung: PostgreSQL für Produktionsumgebungen aufgrund besserer Performance und Stabilität.
# Download der aktuellen Version
wget https://github.com/ansible-semaphore/semaphore/releases/latest/download/semaphore_linux_amd64
# Ausführbar machen und verschieben
chmod +x semaphore_linux_amd64
sudo mv semaphore_linux_amd64 /usr/local/bin/semaphore
# Verify installation
semaphore versionversion: '3'
services:
semaphore:
image: semaphoreui/semaphore:latest
ports:
- "3000:3000"
environment:
SEMAPHORE_DB_DIALECT: postgres
SEMAPHORE_DB_HOST: postgres
SEMAPHORE_DB_PORT: 5432
SEMAPHORE_DB_USER: semaphore
SEMAPHORE_DB_PASS: semaphore_password
SEMAPHORE_DB_NAME: semaphore
SEMAPHORE_ADMIN_PASSWORD: admin_password
SEMAPHORE_ADMIN_NAME: admin
SEMAPHORE_ADMIN_EMAIL: admin@example.com
depends_on:
- postgres
volumes:
- ./semaphore:/etc/semaphore
postgres:
image: postgres:13
environment:
POSTGRES_USER: semaphore
POSTGRES_PASSWORD: semaphore_password
POSTGRES_DB: semaphore
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:# Helm Repository hinzufügen
helm repo add semaphore https://ansible-semaphore.github.io/semaphore
# Chart installieren
helm install semaphore semaphore/semaphore \
--set config.database.dialect=postgres \
--set config.database.host=postgres-service \
--set config.admin.name=admin \
--set config.admin.email=admin@example.com| Kriterium | Binary | Docker | Kubernetes |
|---|---|---|---|
| Einfachheit | Hoch | Mittel | Niedrig |
| Skalierbarkeit | Niedrig | Mittel | Hoch |
| Wartungsaufwand | Hoch | Mittel | Niedrig |
| Isolation | Niedrig | Hoch | Sehr hoch |
| Performance | Sehr hoch | Hoch | Mittel |
-- Datenbank und Benutzer erstellen
CREATE DATABASE semaphore;
CREATE USER semaphore WITH PASSWORD 'secure_password';
GRANT ALL PRIVILEGES ON DATABASE semaphore TO semaphore;
-- Verbindung testen
\c semaphore semaphore-- Datenbank und Benutzer erstellen
CREATE DATABASE semaphore CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'semaphore'@'%' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON semaphore.* TO 'semaphore'@'%';
FLUSH PRIVILEGES;/etc/semaphore/
├── config.json # Hauptkonfiguration
├── credentials/ # Credential-Dateien
└── repositories/ # Git-Repository-Cache
{
"port": ":3000",
"host": "0.0.0.0",
"web_host": "https://semaphore.example.com",
"cookie_hash": "generate-32-character-random-string",
"cookie_encryption": "generate-32-character-random-string",
"access_key_encryption": "generate-32-character-random-string",
"db_dialect": "postgres",
"db_host": "localhost:5432",
"db_user": "semaphore",
"db_pass": "secure_password",
"db_name": "semaphore",
"email_sender": "semaphore@example.com",
"email_host": "smtp.example.com",
"email_port": "587",
"ldap_enable": false,
"ssh_config_path": "/etc/semaphore/ssh_config",
"telegram_chat": "",
"telegram_token": "",
"slack_url": "",
"max_parallel_tasks": 10
}# Initiales Setup starten
semaphore setup
# Folgende Eingaben werden abgefragt:
# - Database dialect (postgres/mysql)
# - Database connection details
# - Admin user credentials
# - Playbook path
# - Web host URL# Umgebungsvariablen setzen
export SEMAPHORE_DB_DIALECT=postgres
export SEMAPHORE_DB_HOST=localhost:5432
export SEMAPHORE_DB_USER=semaphore
export SEMAPHORE_DB_PASS=secure_password
export SEMAPHORE_DB_NAME=semaphore
export SEMAPHORE_ADMIN_PASSWORD=admin_password
export SEMAPHORE_ADMIN_NAME=admin
export SEMAPHORE_ADMIN_EMAIL=admin@example.com
# Setup ausführen
semaphore setup --non-interactive# /etc/systemd/system/semaphore.service
[Unit]
Description=Semaphore Ansible Web UI
After=network.target
[Service]
Type=simple
User=semaphore
Group=semaphore
WorkingDirectory=/opt/semaphore
ExecStart=/usr/local/bin/semaphore service --config /etc/semaphore/config.json
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target# Service aktivieren und starten
sudo systemctl enable semaphore
sudo systemctl start semaphore
# Status überprüfen
sudo systemctl status semaphore
# Logs anzeigen
sudo journalctl -u semaphore -f# Browser öffnen
http://localhost:3000
# Login mit Admin-Credentials
# Username: admin (oder konfigurierter Name)
# Password: admin_password (oder konfiguriertes Passwort){
"email_alert": true,
"email_sender": "semaphore@example.com",
"password_login_disable": false,
"non_admin_can_create_project": false
}{
"ldap_enable": true,
"ldap_host": "ldap.example.com:389",
"ldap_bind_dn": "CN=semaphore,OU=ServiceAccounts,DC=example,DC=com",
"ldap_bind_password": "service_password",
"ldap_search_dn": "OU=Users,DC=example,DC=com",
"ldap_search_filter": "(&(objectClass=user)(memberOf=CN=Semaphore-Users,OU=Groups,DC=example,DC=com))",
"ldap_mapping_username": "sAMAccountName",
"ldap_mapping_fullname": "displayName",
"ldap_mapping_email": "mail"
}{
"git_hub_oauth": {
"enabled": true,
"client_id": "github_client_id",
"client_secret": "github_client_secret",
"redirect_url": "https://semaphore.example.com/auth/github/callback"
}
}| Methode | Komplexität | Sicherheit | Integration | Wartung |
|---|---|---|---|---|
| Lokal | Niedrig | Mittel | Keine | Hoch |
| LDAP | Mittel | Hoch | Gut | Mittel |
| OAuth/OIDC | Mittel | Hoch | Sehr gut | Niedrig |