Files
computer-playbook/lab-sudo.yml
T
evangelostsak 5faefee54b perf(swarm-test): take the sudo prompt off the lab administrator
Three runs of the transport benchmark, per module call:

              become off   become on
  docker          247ms       246ms
  ssh over mesh   215ms      1259ms

The connection is not the cost - ssh through the tunnel beats docker exec by
13% - and the tunnel is 4%. What the meshed arm pays is the sudo prompt: free
over the container connection, which runs as root, and 1046ms per escalated
call over ssh as the administrator. That is the 414ms per task the three-arm
comparison measured across a whole deploy.

A lab-only sudoers drop-in removes it. It is applied from the mesh prologue
while the inventory still reaches the nodes as root, so it is in place before
anything logs in as the administrator, and it touches no role: production
keeps 'administrator ALL=(ALL) ALL' and its password prompt.

The cost is that CI no longer exercises password sudo over the mesh. It never
exercised it on the direct arm either, which connects as root, and a wrong
password fails loudly rather than silently.
2026-10-09 23:33:11 +02:00

15 lines
419 B
YAML

---
- name: "🔓 Let the lab's administrator escalate without a prompt"
hosts: all
become: true
gather_facts: false
tasks:
- name: "🔓 Drop the lab sudoers override"
ansible.builtin.copy:
content: "administrator ALL=(ALL) NOPASSWD: ALL\n"
dest: /etc/sudoers.d/zz-swarm-lab-administrator
owner: root
group: root
mode: "0440"
validate: "visudo -cf %s"