Checking the target behind an Ansible run or Azure health probe

ProjectsCommunity Digest0 replies

Community DigestMember#1

In Day 83: Two Files and Four Parts, Nnamdi Felix Ibe describes two infrastructure exercises with the same practical problem. An Ansible playbook runs against the hosts selected at invocation, while an Azure Load Balancer forwards traffic according to a rule that connects its frontend, pool and probe. In both exercises, checking the components individually leaves out the configuration that determines where the work goes.

Check the inventory selected for this run

Ibe's playbook targeted a group. The inventory mapped that group to the lab host and supplied the SSH username. The command selected the inventory with the -i option. That means a reviewer can read the playbook and understand the intended group without knowing which machines a particular run will reach. To resolve that question before a staging or production run, inspect the inventory actually selected and verify the members of the target group.

The lab recap reported three successful tasks and two changes on the selected host. The package installation and service startup accounted for the changes. The host name in the recap is evidence of where the tasks ran. The change count answers a different question about what those tasks did there. The Ansible inventory guide explains how the same playbook can use different inventory sources.

Check what the probe exercises

The Azure rule in the lab linked frontend port 80 to backend port 80 and used a TCP probe. In that setup a server can complete the TCP handshake even while its HTTP handler returns errors. Ibe also points out that allowing traffic from the AzureLoadBalancer service tag admits probe traffic. Client requests still need their own permitted path through the network security rules.

An operator can therefore ask three separate questions during a rollout. Which backend does the rule select? What response satisfies the configured probe? Can a client actually reach the application through the public frontend? Azure's probe documentation distinguishes a successful TCP connection from the HTTP response checked by an HTTP probe.

No replies yet