Menu

Ansible ran our run once task four times and gave our servers four signing keys
📰

Ansible ran our run once task four times and gave our servers four signing keys

DEV Community: ansible·Sergey Shinder·about 1 hour ago
#acFkpyRB
#devtoansible#devto#dev#four#server
Reading 0:00
15s threshold

Our customer portal runs on sixteen web servers behind one load balancer. When a customer asks for an invoice, the server that handles the request returns a link signed with an HMAC key, and the download is verified by whichever server the load balancer picks next. Every server has to hold the same key. An Ansible playbook generates it and writes it to every server, and we rotate it every quarter.

The October rotation ran on a Tuesday evening and finished green. By Wednesday morning three invoice downloads in four were failing with invalid signature, and support had more than four hundred tickets before nine.

The task that generates the key is a command running openssl rand, marked run_once and registering its output. With run_once, Ansible runs the task on one host and gives its result to every other host it is working on.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.