push_config
Push configuration to a Juniper device with commit confirmed and health check for safe rollback. Supports dry run, config files, or inline set commands.
Instructions
Push configuration to a device with commit confirmed and health check.
Supports two input methods (exactly one required):
config_file: Path to a .set or .j2 file containing set commands
set_commands: List of set command strings (inline)
Safety features (not available in Juniper's official MCP server):
dry_run mode (default True): shows diff without committing
commit confirmed: auto-rollback if not confirmed within timeout
health check: auto-rollback on connectivity failure after commit
Commit flow (normal): lock -> load -> diff -> commit_check -> commit confirmed -> health check -> confirm -> unlock
Commit flow (no_commit=True — intentional auto-rollback): lock -> load -> diff -> commit_check -> commit confirmed -> unlock (health check and final confirm are skipped; JUNOS rolls back automatically after confirm_timeout minutes)
Args:
hostname: Target device hostname (must exist in config.ini)
config_file: Path to .set or .j2 file (mutually exclusive with set_commands)
set_commands: List of set commands (mutually exclusive with config_file)
dry_run: If True (default), show diff only without committing
confirm_timeout: Minutes before auto-rollback (default 1, used with commit confirmed)
no_commit: If True, issue commit confirmed but intentionally skip the final
commit so JUNOS auto-rolls back after confirm_timeout minutes. Useful
for triggering service restarts (e.g. syslog on EX3400) where no
request ...restart command exists. dry_run=True takes precedence
over no_commit (diff is shown but nothing is committed).
health_check: Fallback health check commands tried in order after commit.
Passes if ANY command succeeds. Supports "ping ..." (checks packets received),
"uptime" (NETCONF RPC probe), or any CLI command (success if no exception).
Default: ["uptime"] — uses the existing NETCONF session and does not
depend on ICMP reachability. (Changed from broadcast ping in junos-mcp
0.11.0 to match junos-ops 0.16.8+.)
Ignored when no_commit=True.
config_path: Path to config.ini (empty string uses default search)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hostname | Yes | ||
| config_file | No | ||
| set_commands | No | ||
| dry_run | No | ||
| confirm_timeout | No | ||
| no_commit | No | ||
| health_check | No | ||
| config_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |