Run Playbooks from the Syncer UI
For users who don't want to SSH into the control node every time, the Syncer can dispatch the bundled playbooks (and any of your own that you register) directly from the web UI. Every invocation is captured with full log output so the history view doubles as an audit trail.
The relevant menu entries live under Modules → Ansible:
| Menu | Purpose |
|---|---|
| Run Playbook | Pick a playbook from the catalog and dispatch it. |
| Run History | Read-only audit of every UI / rule / CLI run, with the captured ansible-playbook log. |
Access requires the ansible permission on the user account — the same role that gates the rule editors.
Run Playbook page
Each playbook from the manifest shows up as a card with two optional inputs and two buttons:
| Field | Effect |
|---|---|
| Inventory Provider | The rule source feeding this run. Defaults to the playbook's manifest inventory: field; override to point at a different project without editing the manifest. |
| Limit | Maps to --limit — restrict the run to a host or group, e.g. webserver01 or windows. Empty means "all hosts in the inventory". |
| Extra Vars | Maps to -e. Free-form, e.g. cmk_install_agent=true cmk_main_site=main. |
| Preview | Runs ansible-playbook --check --diff. No changes are applied; the rendered diff lands in the run log so you can review it before clicking Run. |
| Run | Runs the playbook for real. |
After clicking, the page redirects to the freshly created run record. Status is Running while the daemon thread executes. While it runs, the page adds the new log lines every two seconds and updates status, end time and exit code in place, without reloading; the log only follows the output while it is scrolled to the bottom. The full stdout/stderr is rendered inline as a scrollable log block.
If the process running a playbook ends before the playbook does, for example by a restart of the Syncer, the run gets the status Aborted as soon as the Run History or the run itself is opened, with a note in its log. Its result is unknown. A run on another server of a cluster is only checked on that server.
Every run also writes to Settings → Log with source Ansible, also runs
of the cron and of the playbook rules:
- When it starts: playbook, target hosts, inventory, mode, source, who started it and the id of the run. Runs of playbook rules leave this entry out, they fire often.
- When it ends: the status, exit code and duration, and the
PLAY RECAPline of every host. A failed run is marked as error, so notification rules on the log pick it up: it lists for every failed host the task and the reason, for examplesrv01: Install Checkmk Version: SyntaxError: ..., or theERROR!of Ansible itself, and names the failed hosts as affected hosts.
Extra vars and passwords never go into the log; the whole output stays on the page of the run.
Run History
The history table sorts by started_at descending and offers filters for playbook, host, status, mode (run / preview), and source (UI / rule / CLI). Use it to:
- Investigate a failed run — open the row to see the captured log.
- Distinguish dry-runs from real changes via the Mode column.
- Force a re-fire of a rule-driven playbook by deleting its history row (the dedup key is
playbook + host + rule_id).
Exports are available in xlsx / csv via the Export button at the top of the table.
CLI parity
Everything the UI can dispatch is also reachable from the shell. Each CLI run becomes a Run History row with source = cli:
./cmdbsyncer ansible fire_playbook_rules
(other subcommands behave the same way they always have — only the recording is new.)
Requirements
ansible-playbookmust be on the Syncer'sPATH. Override via theCMDBSYNCER_ANSIBLE_PLAYBOOK_BINenv var or theANSIBLE_PLAYBOOK_BINFlask config key.- The playbook directory defaults to
<repo>/ansible/. Override viaCMDBSYNCER_ANSIBLE_DIR/ANSIBLE_DIRif you ship playbooks from a non-default location.
Staging files under mod_wsgi
A UI run executes in the web worker's context. Under mod_wsgi that worker usually has a private /tmp (PrivateTmp=yes) that is invisible to your shell and to later playbook steps, and is wiped on restart. Playbooks that download/stage a file locally and then copy it to the targets must stage outside /tmp — see the Checkmk site management Installation Staging Path setting for an example.