feat: add Semaphore Sync job
All checks were successful
CI / test (pull_request) Successful in 15s
CI / build-dev (pull_request) Has been skipped

Fetches Semaphore project inventory via Bearer auth, parses the
Ansible INI format to extract hostnames, and sets semaphore=1/0
on matching instances.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-28 19:34:45 -04:00
parent 0b350f3b28
commit a934db1a14
4 changed files with 65 additions and 6 deletions

View File

@@ -483,17 +483,20 @@ function _renderJobConfigFields(key, cfg) {
<input class="form-input" id="job-cfg-api-key" type="password"
placeholder="tskey-api-…" value="${esc(cfg.api_key ?? '')}">
</div>`;
if (key === 'patchmon_sync') return `
if (key === 'patchmon_sync' || key === 'semaphore_sync') {
const label = key === 'semaphore_sync' ? 'API Token (Bearer)' : 'API Token (Basic)';
return `
<div class="form-group">
<label class="form-label" for="job-cfg-api-url">API URL</label>
<input class="form-input" id="job-cfg-api-url" type="text"
placeholder="http://patchmon:3000/api/v1/api/hosts" value="${esc(cfg.api_url ?? '')}">
value="${esc(cfg.api_url ?? '')}">
</div>
<div class="form-group">
<label class="form-label" for="job-cfg-api-token">API Token (Basic)</label>
<label class="form-label" for="job-cfg-api-token">${label}</label>
<input class="form-input" id="job-cfg-api-token" type="password"
placeholder="Basic token…" value="${esc(cfg.api_token ?? '')}">
value="${esc(cfg.api_token ?? '')}">
</div>`;
}
return '';
}