renstur@coopnet:~/blog$ ls -lt ./topics/automation-linux/
automation-linux/
Ansible, Semaphore, systemd and sshd: automation that fails quietly.
-
'Failed to connect to bus' and four other things that break when a service moves to a user unit
Moving a service to a systemd user unit broke four ways: Failed to connect to bus without XDG_RUNTIME_DIR, root seeing no journal, no start at boot without enable-linger, and an early start that killed the listener thread. An ExecStartPre wait for the address fixed the last one.
-
Stop Ansible hanging forever on a host that is "up"
One half up host froze my Ansible run for nine minutes, and none of Ansible's timeouts cover a hung ssh call. I point ansible_ssh_executable at a wrapper that runs timeout -k 5 60 ssh, with ControlMaster off, so a wedged host fails in about a minute and gets skipped.
-
sshd -t fails with 'Missing privilege separation directory: /run/sshd' and quietly undoes your hardening
sshd -t failed on a valid config because /run/sshd didn't exist yet, and my rollback step deleted the hardening it was there to protect. Run mkdir -p /run/sshd before validating, so the check tests the config and not tmpfs.
-
Semaphore's per task host limit does nothing and takes the whole fleet with it
I set Semaphore's task limit to one host and it ran the playbook against the whole inventory, because the limit field never reaches Ansible. Now the playbook's hosts line is {{ target | mandatory }}, fed by a required survey variable, so a missing target fails closed.