swarm_update
Update Docker swarm settings and rotate join tokens or unlock key on a manager node. Merges changes into the current cluster spec for token rotation and configuration updates.
Instructions
Update swarm-wide settings: the single home for join-token rotation and cluster spec changes.
Must be called on a swarm manager node. Token rotation invalidates the old join token
immediately - nodes that have not yet joined using the old token must use the new one.
Existing joined nodes are unaffected. Use swarm_join_tokens to retrieve the new
tokens after rotation. Rotating the unlock key requires all managers to be re-unlocked
on restart with the new key; retrieve it immediately via swarm_unlock_key. Rotation and
updates are independent and may be combined in one call; swarm_init sets these same
fields when the swarm is first created, and swarm_inspect reads the current values back.
The Engine replaces the whole cluster spec on every update, so this reads the current spec
first and resubmits it, merging updates over it - omitting updates therefore changes
nothing but the requested rotation.
Args:
rotate_worker_token: Issue a new worker join token, invalidating the current one
rotate_manager_token: Issue a new manager join token, invalidating the current one
rotate_manager_unlock_key: Issue a new autolock unlock key for manager restart
updates: Engine SwarmSpec fields to change, merged over the current spec one top-level key at a time, so a named
block is replaced whole rather than field by field: keys are "Name", "Labels", "Orchestration", "Raft",
"Dispatcher", "CAConfig", "EncryptionConfig" and "TaskDefaults", e.g. {"EncryptionConfig":
{"AutoLockManagers": True}} to turn manager autolock on. Read the current blocks from swarm_inspect
Returns: bool: True after the update completes
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| updates | No | ||
| rotate_worker_token | No | ||
| rotate_manager_token | No | ||
| rotate_manager_unlock_key | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |