Report which servers in a fleet have a different version of `openssl` installed than the approved one.
IntermediateScenarioScenarios: deployments, user management and fleet operations
Answer
Situation read → Collect versions in parallel, compare to the baseline, report drift.
What I'd do →
approved="3.0.13-0ubuntu3.4"
ver() {
local v
v=$(ssh -n -o BatchMode=yes -o ConnectTimeout=5 "$1" "dpkg-query -W -f='\${Version}' openssl" 2>/dev/null) || v=unreachable
echo "$1 ${v:-missing}"
}
export -f ver
xargs -a hosts.txt -P 20 -I{} bash -c 'ver "$1"' _ {} |
awk -v a="$approved" '$2 != a {print "DRIFT", $0}' | sort
dpkg-query -W -f='${Version}'gives a clean version string (rpm -q --qf '%{VERSION}-%{RELEASE}'on RHEL). The\$and inner single quotes keep${Version}from being expanded by either the local or the remote shell.- Unreachable hosts appear as drift so they are not silently skipped.
Why → Version drift is how one unpatched server survives a CVE rollout.
Interview tip → Mention AWS SSM Inventory or osquery for continuous fleet inventory.
More on Scenarios: deployments, user management and fleet operations
Write the core of a deploy script with release directories, an atomic symlink switch and rollback.IntermediateDeploy to 10 servers behind an AWS ALB one at a time, removing each from the target group during its deploy. Outline the script.AdvancedAfter a deploy, the health check fails intermittently. Your script must roll back automatically, but only if the failure persists. How?IntermediateImplement a blue/green switch on a single nginx host with a script.AdvancedOnboard 30 engineers: create accounts and install their SSH keys from their GitHub usernames, idempotently.IntermediateAn engineer leaves the company. Write the offboarding steps for Linux servers.Intermediate