apply_node_os_policy
Write, or remove, Ankra's node OS update policy on the existing nodes and the bastion of an Ankra-provisioned cluster, over SSH through the bastion. The policy is two files: /etc/apt/apt.conf.d/52ankra-unattended-upgrades, which keeps automatic security updates for every package except the ones whose maintainer scripts restart networking, the init system, udev, the container runtime, the local API server endpoint or the packet filter in place (systemd and its libraries, udev, netplan, docker, containerd, runc, haproxy, keepalived, iptables, nftables) and turns automatic reboots off; and /etc/needrestart/conf.d/50-ankra.conf, which makes needrestart list services after a library update instead of restarting them (on Ubuntu 24.04 it otherwise restarts them automatically from the apt hook). Without it, Ubuntu's daily unattended upgrade can restart systemd-networkd on every node at once and reset every connection through them. The held-back packages are patched by Ankra's rolling maintenance instead, one node at a time. Writing or removing these files restarts nothing: apt and needrestart read them the next time they run, so this is safe on a production node. A held host gets those held-back security updates only from the rolling OS patch lane, so apply is refused unless the cluster's OS patch policy is enabled (set_os_patch_policy); runs of an enabled policy write and remove the hold on their own, and turning the policy off removes it everywhere. revert is always allowed. It does NOT run arbitrary commands - only this fixed write or its removal. Target the bastion with include_bastion, one node with node_id (preferred) or node_name, or every node with all_nodes (at most 100 per run); combine include_bastion with either. revert removes both files. Hosts are visited one at a time. The report lists every host with verified true only when apt-config itself shows the policy in force (or gone, after revert); a host without apt, an unreachable host or one the run did not reach reports verified false with the reason. Not available for imported or managed-Kubernetes clusters (no bastion), nor Scaleway (its gateway has no shell).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| revert | No | Remove the policy files instead of writing them. Restarts nothing either. | |
| node_id | No | UUID of one node to cover (from list_cluster_nodes). Preferred over node_name. | |
| all_nodes | No | Cover every live node of the cluster (at most 100 per run). Cannot be combined with node_id or node_name. | |
| node_name | No | Exact name of one node to cover. Alternative to node_id. | |
| cluster_id | No | UUID of the cluster. Optional when a cluster is selected. | |
| cluster_name | No | Exact name of the cluster. Optional when a cluster is selected. | |
| include_bastion | No | Apply to (or remove from) the cluster's bastion. |