<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nnamdi Felix Ibe</title>
    <description>The latest articles on DEV Community by Nnamdi Felix Ibe (@ndcodes).</description>
    <link>https://dev.to/ndcodes</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3994627%2F3c1e9fc3-98cd-45c4-9e34-3ef72ece6604.jpg</url>
      <title>DEV Community: Nnamdi Felix Ibe</title>
      <link>https://dev.to/ndcodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ndcodes"/>
    <language>en</language>
    <item>
      <title>Day 91: A Playbook That Undoes Itself and a Test That Could Fail</title>
      <dc:creator>Nnamdi Felix Ibe</dc:creator>
      <pubDate>Mon, 23 Nov 2026 18:00:00 +0000</pubDate>
      <link>https://dev.to/ndcodes/day-91-a-playbook-that-undoes-itself-and-a-test-that-could-fail-47b7</link>
      <guid>https://dev.to/ndcodes/day-91-a-playbook-that-undoes-itself-and-a-test-that-could-fail-47b7</guid>
      <description>&lt;p&gt;Day 91 of DevOps, Day 41 of Azure. Both tasks today were about verification, from opposite ends. The Azure half is the best verification I have written in this series. The Ansible half ran clean, reported success, and had already undone half its own work in a way the first run could not show me.&lt;/p&gt;

&lt;p&gt;One Ansible task, one Azure task. A playbook that fights itself, then a test designed so it could fail. The tasks come from the KodeKloud Engineer platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 1: Putting a line at the top of a file with Ansible
&lt;/h2&gt;

&lt;p&gt;Install httpd on three app servers, start it, create &lt;code&gt;/var/www/html/index.html&lt;/code&gt; with one line of content, then put a second line above it. Mode &lt;code&gt;0655&lt;/code&gt;, owned by &lt;code&gt;apache&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: The playbook
&lt;/h3&gt;

&lt;p&gt;The last three tasks had taught me the pattern, so this one wrote itself:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create index.html with initial content&lt;/span&gt;
      &lt;span class="na"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;dest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/www/html/index.html&lt;/span&gt;
        &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;This is a Nautilus sample file, created using Ansible!&lt;/span&gt;

    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Add welcome line at the top of file&lt;/span&gt;
      &lt;span class="na"&gt;lineinfile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/www/html/index.html&lt;/span&gt;
        &lt;span class="na"&gt;line&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Welcome to Nautilus Group!&lt;/span&gt;
        &lt;span class="na"&gt;insertbefore&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;BOF&lt;/span&gt;
        &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'0655'&lt;/span&gt;
        &lt;span class="na"&gt;owner&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"apache"&lt;/span&gt;
        &lt;span class="na"&gt;group&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"apache"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;insertbefore: BOF&lt;/code&gt; is the documented way to put a line at the top. The documentation for &lt;code&gt;lineinfile&lt;/code&gt; lists it directly: "A value is available; &lt;code&gt;BOF&lt;/code&gt; for inserting the line at the beginning of the file." No regular expression needed, no counting lines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Running it
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PLAY RECAP ***************
stapp01 : ok=5  changed=4
stapp02 : ok=5  changed=4
stapp03 : ok=5  changed=4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Checking it properly
&lt;/h3&gt;

&lt;p&gt;This is the part I got right today, and the part I skipped two days ago:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;tony@stapp01 ~&lt;span class="o"&gt;]&lt;/span&gt;$ cat /var/www/html/index.html
Welcome to Nautilus Group!
This is a Nautilus sample file, created using Ansible!

&lt;span class="o"&gt;[&lt;/span&gt;tony@stapp01 ~&lt;span class="o"&gt;]&lt;/span&gt;$ ls -la /var/www/html/index.html
-rw-r-xr-x 1 apache apache 82 May 25 10:22 /var/www/html/index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Content, order, mode and ownership, on all three servers. All four requirements met, all four confirmed. 82 bytes checks out as 27 plus 55, which is a small thing to notice and is exactly the kind of small thing that catches a truncated write.&lt;/p&gt;

&lt;p&gt;So the task was done. The next bit is what I found when I asked what a second run would do.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: The two tasks undo each other
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;copy&lt;/code&gt; with &lt;code&gt;content&lt;/code&gt; is idempotent by comparison. It reads the destination, compares it to what the playbook says the file should contain, and does nothing if they already match. &lt;code&gt;lineinfile&lt;/code&gt; inserts its line when the line is not present.&lt;/p&gt;

&lt;p&gt;Put those two behaviours together and trace a second run against the file that exists at the end of the first:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;File before&lt;/th&gt;
&lt;th&gt;What the module decides&lt;/th&gt;
&lt;th&gt;File after&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;copy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;welcome line, then sample line&lt;/td&gt;
&lt;td&gt;Does not match &lt;code&gt;content&lt;/code&gt;, which is the sample line alone. Rewrite.&lt;/td&gt;
&lt;td&gt;sample line only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lineinfile&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;sample line only&lt;/td&gt;
&lt;td&gt;Welcome line is absent. Insert at BOF.&lt;/td&gt;
&lt;td&gt;welcome line, then sample line&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;copy&lt;/code&gt; task deletes the line the &lt;code&gt;lineinfile&lt;/code&gt; task added. The &lt;code&gt;lineinfile&lt;/code&gt; task puts it back. Every run. Forever.&lt;/p&gt;

&lt;p&gt;The file is correct when the playbook finishes, which is why this hides. But two things follow from it.&lt;/p&gt;

&lt;p&gt;The recap never settles. Every subsequent run reports &lt;code&gt;changed=2&lt;/code&gt;, so the &lt;code&gt;changed&lt;/code&gt; count stops carrying information. If I ran this playbook weekly I would learn to ignore those two, and the day a real change appeared I would ignore that too.&lt;/p&gt;

&lt;p&gt;And there is a window where the served page is wrong. Between the &lt;code&gt;copy&lt;/code&gt; task finishing and the &lt;code&gt;lineinfile&lt;/code&gt; task finishing, that file is missing its first line, and Apache is serving it to anyone who asks. The window is short. It is also real, and it opens on every single run.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;The fix is to stop using two tasks to describe one file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create index.html with its full content&lt;/span&gt;
      &lt;span class="na"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;dest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/www/html/index.html&lt;/span&gt;
        &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;Welcome to Nautilus Group!&lt;/span&gt;
          &lt;span class="s"&gt;This is a Nautilus sample file, created using Ansible!&lt;/span&gt;
        &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'0655'&lt;/span&gt;
        &lt;span class="na"&gt;owner&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apache&lt;/span&gt;
        &lt;span class="na"&gt;group&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;apache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One task. Idempotent. No window. &lt;code&gt;changed=0&lt;/code&gt; on the second run.&lt;/p&gt;

&lt;p&gt;The Ansible documentation points the same way without quite saying why. &lt;code&gt;lineinfile&lt;/code&gt; "is primarily useful when you want to change a single line in a file only", and then: "For other cases, see the &lt;code&gt;ansible.builtin.copy&lt;/code&gt; or &lt;code&gt;ansible.builtin.template&lt;/code&gt; modules." A file whose entire contents you are specifying is one of those other cases. I was using a line editor to write a two-line file.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;blockinfile&lt;/code&gt;, which I used two days ago, is the other answer and the one to reach for when something else also writes to the file. It owns a marked region and leaves the rest alone. Here nothing else writes to the file, so &lt;code&gt;copy&lt;/code&gt; is simpler.&lt;/p&gt;

&lt;p&gt;The task asked for the two-step approach, so the playbook follows the instructions and the instructions produce a playbook that cannot be run twice without churn. Worth knowing which of those two facts you are being graded on.&lt;/p&gt;

&lt;h3&gt;
  
  
  One more thing, on ownership
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;mode&lt;/code&gt;, &lt;code&gt;owner&lt;/code&gt; and &lt;code&gt;group&lt;/code&gt; are on the second task, not the first. So &lt;code&gt;copy&lt;/code&gt; creates the file as root, because the play runs with &lt;code&gt;become: yes&lt;/code&gt;, and &lt;code&gt;lineinfile&lt;/code&gt; is what makes it &lt;code&gt;apache:apache&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Remove that second task, or reorder the two, and you get a root-owned file in a web root. That is the same bug I hit on Days 84 and 85, arriving through a different door: the permissions are not attached to the thing that creates the file.&lt;/p&gt;

&lt;p&gt;And &lt;code&gt;0655&lt;/code&gt; gives &lt;code&gt;-rw-r-xr-x&lt;/code&gt;. Group and other get execute on a static HTML file, where execute does nothing, and &lt;code&gt;apache&lt;/code&gt;, the owner, is the one principal that cannot execute it. &lt;code&gt;0644&lt;/code&gt; is the conventional answer. The task asked for &lt;code&gt;0655&lt;/code&gt;, so &lt;code&gt;0655&lt;/code&gt; is what I set. Two days ago, the same file was asked for at &lt;code&gt;0777&lt;/code&gt;. Neither is a permission a web server needs.&lt;/p&gt;




&lt;h2&gt;
  
  
  Task 2: Azure Table Storage
&lt;/h2&gt;

&lt;p&gt;A table called &lt;code&gt;tasks&lt;/code&gt;, two entities in it, and the two statuses verified.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: The account and the table
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az storage account create -g &lt;span class="s2"&gt;"$RG"&lt;/span&gt; -n &lt;span class="s2"&gt;"$SA"&lt;/span&gt; -l eastus --sku Standard_LRS --kind StorageV2
&lt;span class="nv"&gt;KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;az storage account keys list -g &lt;span class="s2"&gt;"$RG"&lt;/span&gt; -n &lt;span class="s2"&gt;"$SA"&lt;/span&gt; --query &lt;span class="s2"&gt;"[0].value"&lt;/span&gt; -o tsv&lt;span class="o"&gt;)&lt;/span&gt;
az storage table create --name tasks --account-name &lt;span class="s2"&gt;"$SA"&lt;/span&gt; --account-key &lt;span class="s2"&gt;"$KEY"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"created"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No wait, no provisioning state. The table was ready for writes immediately, which is not what I had got used to.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: The entities
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az storage entity insert --table-name tasks --account-name &lt;span class="s2"&gt;"$SA"&lt;/span&gt; --account-key &lt;span class="s2"&gt;"$KEY"&lt;/span&gt; \
  --entity &lt;span class="nv"&gt;PartitionKey&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;tasks &lt;span class="nv"&gt;RowKey&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="nv"&gt;task&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"Learn Table Storage"&lt;/span&gt; &lt;span class="nv"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;completed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And what came back:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2026-10-21T03:29:38+00:00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"etag"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"W/\"datetime'2026-10-21T03%3A29%3A39.5133745Z'\""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2019-02-02"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No &lt;code&gt;PartitionKey&lt;/code&gt;. No &lt;code&gt;RowKey&lt;/code&gt;. None of the properties I sent. The insert response tells me the write was accepted and tells me nothing about what was written.&lt;/p&gt;

&lt;p&gt;I have come to prefer that. Day 38's blob upload returned a &lt;code&gt;content_md5&lt;/code&gt; that the client had computed, so the service reporting it back only confirmed the service had faithfully recorded my own claim about my own file. That looks like verification and is not. Here there is nothing to mistake for verification, so the question of whether the entity is correct stays open and visible, which is where it belongs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Making the service check it
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;task1 completed -&amp;gt; 1
task2 in-progress -&amp;gt; 1
total rows -&amp;gt; 2
wrong-status control (expect 0) -&amp;gt; 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first three lines come from server-side filters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;--filter &lt;span class="s2"&gt;"PartitionKey eq 'tasks' and RowKey eq '1' and status eq 'completed'"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A count of 1 means a row exists with that partition, that key and that status. The service applied the predicate. I did not read any JSON and decide it looked right, which is the step where a transposed digit gets waved through.&lt;/p&gt;

&lt;p&gt;The fourth line is the one that makes the other three worth anything.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;RowKey eq '1' and status eq 'in-progress'&lt;/code&gt; is deliberately false. No such row exists. If I had only the three positive counts, they would look conclusive and prove very little: if a malformed filter were being ignored, or were matching everything, every filter I ran would return a positive count, and all three lines would read as success. Getting &lt;code&gt;0&lt;/code&gt; back from a filter that must not match is what proves the filters actually discriminate, and that is what licenses reading the other three as real matches.&lt;/p&gt;

&lt;p&gt;A test that cannot fail is not a test. I had used the same shape on Day 35, where the ping that failed before the peering and succeeded after was worth far more than a ping that only ever succeeded.&lt;/p&gt;

&lt;p&gt;Which is this day's other half turned inside out. Here the check was built so that a broken check would announce itself. Over on the Ansible side, four tasks ran, the recap said success, the file was correct, and two of those tasks had cancelled each other out in a way a single run was structurally incapable of revealing. The difference was not how carefully I looked at the end. It was whether the thing I built was capable of failing in the first place.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;Two notes from the documentation that change how I would write this at any size.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;az storage entity query&lt;/code&gt; returns at most 1000 entities per request, and when there are more, &lt;code&gt;nextMarker&lt;/code&gt; carries a continuation token you feed back with &lt;code&gt;--marker&lt;/code&gt;. With two rows, mine came back as &lt;code&gt;{}&lt;/code&gt;, an empty object. So a script that treats "results, no error" as "all the results" is correct at two rows and silently wrong at 1001. The limit belongs to the service, so there is no page size to raise.&lt;/p&gt;

&lt;p&gt;And &lt;code&gt;PartitionKey&lt;/code&gt; is the unit of both distribution and transaction scope. The task puts both rows in one partition, which is fine for two rows and is not how you would build the application. One partition means entity group transactions work and scaling does not: a single partition cannot be split across servers, so its throughput is capped. For a real to-do app, the partition would be the user ID, with the task ID as RowKey.&lt;/p&gt;

&lt;p&gt;That also decides what a query costs. A filter naming both keys is a point query. A filter naming only &lt;code&gt;PartitionKey&lt;/code&gt; is a partition scan. A filter naming neither is a table scan, reading every partition. My two status checks named both keys. My negative control named only &lt;code&gt;RowKey&lt;/code&gt;, so the cheapest-looking line in that output was the most expensive command in the task. Against two rows, irrelevant. At scale, that is the query that quietly costs money.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;copy&lt;/code&gt; with &lt;code&gt;content&lt;/code&gt; and &lt;code&gt;lineinfile&lt;/code&gt; pointed at the same file undo each other on every run, because &lt;code&gt;copy&lt;/code&gt; restores its whole idea of the file and &lt;code&gt;lineinfile&lt;/code&gt; re-adds its line. One &lt;code&gt;copy&lt;/code&gt; with the full content fixes it, or &lt;code&gt;blockinfile&lt;/code&gt; if something else writes to the file too.&lt;/p&gt;

&lt;p&gt;Two tasks describing one file also open a window where the file is wrong, and on a served page that window is live every run.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;insertbefore: BOF&lt;/code&gt; puts a line at the top, and &lt;code&gt;mode&lt;/code&gt;, &lt;code&gt;owner&lt;/code&gt; and &lt;code&gt;group&lt;/code&gt; on that task are what set ownership, so removing it leaves a root-owned file in the web root.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;az storage entity insert&lt;/code&gt; returns a date, an etag and an API version. Verification is always a separate read.&lt;/p&gt;

&lt;p&gt;Verify with a server-side filter and count the matches, so the service does the comparing.&lt;/p&gt;

&lt;p&gt;Pair every positive filter with a deliberately false one. Three matches prove nothing if a broken filter would have matched them too.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;entity show&lt;/code&gt; returns the entity at the top level; &lt;code&gt;entity query&lt;/code&gt; nests it under &lt;code&gt;items&lt;/code&gt;. That is the eighth variation on this trap I have hit in the Azure track, and the fix is still to run the command plain and read the shape before writing a query.&lt;/p&gt;

&lt;p&gt;So here is the Day 91 question. When your check passes, do you know what it would have looked like if it had failed? I could answer that for the Azure half, because I had made it fail on purpose. I could not answer it for the Ansible half, and that is exactly where the bug was.&lt;/p&gt;

&lt;p&gt;Day 91 down. Nine to go.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ansible</category>
      <category>azure</category>
      <category>automation</category>
    </item>
    <item>
      <title>Day 90: A Mask in the Way and a Policy Pointing at Nothing</title>
      <dc:creator>Nnamdi Felix Ibe</dc:creator>
      <pubDate>Sun, 22 Nov 2026 09:00:00 +0000</pubDate>
      <link>https://dev.to/ndcodes/day-90-a-mask-in-the-way-and-a-policy-pointing-at-nothing-390o</link>
      <guid>https://dev.to/ndcodes/day-90-a-mask-in-the-way-and-a-policy-pointing-at-nothing-390o</guid>
      <description>&lt;p&gt;Day 90 of DevOps, Day 40 of Azure. Both tasks today were about a permission that exists, reads back correctly, and grants nothing.&lt;/p&gt;

&lt;p&gt;On Linux, that is the ACL mask, which can clip an entry you just created down to nothing while &lt;code&gt;ls -l&lt;/code&gt; reports something else entirely. On Azure it is an access policy written against the wrong one of a principal's two GUIDs, which ARM accepts without complaint and which authorises nobody.&lt;/p&gt;

&lt;p&gt;One Ansible task, one Azure task. Set three different ACLs on three servers, then build a Key Vault and prove an encrypt and decrypt round trip. The tasks come from the KodeKloud Engineer platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 1: Three ACLs on three servers
&lt;/h2&gt;

&lt;p&gt;The task: a different file and a different ACL on each app server. Group &lt;code&gt;tony&lt;/code&gt; read on one, user &lt;code&gt;steve&lt;/code&gt; read and write on another, group &lt;code&gt;banner&lt;/code&gt; read and write on the third.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Three plays, not one
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;hosts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;stapp01&lt;/span&gt;
  &lt;span class="na"&gt;become&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;yes&lt;/span&gt;
  &lt;span class="na"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create empty file&lt;/span&gt;
      &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/opt/security/blog.txt&lt;/span&gt;
        &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;touch&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Set ACL for group tony&lt;/span&gt;
      &lt;span class="na"&gt;acl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/opt/security/blog.txt&lt;/span&gt;
        &lt;span class="na"&gt;entity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;tony&lt;/span&gt;
        &lt;span class="na"&gt;etype&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;group&lt;/span&gt;
        &lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;r&lt;/span&gt;
        &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;present&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;hosts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;stapp02&lt;/span&gt;
  &lt;span class="nn"&gt;...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three plays in one playbook, each targeting one host. The alternative is one play with &lt;code&gt;when: inventory_hostname == ...&lt;/code&gt; on every task, which reads worse and runs every task against every host just to decide to skip it.&lt;/p&gt;

&lt;p&gt;Worth the contrast with Day 86, where one play served three hosts because the only thing varying was a value that &lt;code&gt;{{ ansible_user }}&lt;/code&gt; supplied per host. Here the filenames and the ACL types differ, so the plays differ.&lt;/p&gt;

&lt;p&gt;The output confirms plays run in sequence: &lt;code&gt;PLAY [stapp01]&lt;/code&gt; finishes before &lt;code&gt;PLAY [stapp02]&lt;/code&gt; starts. Within a play, Ansible parallelises across hosts, as Day 85 showed. Between plays it does not.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Two things the short module name hides
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;acl&lt;/code&gt; is &lt;code&gt;ansible.posix.acl&lt;/code&gt;, from the &lt;code&gt;ansible.posix&lt;/code&gt; collection. Not &lt;code&gt;ansible.builtin&lt;/code&gt;, and not shipped in &lt;code&gt;ansible-core&lt;/code&gt;, so it needs &lt;code&gt;ansible-galaxy collection install ansible.posix&lt;/code&gt; on a control node that does not already have it. The lab had it. A fresh one would fail at task resolution, which has nothing to do with ACLs and reads as it does.&lt;/p&gt;

&lt;p&gt;That is three naming patterns in one batch, none visible in the playbook. Day 87's &lt;code&gt;yum&lt;/code&gt; resolves to &lt;code&gt;ansible.builtin.yum&lt;/code&gt;, which is itself a redirect to the &lt;code&gt;dnf&lt;/code&gt; module. Day 89 used the fully qualified &lt;code&gt;ansible.builtin.blockinfile&lt;/code&gt;. This one resolves outside core entirely.&lt;/p&gt;

&lt;p&gt;And &lt;code&gt;state&lt;/code&gt; is doing real work. Its default is &lt;code&gt;query&lt;/code&gt;, which "gets the current ACL without changing it, for use in register operations". So a task that omits &lt;code&gt;state&lt;/code&gt; reads the ACL, changes nothing, reports no change, and looks like it worked. &lt;code&gt;state: present&lt;/code&gt; is not boilerplate.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: The mask, and why &lt;code&gt;ls -l&lt;/code&gt; disagrees with &lt;code&gt;getfacl&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This is the finding worth keeping, and it is sitting in plain sight in the output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# stapp02
-rw-rw-r--+ 1 root root  story.txt

user:steve:rw-
group::r--
mask::rw-
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;getfacl&lt;/code&gt; says the owning group has &lt;code&gt;r--&lt;/code&gt;. &lt;code&gt;ls -l&lt;/code&gt; shows the group bits as &lt;code&gt;rw-&lt;/code&gt;. Those contradict each other, and both are correct.&lt;/p&gt;

&lt;p&gt;When a file has extended ACLs, the group permission bits in &lt;code&gt;ls -l&lt;/code&gt; are the mask, not the owning group's entry. The mask is a ceiling applied to every named user, every named group and the owning group, and &lt;code&gt;setfacl&lt;/code&gt; recalculates it by default to cover whatever those entries ask for. &lt;code&gt;steve&lt;/code&gt; asked for &lt;code&gt;rw&lt;/code&gt;, the mask widened to &lt;code&gt;rw-&lt;/code&gt;, and &lt;code&gt;ls -l&lt;/code&gt; now reports &lt;code&gt;rw-&lt;/code&gt; in the group field while the owning group still has only &lt;code&gt;r--&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;+&lt;/code&gt; at the end of the mode string is the only clue any of this is happening. One character.&lt;/p&gt;

&lt;p&gt;Two consequences, and the second is the one that catches people.&lt;/p&gt;

&lt;p&gt;Reading &lt;code&gt;ls -l&lt;/code&gt; on a file with an ACL tells you the ceiling, not the group's access. On this file, it looks like "group can write", which is wrong in two different ways at once.&lt;/p&gt;

&lt;p&gt;And an ACL entry can exist and grant nothing. A &lt;code&gt;mask::r--&lt;/code&gt; with a &lt;code&gt;user:steve:rw-&lt;/code&gt; entry means &lt;code&gt;steve&lt;/code&gt; has the entry and cannot write, because the mask clips it. &lt;code&gt;getfacl&lt;/code&gt; flags that with an &lt;code&gt;#effective:&lt;/code&gt; comment. It did not happen here, because the module's &lt;code&gt;recalculate_mask&lt;/code&gt; defaults to &lt;code&gt;default&lt;/code&gt; and &lt;code&gt;setfacl&lt;/code&gt; widened the mask to fit. Set the mask explicitly, or pass &lt;code&gt;recalculate_mask: no_mask&lt;/code&gt;, and you can produce exactly that: a permission present, correct in intent, and ineffective.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;Verify ACLs with &lt;code&gt;getfacl&lt;/code&gt;, which is what this task did on all three servers.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ls -la&lt;/code&gt; alone would have shown the &lt;code&gt;+&lt;/code&gt; and the mask and none of the entries, which on stapp02 would have read as "group can write" and been wrong. The task asked for an ACL, and &lt;code&gt;getfacl&lt;/code&gt; is the only command that shows one.&lt;/p&gt;

&lt;p&gt;Worth saying because yesterday's verification checked content and skipped the mode and ownership the task also named. This one checked the thing that was genuinely hard to get right, with the command that shows it.&lt;/p&gt;

&lt;p&gt;One other thing to fix: &lt;code&gt;state: touch&lt;/code&gt; on the file tasks means this playbook reports &lt;code&gt;changed&lt;/code&gt; on every run forever, for Day 84's reason. The ACL tasks are idempotent. The file creation is not, unless &lt;code&gt;modification_time: preserve&lt;/code&gt; and &lt;code&gt;access_time: preserve&lt;/code&gt; are added.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 2: A Key Vault and a round trip
&lt;/h2&gt;

&lt;p&gt;The task: a vault, an RSA-4096 key, an access policy granting exactly Get, List, Encrypt and Decrypt, and an encrypt and decrypt of a file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: The whole task was one GUID
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az account show --query user.name -o tsv   -&amp;gt;  a1107d7d-9373-4903-a81c-21b8d7531bce
token "oid" claim                          -&amp;gt;  18970e52-5cf3-4f58-ad2c-7fbffab9e2b8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The lab identity is a service principal, and for a service principal &lt;code&gt;user.name&lt;/code&gt; is the application ID. &lt;code&gt;az keyvault set-policy --object-id&lt;/code&gt; wants the object ID, which is the identifier of the service principal object in the directory. Two different GUIDs for the same principal.&lt;/p&gt;

&lt;p&gt;Pass the app ID to &lt;code&gt;--object-id&lt;/code&gt;, and ARM accepts it. It creates a policy entry pointing at nothing. The vault then reports an access policy that looks entirely correct, grants access to nobody, and every crypto call returns &lt;code&gt;Forbidden&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Both values appear in one &lt;code&gt;az keyvault show&lt;/code&gt; response, which makes it concrete:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"accessPolicies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"objectId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"18970e52-..."&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nl"&gt;"systemData"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"createdBy"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"a1107d7d-..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"createdByType"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Application"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ARM's audit trail records the app ID. The access policy records the object ID. Same principal, same JSON document, two values you cannot substitute for each other.&lt;/p&gt;

&lt;p&gt;Which is this morning's ACL mask at a different scale. An entry clipped by the mask is present and ineffective. A vault policy written against the app ID is present and ineffective. Both read back fine, and the only way to find out is to attempt the operation it was supposed to permit.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Getting the object ID when Graph is closed
&lt;/h3&gt;

&lt;p&gt;Every obvious route goes through Microsoft Graph, and the lab identity cannot read it. &lt;code&gt;az ad sp show&lt;/code&gt; is denied. &lt;code&gt;az keyvault set-policy --spn&lt;/code&gt; resolves the app ID through Graph. &lt;code&gt;az role assignment list --all&lt;/code&gt; returned &lt;code&gt;[]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The access token already contains the answer. Its &lt;code&gt;oid&lt;/code&gt; claim is the object ID of the authenticated principal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;OID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;az account get-access-token --query accessToken -o tsv \
  &lt;span class="o"&gt;|&lt;/span&gt; python3 -c &lt;span class="s2"&gt;"import sys,base64,json; p=sys.stdin.read().strip().split('.')[1]; p+='='*(-len(p)%4); print(json.loads(base64.urlsafe_b64decode(p))['oid'])"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The padding line matters. JWTs use base64url with the padding stripped, so &lt;code&gt;b64decode&lt;/code&gt; fails on most tokens without &lt;code&gt;'='*(-len(p)%4)&lt;/code&gt; added back.&lt;/p&gt;

&lt;p&gt;Worth keeping for any Azure task that needs "the object ID of whoever I am" with Graph closed. The payload also carries &lt;code&gt;appid&lt;/code&gt;, &lt;code&gt;tid&lt;/code&gt; and &lt;code&gt;sub&lt;/code&gt;, which covers most identity questions a script will ask.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--no-self-perms&lt;/code&gt; on the create solves the same problem from the other end, because by default &lt;code&gt;az keyvault create&lt;/code&gt; writes a policy for the caller, which means resolving the caller's object ID, which means Graph. Without the flag, that step either warns and produces a vault with no policies or fails the create outright and leaves half a vault behind.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: The order of operations is forced
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set-policy --key-permissions get list create encrypt decrypt   # then create the key
set-policy --key-permissions get list encrypt decrypt          # then narrow
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;set-policy --key-permissions&lt;/code&gt; replaces that category's permission array. It does not add to it.&lt;/p&gt;

&lt;p&gt;The task asks for exactly Get, List, Encrypt and Decrypt, and none of those four permits creating a key. So grant &lt;code&gt;create&lt;/code&gt; temporarily, create the key, then narrow. The other order gives &lt;code&gt;Forbidden&lt;/code&gt; on &lt;code&gt;keyvault key create&lt;/code&gt;, and the error names the operation rather than the policy, which sends you off looking at RBAC.&lt;/p&gt;

&lt;p&gt;Fourth command in this challenge that replaces rather than merges, after &lt;code&gt;az resource tag&lt;/code&gt;, the S3 notification configuration and the lifecycle policy. With one mercy: &lt;code&gt;set-policy&lt;/code&gt; is scoped per object ID and per category, so it replaces one cell of the matrix rather than the whole table.&lt;/p&gt;

&lt;p&gt;And then re-verify, because the round trip was first proven while &lt;code&gt;create&lt;/code&gt; was still in the policy, which proves nothing about the state being left behind. That is the AWS Day 38 lesson with the terms swapped: there, configuration was right and behaviour untested. Here, behaviour was tested against a configuration that no longer existed.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;Two corrections to my own notes on soft delete, and both matter more than the thing I got right.&lt;/p&gt;

&lt;p&gt;I wrote that soft delete "cannot be disabled; it has been mandatory since 2020". The first half is documented: "Once soft-delete is enabled on a key vault, it can't be disabled." The 2020 date is not on that page, which instead says it is on by default for new vaults and that customers are "strongly encouraged to turn on soft delete enforcement for their vaults via Azure Policy". That reads as a default rather than an absolute, so I am recording the date as unverified.&lt;/p&gt;

&lt;p&gt;The default retention is 90 days, not 7: "You can set it anywhere from 7 to 90 days, with 90 days being the default." So &lt;code&gt;--retention-days 7&lt;/code&gt; was necessary to meet the requirement rather than a restatement of the default, which I had backwards on.&lt;/p&gt;

&lt;p&gt;And it is permanent: "The retention interval can only be configured during key vault creation and can't be changed afterwards." That vault has a seven-day window for its entire life, and changing it means a different vault.&lt;/p&gt;

&lt;p&gt;The name reservation I flagged is confirmed and broader than I stated: the name cannot be reused until retention expires, a vault with the same name can't be created in the same location, and "The DNS record corresponding to the vault is also retained during the retention interval." Which is why the discovery step ran &lt;code&gt;az keyvault list-deleted&lt;/code&gt; before creating anything.&lt;/p&gt;

&lt;p&gt;One last thing that is worth knowing before using this pattern for real. RSA cannot encrypt more than its modulus allows, and for a 4096-bit key with RSA-OAEP the ceiling is 470 bytes of plaintext. The file here was 26 bytes. Beyond the limit, the answer is &lt;code&gt;wrapKey&lt;/code&gt; and envelope encryption, encrypting a symmetric data key in the vault and the actual file locally with AES, which is how Azure Disk Encryption works and why "encrypted with Key Vault" rarely means the bytes went to Key Vault.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Both halves are the same failure in two systems: a permission that is syntactically fine, visible when you look, and does nothing.&lt;/p&gt;

&lt;p&gt;The ACL mask is the more elegant one, because the system is actively telling you something misleading. &lt;code&gt;ls -l&lt;/code&gt; reports the mask in the group field, so a file where the group has read-only displays as read-write, and the only signal that the number you are reading is not the number you think is a single &lt;code&gt;+&lt;/code&gt; at the end of the mode string.&lt;/p&gt;

&lt;p&gt;The Key Vault GUID is the more expensive one. ARM takes the wrong identifier without complaint, the vault displays a policy that looks correct, and every operation fails with &lt;code&gt;Forbidden&lt;/code&gt;, which points at permissions in general rather than at one wrong field. Two GUIDs, same principal, both in the same response, and the hint the task gives you points at the wrong one.&lt;/p&gt;

&lt;p&gt;The thing both have in common is that reading the configuration back is not a check. In both cases, it reads back exactly as intended. The only test is attempting the operation the permission was supposed to allow, which is what I eventually did in one case and what the mask happened to spare me in the other.&lt;/p&gt;

&lt;p&gt;So here is the Day 90 question. Which of your access rules have you confirmed by reading them, rather than by watching someone successfully use them?&lt;/p&gt;

&lt;p&gt;Day 90 down. Ten to go.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ansible</category>
      <category>azure</category>
      <category>automation</category>
    </item>
    <item>
      <title>Day 89: A Dead Service and a Private Container That Serves</title>
      <dc:creator>Nnamdi Felix Ibe</dc:creator>
      <pubDate>Sat, 21 Nov 2026 09:00:00 +0000</pubDate>
      <link>https://dev.to/ndcodes/day-89-a-marker-in-the-file-and-a-grant-somewhere-else-1deo</link>
      <guid>https://dev.to/ndcodes/day-89-a-marker-in-the-file-and-a-grant-somewhere-else-1deo</guid>
      <description>&lt;p&gt;Day 89 of DevOps, Day 39 of Azure. Both tasks today produced something that reads as broken and is documented as correct.&lt;/p&gt;

&lt;p&gt;A service came back &lt;code&gt;inactive (dead)&lt;/code&gt;, and that was the right result, one day after an identical command had to say &lt;code&gt;active (running)&lt;/code&gt;. And an Azure storage container holding a live website is private, returns 404 to anonymous requests, and the website serves anyway.&lt;/p&gt;

&lt;p&gt;One Ansible task, one Azure task. Install logrotate on three servers, then host a static site on a storage account. The tasks come from the KodeKloud Engineer platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 1: Install logrotate
&lt;/h2&gt;

&lt;p&gt;The task: a playbook that installs &lt;code&gt;logrotate&lt;/code&gt; on all three app servers. One package, no service requirement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---
&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;hosts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;app_servers&lt;/span&gt;
  &lt;span class="na"&gt;become&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;yes&lt;/span&gt;

  &lt;span class="na"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install logrotate package.&lt;/span&gt;
      &lt;span class="na"&gt;yum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;logrotate&lt;/span&gt;
        &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;present&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stapp01 : ok=2  changed=1   stapp02 : ok=2  changed=1   stapp03 : ok=2  changed=1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 1: Then the verification that looks like a failure
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;tony@stapp01 ~&lt;span class="o"&gt;]&lt;/span&gt;$ sudo systemctl status logrotate
○ logrotate.service - Rotate log files
     Loaded: loaded &lt;span class="o"&gt;(&lt;/span&gt;/usr/lib/systemd/system/logrotate.service&lt;span class="o"&gt;;&lt;/span&gt; static&lt;span class="o"&gt;)&lt;/span&gt;
     Active: inactive &lt;span class="o"&gt;(&lt;/span&gt;dead&lt;span class="o"&gt;)&lt;/span&gt;
TriggeredBy: ○ logrotate.timer
       Docs: man:logrotate&lt;span class="o"&gt;(&lt;/span&gt;8&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;inactive (dead)&lt;/code&gt;. Yesterday the same command on &lt;code&gt;vsftpd&lt;/code&gt; had to say &lt;code&gt;active (running)&lt;/code&gt; for the task to be done, and here the opposite is correct.&lt;/p&gt;

&lt;p&gt;Three details in that output explain why.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;TriggeredBy: logrotate.timer&lt;/code&gt; is the mechanism. logrotate is not a daemon. It is a batch job that systemd runs on a schedule, so being inactive almost all the time is exactly what it does. The question "will this run" is answered by the timer, not the service.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;static&lt;/code&gt; in the Loaded line means the unit has no &lt;code&gt;[Install]&lt;/code&gt; section, so it cannot be enabled or disabled at all. Which is also why the playbook correctly has no &lt;code&gt;service&lt;/code&gt; task. There is nothing to start and nothing to enable, and had the task asked for &lt;code&gt;state: started&lt;/code&gt;, the right move would have been to question the task rather than write it.&lt;/p&gt;

&lt;p&gt;And the unit exists, which is what the install produced. Before the playbook, the same command said &lt;code&gt;Unit logrotate.service could not be found.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So two consecutive days, one command, opposite right answers:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Day&lt;/th&gt;
&lt;th&gt;Package&lt;/th&gt;
&lt;th&gt;Correct state&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;87&lt;/td&gt;
&lt;td&gt;vsftpd&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;enabled&lt;/code&gt;, &lt;code&gt;active (running)&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;88&lt;/td&gt;
&lt;td&gt;logrotate&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;static&lt;/code&gt;, &lt;code&gt;inactive (dead)&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The habit worth having is working out which kind of unit you are looking at before deciding what success looks like. And the check that actually answers the question for a timer is &lt;code&gt;systemctl list-timers logrotate.timer&lt;/code&gt;, which is the one command neither the task nor I ran.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;Installing logrotate gives you the binary, the unit, the timer, and &lt;code&gt;/etc/logrotate.conf&lt;/code&gt; with its &lt;code&gt;include /etc/logrotate.d&lt;/code&gt; line. It does not give you a rotation policy for anything.&lt;/p&gt;

&lt;p&gt;So the task is satisfied, and nothing is being rotated that was not already. A playbook doing useful work would drop a file into &lt;code&gt;/etc/logrotate.d/&lt;/code&gt; saying which logs to rotate and how often, which is one more task using &lt;code&gt;copy&lt;/code&gt; or &lt;code&gt;template&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Worth saying because "logrotate is installed" and "logs are being rotated" are different claims. It is Day 76's backup-with-no-tables pattern in a milder form: the thing that was asked for is in place, and the outcome anyone actually wants is a step further on.&lt;/p&gt;

&lt;p&gt;One small thing to fix in my own notes. I wrote the playbook path as &lt;code&gt;/home/thor/ansible/playbook.yml&lt;/code&gt; and then ran it from &lt;code&gt;~/playbook&lt;/code&gt;. The transcript shows the run working, so &lt;code&gt;~/playbook&lt;/code&gt; is the real location. Anyone following the stated path writes the file where the command will not find it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 2: A static site on a storage account
&lt;/h2&gt;

&lt;p&gt;The task: a storage account with static website hosting, serving an uploaded &lt;code&gt;index.html&lt;/code&gt; publicly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: The container is private, and the site works
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;web_endpoint:  http=200    (https://...z13.web.core.windows.net/)
blob_endpoint: http=404    (https://...blob.core.windows.net/%24web/index.html)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same account, same blob, same anonymous caller. One endpoint serves it, the other denies it exists.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$web&lt;/code&gt; was never given a public access level. It was created implicitly by enabling static website hosting, and its &lt;code&gt;publicAccess&lt;/code&gt; is unset, which is why the blob endpoint 404s. Enabling hosting is the entire grant, and it has its own anonymous read path that does not go through container ACLs at all.&lt;/p&gt;

&lt;p&gt;Which is the morning's finding from the other side. There, the state that makes a task idempotent is two comment lines in the file being edited, not anything in the playbook. Here, the permission that makes a site public is a service property on the account, not an ACL on the container holding the content. Both times, the place you would reach for first is not where the answer is kept.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: The thing I left open is documented
&lt;/h3&gt;

&lt;p&gt;My notes ended that section honestly and incompletely:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Not tested: whether the site still serves with &lt;code&gt;allowBlobPublicAccess: false&lt;/code&gt;. Microsoft documents the static website endpoint as unaffected by that switch... that is currently an inference, not a result.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It is documented, in one sentence on the page about disallowing anonymous access:&lt;/p&gt;

&lt;p&gt;"Disallowing anonymous access for a storage account doesn't affect any static websites hosted in that storage account. The $web container is always publicly accessible."&lt;/p&gt;

&lt;p&gt;So the inference was right, and the documented claim is broader than the one I was reaching for. Not "unaffected by that switch" but "always publicly accessible", which is a statement about &lt;code&gt;$web&lt;/code&gt; itself rather than about two settings interacting.&lt;/p&gt;

&lt;p&gt;The useful consequence is the configuration I had guessed might exist. Static website hosting is the way to serve public content from a storage account with anonymous blob access completely disabled. Account-wide anonymous access off, so no container can ever be made public by accident, and the site still served. That is what a real deployment would want, and I had it as a maybe.&lt;/p&gt;

&lt;p&gt;Worth being precise that this still was not observed. The account was created with the switch on, because the task says "allow public access" and a grader reads that field. What changed is that the claim is documented rather than inferred, which is a different kind of support than a test.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;Three things, and the first costs the most time when you get it wrong.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://xfusionwebst360856247.z13.web.core.windows.net/
                              ^^^^
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;z13&lt;/code&gt; is a DNS zone partition assigned to the account. It is not derivable from the account name, the region, or anything else visible, and it varies between accounts. Every other storage endpoint is predictable from the account name. This one is not.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;WEB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;az storage account show -g &lt;span class="s2"&gt;"$RG"&lt;/span&gt; -n &lt;span class="s2"&gt;"$SA"&lt;/span&gt; --query &lt;span class="s2"&gt;"primaryEndpoints.web"&lt;/span&gt; -o tsv&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Guessing the hostname gives a DNS failure, not an HTTP error, so the error points nowhere near the real cause, and you end up debugging a storage account that was correct the whole time. Same trap as the &lt;code&gt;s3-website-us-east-1&lt;/code&gt; hyphen on AWS Day 39.&lt;/p&gt;

&lt;p&gt;Second, set the content type explicitly even when the CLI would guess right:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;--content-type text/html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The failure mode is nasty. An &lt;code&gt;index.html&lt;/code&gt; stored as &lt;code&gt;application/octet-stream&lt;/code&gt; returns HTTP 200 and the browser downloads it instead of rendering it. The URL works, the bytes are correct, &lt;code&gt;curl&lt;/code&gt; is perfectly happy, and only a real browser shows the problem. A 200 with the wrong content type is harder to find than a 404. Read it back off the response header rather than the blob's metadata, so the check is end-to-end.&lt;/p&gt;

&lt;p&gt;Third, &lt;code&gt;$web&lt;/code&gt; needs single quotes in bash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;-c &lt;span class="s1"&gt;'$web'&lt;/span&gt;      &lt;span class="c"&gt;# correct&lt;/span&gt;
-c &lt;span class="s2"&gt;"$web"&lt;/span&gt;      &lt;span class="c"&gt;# expands to empty string&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is a legal container name and a variable reference at the same time, and double quotes make bash substitute an undefined variable and pass an empty container name. It also appears as &lt;code&gt;%24web&lt;/code&gt; in anything URL-shaped, because &lt;code&gt;$&lt;/code&gt; is reserved in a URI path.&lt;/p&gt;

&lt;p&gt;Worth the comparison with S3 while it is fresh, because the two platforms are exactly inverted here. On S3, enabling website hosting turns on index document resolution and grants nothing, so public read needs a separate bucket policy with the access block off, and the objects then become readable through the REST endpoint as well. Azure keeps the blob endpoint shut and opens only the web one, which is a smaller exposed surface for the same outcome. And Azure's web endpoint does HTTPS, whereas an S3 website endpoint cannot do TLS at all, which is why CloudFront sits in front of essentially every real S3 static site.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Both halves produced something that reads as broken and is documented as correct.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;inactive (dead)&lt;/code&gt; is the better of the two findings, because it is cheap and permanent. Some systemd units are daemons, and some are batch jobs with timers, and the same &lt;code&gt;systemctl status&lt;/code&gt; command is the right check for both with opposite correct answers. The tell is three words in the output: &lt;code&gt;static&lt;/code&gt; and &lt;code&gt;TriggeredBy&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The Azure half is the one I got a response to. I wrote down an open question and said plainly that my reasoning was suggestive and the evidence was absent. Going and looking turned it into a documented behaviour, and a stronger one than I was expecting: &lt;code&gt;$web&lt;/code&gt; is always publicly accessible, full stop, which makes a static website the way to serve public content from an account where anonymous blob access is switched off entirely.&lt;/p&gt;

&lt;p&gt;So here is the Day 89 question. How many of the alerts you would act on are firing on a state that something's own documentation calls correct?&lt;/p&gt;

&lt;p&gt;Day 89 down. Eleven to go.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ansible</category>
      <category>azure</category>
      <category>automation</category>
    </item>
    <item>
      <title>Day 88: A Marker in the File and a Disputed Status Code</title>
      <dc:creator>Nnamdi Felix Ibe</dc:creator>
      <pubDate>Fri, 20 Nov 2026 18:00:00 +0000</pubDate>
      <link>https://dev.to/ndcodes/day-88-a-dead-service-and-a-disputed-status-code-48j5</link>
      <guid>https://dev.to/ndcodes/day-88-a-dead-service-and-a-disputed-status-code-48j5</guid>
      <description>&lt;p&gt;Day 88 of DevOps, Day 38 of Azure. Both tasks today put the thing that matters somewhere other than where I had recorded it.&lt;/p&gt;

&lt;p&gt;An Ansible module that is reliably idempotent turns out to store its entire record of what it did in two comment lines inside the file it edits. And an Azure error code I had written down as the answer turns out to be one of several the same condition produces, depending on the client.&lt;/p&gt;

&lt;p&gt;One Ansible task, one Azure task. Write a block of content into a web page on three servers, then upload a file from a VM into a private blob container. The tasks come from the KodeKloud Engineer platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 1: A block of content in a web page
&lt;/h2&gt;

&lt;p&gt;The task: install httpd, start it, and write a block into &lt;code&gt;/var/www/html/index.html&lt;/code&gt; with mode &lt;code&gt;0777&lt;/code&gt; owned by &lt;code&gt;apache&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Using the blockinfile module.&lt;/span&gt;
      &lt;span class="na"&gt;ansible.builtin.blockinfile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/var/www/html/index.html&lt;/span&gt;
        &lt;span class="na"&gt;create&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;yes&lt;/span&gt;
        &lt;span class="na"&gt;block&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;Welcome to XfusionCorp!&lt;/span&gt;

          &lt;span class="s"&gt;This is  Nautilus sample file, created using Ansible!&lt;/span&gt;

          &lt;span class="s"&gt;Please do not modify this file manually!&lt;/span&gt;
        &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'0777'&lt;/span&gt;
        &lt;span class="na"&gt;owner&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"apache"&lt;/span&gt;
        &lt;span class="na"&gt;group&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"apache"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 1: The markers are the state
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[tony@stapp01 ~]$ cat /var/www/html/index.html
# BEGIN ANSIBLE MANAGED BLOCK
Welcome to XfusionCorp!
...
# END ANSIBLE MANAGED BLOCK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those two comment lines are the whole reason this task is idempotent. The default marker is &lt;code&gt;"# {mark} ANSIBLE MANAGED BLOCK"&lt;/code&gt;, with &lt;code&gt;marker_begin&lt;/code&gt; defaulting to &lt;code&gt;BEGIN&lt;/code&gt; and &lt;code&gt;marker_end&lt;/code&gt; to &lt;code&gt;END&lt;/code&gt;. On the next run the module looks for those lines, finds the block between them, compares it to what the playbook says, and reports &lt;code&gt;ok&lt;/code&gt; if they match.&lt;/p&gt;

&lt;p&gt;So the module keeps no record anywhere of its own. The state lives in the target file, in two lines that look like decoration. Delete them by hand and the next run appends a second copy of the block, because there is nothing left to match against.&lt;/p&gt;

&lt;p&gt;Two documented ways to break that, both worth knowing before writing a custom marker. "Multi-line markers are not supported and will result in the block being repeatedly inserted on subsequent playbook runs." And a custom marker without &lt;code&gt;{mark}&lt;/code&gt; in it does the same thing, because the begin and end lines become identical.&lt;/p&gt;

&lt;p&gt;There is a constraint on managing two blocks in one file, too: the marker has to differ per task, since two tasks sharing the default fight over the same region.&lt;/p&gt;

&lt;p&gt;Worth setting against the rest of this fortnight, because blockinfile is the well-behaved one. Day 85's &lt;code&gt;file: state=touch&lt;/code&gt; reports a change on every run because its timestamps default to &lt;code&gt;now&lt;/code&gt;. Day 91's &lt;code&gt;copy&lt;/code&gt; plus &lt;code&gt;lineinfile&lt;/code&gt; pair actively undoes its own work. This module is idempotent, and the mechanism is visible in the file rather than hidden in the module.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;create: yes&lt;/code&gt; was necessary rather than defensive, by the way. The parameter "defaults to &lt;code&gt;false&lt;/code&gt;", and the before-check showed the file was absent, so without it the task would have failed on a missing path.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: The recap told me something I had not checked
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TASK [Install httpd package.] ***************  ok: [stapp01]
TASK [Starting the httpd service.] ***************  ok: [stapp01]
TASK [Using the blockinfile module.] ***************  changed: [stapp01]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two &lt;code&gt;ok&lt;/code&gt; and one &lt;code&gt;changed&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;My before-check was &lt;code&gt;cat /var/www/html/index.html&lt;/code&gt;, which came back "No such file or directory". That tested the file. It did not test the package.&lt;/p&gt;

&lt;p&gt;The recap did, for free. httpd was already installed and already running on all three servers before the playbook ran, which is why those two tasks report &lt;code&gt;ok&lt;/code&gt;. Day 91's run of a nearly identical playbook shows both as &lt;code&gt;changed&lt;/code&gt;, because that lab had no httpd. Same tasks, two labs, and the recap distinguishes them with nothing added.&lt;/p&gt;

&lt;p&gt;Which is worth drawing out, because a recap that is all &lt;code&gt;changed&lt;/code&gt; on a first run gets read as "it worked" and a mix gets read as "it worked, partly". The mix is the more informative of the two: it tells you what was already true.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;Two things, and the first is the task's own fault rather than mine.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;0777&lt;/code&gt; is world-writable. Any local user on those three servers, including whatever account a compromised process is running as, can rewrite the page Apache serves. The file's content says "Please do not modify this file manually!", which the permissions then cheerfully invite.&lt;/p&gt;

&lt;p&gt;For a static page that Apache reads, &lt;code&gt;0644&lt;/code&gt; owned by &lt;code&gt;apache&lt;/code&gt; is sufficient, and &lt;code&gt;0444&lt;/code&gt; is sufficient if nothing is meant to change it between deployments. Nothing about serving a file requires write permission for anybody. The task asked for &lt;code&gt;0777&lt;/code&gt;, so the playbook is right, and it is worth knowing what was asked for.&lt;/p&gt;

&lt;p&gt;The second is mine. My verification was &lt;code&gt;cat&lt;/code&gt; on the file, and that is it. The task named three things: the content, the mode, and the ownership. I checked one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls -la /var/www/html/index.html    &lt;span class="c"&gt;# expect -rwxrwxrwx 1 apache apache&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One command, never run, on any of the three servers. It is also the command that would have caught a typo in the mode string, which is exactly the kind of thing a quoted octal is prone to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 2: A file from a VM into a private container
&lt;/h2&gt;

&lt;p&gt;The task: a storage account, a private blob container, and a file uploaded into it from a VM using the account key.&lt;/p&gt;

&lt;p&gt;First, the title. "Running Containers on Azure Virtual Machines" reads as Docker, and nothing in the requirements involves a container runtime. It is a blob container.&lt;/p&gt;

&lt;p&gt;Third time in this challenge, after Day 14's "Create and Attach" with no VM to attach to and Day 32's "Synchronizing Containers" for a single file copy. The title names a topic area; the numbered requirements are the contract.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: The code I got wrong
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;anon_list=409    anon_blob=409
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Days 17 and 19 recorded 404 for an anonymous request to a private container, on accounts where &lt;code&gt;allowBlobPublicAccess&lt;/code&gt; was &lt;code&gt;true&lt;/code&gt;. Here the account switch is &lt;code&gt;false&lt;/code&gt; and curl got 409 with &lt;code&gt;PublicAccessNotPermitted&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I wrote that up as a clean table: 404 means the container is private, 409 means the account forbids anonymous access. The error code and message are documented. The status code is not the one Microsoft gives:&lt;/p&gt;

&lt;p&gt;"After you disallow anonymous access for a storage account, clients that use the anonymous bearer challenge find that Azure Storage returns a 403 error (Forbidden) rather than a 401 error (Unauthorized)."&lt;/p&gt;

&lt;p&gt;403, with a qualifier that does the work: it applies to clients using the anonymous bearer challenge. &lt;code&gt;curl&lt;/code&gt; is not one. So the 409 I saw is real for that client and is not the number in the documentation.&lt;/p&gt;

&lt;p&gt;This is the second time in this series the same lesson has arrived. Two batches ago I corrected my Day 17 note, where the error code turned out to depend on the request's API version and the client's bearer-challenge support. Same thing again, in a different cell of the same table.&lt;/p&gt;

&lt;p&gt;The honest version:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Account setting&lt;/th&gt;
&lt;th&gt;Container&lt;/th&gt;
&lt;th&gt;Observed with curl&lt;/th&gt;
&lt;th&gt;Documented&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;allows&lt;/td&gt;
&lt;td&gt;private&lt;/td&gt;
&lt;td&gt;404&lt;/td&gt;
&lt;td&gt;not stated&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;allows&lt;/td&gt;
&lt;td&gt;&lt;code&gt;container&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;disallows&lt;/td&gt;
&lt;td&gt;anything&lt;/td&gt;
&lt;td&gt;409&lt;/td&gt;
&lt;td&gt;403 for bearer-challenge clients&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The conclusion survives as an observation rather than a rule: the code tells you which layer refused, and a 409 is stronger evidence of an account-wide guardrail than a 404. The documentation supports the substance from another angle, which is the part I would actually rely on: "Disallowing anonymous access for the storage account overrides the access settings for all containers in that storage account", and once it is off "you can't configure the access setting for a container to permit anonymous access".&lt;/p&gt;

&lt;p&gt;Two details from the same page worth having. The change takes "up to 30 seconds before the change is fully propagated". And it does not touch authenticated requests: "if the request is passed with an &lt;code&gt;Authorization&lt;/code&gt; header, the service ignores anonymous access on the storage account and authorizes the request based on the provided credentials". Which is why the upload worked perfectly well against a container that refuses anonymous reads.&lt;/p&gt;

&lt;p&gt;Which pairs with the morning more neatly than I expected. &lt;code&gt;inactive (dead)&lt;/code&gt; looks like a failure and is correct. A 409 looks like a definitive answer and is one of several codes the same condition can produce. Both are a status that means nothing until you know what produced it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Field names with no convention at all
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"content_md5"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"QiHQAs6108npE35JXOqmRw=="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"etag"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"\"0x8DF2D1DBDF9F49A\""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"lastModified"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2026-10-18T13:43:07+00:00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"request_server_encrypted"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;content_md5&lt;/code&gt; and &lt;code&gt;request_server_encrypted&lt;/code&gt; in snake_case. &lt;code&gt;lastModified&lt;/code&gt; in camelCase. In the same object.&lt;/p&gt;

&lt;p&gt;Day 32 found a whole response in snake_case, which was already an exception to the CLI's usual camelCase. This is worse, because there is no convention to learn, not even a per-command one. Sixth variant of this trap in the Azure track, and the fix has not changed: run the command with plain &lt;code&gt;-o json&lt;/code&gt; and read the shape before writing a &lt;code&gt;--query&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;Two things from this task I would reuse.&lt;/p&gt;

&lt;p&gt;Verify an upload by downloading it and hashing locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VM:        4221d002ceb5d3c9e9137e495ceaa647
Azure:     QiHQAs6108npE35JXOqmRw==
Download:  4221d002ceb5d3c9e9137e495ceaa647
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The upload response returned &lt;code&gt;content_md5&lt;/code&gt;, but the client computed that digest, so the service reporting it back only confirms the service recorded my own claim. Only the download and local hash close the loop independently.&lt;/p&gt;

&lt;p&gt;And pick the channel by who needs to own the result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-rw-rw-r-- 1 azureuser azureuser 20 Oct 18 13:40 /home/azureuser/testfile.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run Command runs as root, so a file created that way lands owned by &lt;code&gt;root:root&lt;/code&gt; in &lt;code&gt;/home/azureuser&lt;/code&gt;, which is wrong even with the right content, because &lt;code&gt;azureuser&lt;/code&gt; could not then modify it. SSH as &lt;code&gt;azureuser&lt;/code&gt; produced correct ownership with no &lt;code&gt;chown&lt;/code&gt; step.&lt;/p&gt;

&lt;p&gt;Which is exactly the question Days 84 through 86 kept running into on the Ansible side, where &lt;code&gt;become: yes&lt;/code&gt; meant root owned every file until Day 86 set &lt;code&gt;owner&lt;/code&gt; explicitly. Same decision, two different tools.&lt;/p&gt;

&lt;p&gt;One liability worth naming. The account key was passed over SSH, so it now sits in two shell histories, and anyone holding it has full access to every container in the account with no expiry and no identity in the logs. A managed identity with the Storage Blob Data Contributor role removes the secret from the VM entirely, and rotating the key with &lt;code&gt;az storage account keys renew&lt;/code&gt; is the honest end to any task that has moved one around.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Both halves kept the thing that matters somewhere other than where I had recorded it.&lt;/p&gt;

&lt;p&gt;blockinfile is the more surprising. A module with a reputation for being safe and repeatable turns out to have no memory at all: its entire record is two comment lines in your file, and anything that disturbs them, a tidy-up, a merge, another task sharing the default marker, makes the next run append a duplicate. Which is fine, as long as you know the comments are load-bearing rather than cosmetic.&lt;/p&gt;

&lt;p&gt;The small embarrassment on that half is that my own verification checked one of three requirements. The content was right. The mode and the owner were never looked at, on any of the three servers, and one &lt;code&gt;ls -la&lt;/code&gt; would have done it.&lt;/p&gt;

&lt;p&gt;The 409 is the more uncomfortable one, because I had written it down as the answer and put it in a table. It is the answer my client got. The documented answer for that condition is a different number, for a different kind of client, and the thing I should have recorded was the mechanism rather than the code.&lt;/p&gt;

&lt;p&gt;Which is twice now that an Azure error code I treated as a fact turned out to be client-dependent. The durable claim in both cases was the one about which layer refused, not the number it refused with.&lt;/p&gt;

&lt;p&gt;So here is the Day 88 question. Which green check or red error in your runbook is written down as a number rather than as the thing the number was telling you?&lt;/p&gt;

&lt;p&gt;Day 88 down. Twelve to go.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ansible</category>
      <category>azure</category>
      <category>automation</category>
    </item>
    <item>
      <title>Day 87: A Redirected Module and a Renamed Publisher</title>
      <dc:creator>Nnamdi Felix Ibe</dc:creator>
      <pubDate>Thu, 19 Nov 2026 18:00:00 +0000</pubDate>
      <link>https://dev.to/ndcodes/day-87-a-redirected-module-and-a-renamed-publisher-1280</link>
      <guid>https://dev.to/ndcodes/day-87-a-redirected-module-and-a-renamed-publisher-1280</guid>
      <description>&lt;p&gt;Day 87 of DevOps, Day 37 of Azure. Both tasks today turned on a name that is not the name the system uses.&lt;/p&gt;

&lt;p&gt;An Ansible task that says &lt;code&gt;yum&lt;/code&gt; runs the &lt;code&gt;dnf&lt;/code&gt; module, because the first is now a redirect to the second. And an Azure image "published by Jetware" is published by &lt;code&gt;jetware-srl&lt;/code&gt;, which no amount of guessing gets you to.&lt;/p&gt;

&lt;p&gt;One Ansible task, one Azure task. Install and start a service on three servers, then put MySQL on a VM and prove a PHP page can reach it. The tasks come from the KodeKloud Engineer platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 1: Install vsftpd and start it
&lt;/h2&gt;

&lt;p&gt;The task: a playbook that installs &lt;code&gt;vsftpd&lt;/code&gt; on all three app servers and starts it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Check it isn't there
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;tony@stapp01 ~&lt;span class="o"&gt;]&lt;/span&gt;$ sudo systemctl status vsftpd
Unit vsftpd.service could not be found.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same discipline as the last batch, and it is what makes &lt;code&gt;changed: [stapp01]&lt;/code&gt; mean "installed" rather than "already fine".&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: The playbook
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---
&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;hosts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;all&lt;/span&gt;
  &lt;span class="na"&gt;become&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;yes&lt;/span&gt;

  &lt;span class="na"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install vsftpd package.&lt;/span&gt;
      &lt;span class="na"&gt;yum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;vsftpd&lt;/span&gt;
        &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;present&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Starting the vsftpd service.&lt;/span&gt;
      &lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;vsftpd&lt;/span&gt;
        &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;started&lt;/span&gt;
        &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stapp01 : ok=3  changed=2   stapp02 : ok=3  changed=2   stapp03 : ok=3  changed=2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both modules are idempotent, so a second run reports &lt;code&gt;changed=0&lt;/code&gt;. Which, after Day 84's &lt;code&gt;state: touch&lt;/code&gt; reporting a change forever, is worth saying out loud: &lt;code&gt;package&lt;/code&gt; and &lt;code&gt;service&lt;/code&gt; describe a desired state, and a system already in that state needs no action.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;enabled: yes&lt;/code&gt; alongside &lt;code&gt;state: started&lt;/code&gt; is two separate claims, and the verification shows both:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     Loaded: loaded (/usr/lib/systemd/system/vsftpd.service; enabled; preset: d&amp;gt;
     Active: active (running) since Sat 2026-05-23 14:43:50 UTC; 11s ago
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;enabled&lt;/code&gt; in the first line means it comes back after a reboot. &lt;code&gt;active (running)&lt;/code&gt; in the second means it is up now. Day 23 made the same point about &lt;code&gt;systemctl enable --now&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: The task says yum and the module is dnf
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;ansible.builtin.yum&lt;/code&gt;'s documentation page now says one thing: "This is a redirect to the ansible.builtin.dnf module."&lt;/p&gt;

&lt;p&gt;So what executes is &lt;code&gt;dnf&lt;/code&gt;. The task name says yum, the playbook says yum, and the module doing the work is the dnf module. Which is correct for these servers, because Day 71 established the app servers are CentOS Stream 9, where &lt;code&gt;dnf&lt;/code&gt; is the package manager and &lt;code&gt;yum&lt;/code&gt; is a compatibility name.&lt;/p&gt;

&lt;p&gt;Three things follow, and they pull in different directions.&lt;/p&gt;

&lt;p&gt;The playbook is right as written. The redirect handles it, and nothing needs changing.&lt;/p&gt;

&lt;p&gt;It is misleading to read. Anyone debugging this is reading dnf's documentation whether they know it or not, and the two modules' parameters have not always matched.&lt;/p&gt;

&lt;p&gt;And it is not portable. Both &lt;code&gt;yum&lt;/code&gt; and &lt;code&gt;dnf&lt;/code&gt; commit the playbook to the RHEL family. &lt;code&gt;ansible.builtin.package&lt;/code&gt; dispatches to whatever the target actually uses, so the same playbook runs on Debian hosts too.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;For a lab that names yum, &lt;code&gt;yum&lt;/code&gt; is the right answer. For anything meant to outlive one distribution, &lt;code&gt;package&lt;/code&gt; is the module that does not need rewriting later.&lt;/p&gt;

&lt;p&gt;One other thing worth recording, and it is mildly annoying. The inventory for this task has &lt;code&gt;ansible_ssh_pass&lt;/code&gt; back in it, for all three hosts, in plain text. Day 82's whole task was removing exactly those, and Ansible's documentation says of &lt;code&gt;ansible_password&lt;/code&gt;, "never store this variable in plain text; always use a vault."&lt;/p&gt;

&lt;p&gt;Each lab starts fresh, so the plain-text passwords come back with it. The fix has to be redone every time, which is a reasonable description of security work generally.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 2: MySQL on one VM, PHP on another
&lt;/h2&gt;

&lt;p&gt;The task: a VM from a marketplace Percona image in Central US, a PHP VM in East US, and a page that connects across.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: The publisher is not the brand
&lt;/h3&gt;

&lt;p&gt;The task said "published by Jetware".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az vm image list --all --publisher jetware --location centralus
&lt;span class="o"&gt;(&lt;/span&gt;empty&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What I found was searching on a fragment rather than guessing the whole thing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az vm image list-publishers --location centralus --query &lt;span class="s2"&gt;"[?contains(name,'etware')].name"&lt;/span&gt; -o tsv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;etware&lt;/code&gt;, without the leading letter, because marketplace publisher names are inconsistently capitalised and both spellings are plausible. The answer is &lt;code&gt;jetware-srl&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Image identity is a four-part URN, and none of the parts are derivable from the product name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;jetware-srl : percona_mysql : percona_mysql57-ubuntu-1604 : 1.0.170503
publisher   : offer         : sku                         : version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Day 3 found the same for Canonical's Ubuntu offers, where the lesson was that offer names cannot be guessed. Here the publisher cannot either.&lt;/p&gt;

&lt;p&gt;Which is this morning's Ansible finding wearing different clothes. A module called &lt;code&gt;yum&lt;/code&gt; is a redirect to one called &lt;code&gt;dnf&lt;/code&gt;. A product called Jetware is published by &lt;code&gt;jetware-srl&lt;/code&gt;. Both times the name you are handed is not the name the system uses, and both times the cost of assuming is one lookup you did not do.&lt;/p&gt;

&lt;p&gt;Worth noting the image is from December 2017, on Ubuntu 16.04, with Percona 5.7.17. Marketplace images are frozen at publication, and this one has had no updates in nine years. Fine for a lab, a supply-chain problem anywhere else.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: A denial that told me nothing
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az vm image terms accept --urn $URN
(AuthorizationFailed) ... does not have authorization to perform action
'...agreements/read'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Marketplace images carry legal terms that must be accepted per subscription before deployment, and the lab identity cannot read or accept them.&lt;/p&gt;

&lt;p&gt;The tempting conclusion is that the image cannot be deployed. That does not follow. The denial is on reading the agreement, which says nothing about whether the agreement is already accepted. My permission to query a setting and the setting's value are independent facts.&lt;/p&gt;

&lt;p&gt;So I tried the create anyway, and it worked. The terms were already accepted for the subscription.&lt;/p&gt;

&lt;p&gt;This is the mirror of my Day 31 mistake, where a quota error left its &lt;code&gt;Location&lt;/code&gt; field blank and I concluded the limit was subscription-wide. Same error, opposite direction: an error about your ability to observe something is not evidence about the thing itself. Attempt the operation when it fails safely.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Three gates, checked separately
&lt;/h3&gt;

&lt;p&gt;Password authentication means no SSH key, so every in-guest operation went through Run Command, which runs as root and returns synchronously.&lt;/p&gt;

&lt;p&gt;A remote MySQL connection has three gates, and all three failures look alike from the PHP side:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gate&lt;/th&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Azure network&lt;/td&gt;
&lt;td&gt;&lt;code&gt;az network nsg rule list&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;open-port-3306&lt;/code&gt; at 1010&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MySQL user host&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SELECT user,host FROM mysql.user&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;xfusion_user&lt;/code&gt; / &lt;code&gt;%&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MySQL bind address&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SHOW VARIABLES LIKE 'bind_address'&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;*&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The bind address is the one most worth checking, because MySQL defaults to &lt;code&gt;127.0.0.1&lt;/code&gt; in many distributions, and a localhost-only bind defeats a correct NSG rule and a correct &lt;code&gt;%&lt;/code&gt; host with nothing to indicate why. This image binds to &lt;code&gt;*&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Checking all three before touching the PHP file meant a later failure could only be the PHP file.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;Two techniques from this task I would reuse, and one thing the task asks for that production should not.&lt;/p&gt;

&lt;p&gt;Base64 for awkward payloads. The SQL contains nested quotes and has to survive the local shell, the Run Command transport and the remote shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;SQL_B64&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s\n'&lt;/span&gt; &lt;span class="s2"&gt;"CREATE USER ... '%' ..."&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; base64 -w 0&lt;span class="o"&gt;)&lt;/span&gt;
az vm run-command invoke ... --scripts &lt;span class="s2"&gt;"echo $SQL_B64 | base64 -d &amp;gt; /tmp/s.sql; /jet/enter mysql &amp;lt; /tmp/s.sql"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Base64 output is only &lt;code&gt;A-Za-z0-9+/=&lt;/code&gt;, none of which any shell reinterprets. The quoting problem is sidestepped rather than solved, which is better.&lt;/p&gt;

&lt;p&gt;And probing an unfamiliar wrapper before scripting against it. &lt;code&gt;/jet/enter mysql&lt;/code&gt; is a Jetware convention and I had no idea whether it took &lt;code&gt;-e&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ls -la /jet
head -20 /jet/enter
/jet/enter mysql -e &lt;span class="s2"&gt;"SELECT VERSION();"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three cheap commands in one call, answering "does this work" and "if not, what next" at the same time. It turned out to be &lt;code&gt;exec /jet/own/bin/run "$@"&lt;/code&gt;, a thin wrapper that passes everything through.&lt;/p&gt;

&lt;p&gt;The thing production would not do is the architecture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PHP (eastus)  --public internet--&amp;gt;  MySQL (centralus, port 3306)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;MySQL's wire protocol is not encrypted by default, so credentials cross the internet in the clear. &lt;code&gt;az vm open-port&lt;/code&gt; with no source restriction opens 3306 to &lt;code&gt;0.0.0.0/0&lt;/code&gt;, defended by &lt;code&gt;password123&lt;/code&gt;. And every query pays cross-region latency for no benefit.&lt;/p&gt;

&lt;p&gt;The real shape is both VMs in peered VNets talking over private IPs, the NSG rule scoped to the peer's address space, TLS on the connection, and credentials from Key Vault instead of literals in a PHP file. Or Azure Database for MySQL with a private endpoint and no VM at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Two names, neither of which was the name.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;yum&lt;/code&gt; is the more interesting one because it is invisible. The playbook works, the output is clean, and the module that ran is not the one written in the file. You only find out by reading a documentation page that contains a single sentence.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;jetware-srl&lt;/code&gt; is the louder version. An empty result from a search is at least a signal that something is wrong, and the fix was searching a fragment instead of a guess.&lt;/p&gt;

&lt;p&gt;The one I would take into real work is the denial. An &lt;code&gt;AuthorizationFailed&lt;/code&gt; on reading the marketplace agreement looks like a wall, and all it says is that I cannot see the answer. The answer happened to be yes. Twice now in this series I have reasoned from the absence of information as though it were information, and twice the one command I had already written would have settled it.&lt;/p&gt;

&lt;p&gt;So here is the Day 87 question. What have you concluded recently from an error that only told you what you were not allowed to look at?&lt;/p&gt;

&lt;p&gt;Day 87 down. Thirteen to go.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ansible</category>
      <category>azure</category>
      <category>automation</category>
    </item>
    <item>
      <title>Day 86: A Per-Host Variable and an Account-Wide Rule</title>
      <dc:creator>Nnamdi Felix Ibe</dc:creator>
      <pubDate>Wed, 18 Nov 2026 18:00:00 +0000</pubDate>
      <link>https://dev.to/ndcodes/day-86-a-per-host-variable-and-an-account-wide-rule-538c</link>
      <guid>https://dev.to/ndcodes/day-86-a-per-host-variable-and-an-account-wide-rule-538c</guid>
      <description>&lt;p&gt;Day 86 of DevOps, Day 36 of Azure. Both tasks today were about a setting whose scope is not where you wrote it.&lt;/p&gt;

&lt;p&gt;In the Ansible half, that is the feature. One line in a playbook produced three different file owners in a single run, because the value comes from the inventory and the inventory is per host. In the Azure half, it is the hazard. A filter that reads like it names one container is a prefix on a policy that belongs to the entire storage account, and leaving the filter out means the rule deletes everything.&lt;/p&gt;

&lt;p&gt;One Ansible task, one Azure task. Create a file with the right permissions and owner on three servers, then set a lifecycle rule that deletes blobs after seven days. The tasks come from the KodeKloud Engineer platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 1: Three servers, three owners, one line
&lt;/h2&gt;

&lt;p&gt;The task: create &lt;code&gt;/tmp/nfsshare.txt&lt;/code&gt; on all three app servers with mode &lt;code&gt;0644&lt;/code&gt;, owned by that server's own user.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: The playbook
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---
&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;hosts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;app_servers&lt;/span&gt;
  &lt;span class="na"&gt;become&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;yes&lt;/span&gt;

  &lt;span class="na"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create empty file with proper permissions&lt;/span&gt;
      &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/tmp/nfsshare.txt&lt;/span&gt;
        &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;touch&lt;/span&gt;
        &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'0644'&lt;/span&gt;
        &lt;span class="na"&gt;owner&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"{{ ansible_user }}"&lt;/span&gt;
        &lt;span class="na"&gt;group&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"{{ ansible_user }}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[tony@stapp01 ~]$   -rw-r--r-- 1 tony tony     0 /tmp/nfsshare.txt
[steve@stapp02 ~]$  -rw-r--r-- 1 steve steve   0 /tmp/nfsshare.txt
[banner@stapp03 ~]$ -rw-r--r-- 1 banner banner 0 /tmp/nfsshare.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;{{ ansible_user }}&lt;/code&gt; is the inventory variable from Day 82, read back inside the playbook. The inventory sets it per host, so one line resolves to three different values in one run.&lt;/p&gt;

&lt;p&gt;Which is the clearest argument yet for the separation Day 83 described. The playbook describes the shape of what should exist. The inventory supplies the particulars. Neither file duplicates the other, and adding a fourth server changes one line in one file.&lt;/p&gt;

&lt;p&gt;It also means this playbook only works against an inventory that sets &lt;code&gt;ansible_user&lt;/code&gt; explicitly. A host relying on the default, which is whoever is running &lt;code&gt;ansible-playbook&lt;/code&gt;, has nothing to interpolate, and the task fails with an undefined variable rather than quietly picking something. Worth knowing because that failure happens at template time, not when the file is created.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: This is the day the ownership question gets answered
&lt;/h3&gt;

&lt;p&gt;Days 84 and 85 both created root-owned files, and neither mentioned it. The reason is in the module's defaults: &lt;code&gt;owner&lt;/code&gt; unspecified "uses the current user unless you are root, in which case it can preserve the previous ownership", and a file that did not exist has no previous ownership to preserve. With &lt;code&gt;become: yes&lt;/code&gt;, that is root every time.&lt;/p&gt;

&lt;p&gt;Two lines fix it, and this is the first of the three days to write them.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;Three things, and the first I got right for the documented reason.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mode: '0644'&lt;/code&gt; is quoted, which is what the documentation asks for: "For consistent results, quote octal numbers (for example, &lt;code&gt;'644'&lt;/code&gt; or &lt;code&gt;'1777'&lt;/code&gt;) so Ansible receives a string and can do its own conversion from string into number."&lt;/p&gt;

&lt;p&gt;The warning attached to it is about the unquoted form: "Adding a leading zero (for example, &lt;code&gt;0755&lt;/code&gt;) works sometimes, but can fail in loops and some other circumstances." Quoted, the leading zero is harmless. Unquoted, YAML gets to decide what &lt;code&gt;0644&lt;/code&gt; means, and that is the failure being described.&lt;/p&gt;

&lt;p&gt;The second is an assumption the playbook makes and does not state. &lt;code&gt;group: "{{ ansible_user }}"&lt;/code&gt; asks for a group named &lt;code&gt;tony&lt;/code&gt;, &lt;code&gt;steve&lt;/code&gt; and &lt;code&gt;banner&lt;/code&gt;. All three existed, so it worked, and that is a property of how those accounts were created rather than anything the playbook establishes. A new user on a RHEL-family system gets a private group of the same name by default, which is why the listing shows &lt;code&gt;tony tony&lt;/code&gt;. On a system where users share a group such as &lt;code&gt;users&lt;/code&gt;, this same playbook succeeds on the owner and fails on the group.&lt;/p&gt;

&lt;p&gt;The task's wording, that ownership and group "must be that of the users of the respective app-servers", reads as one requirement and is two lookups against two different databases. Omitting &lt;code&gt;group&lt;/code&gt; entirely is closer to what it means, because the system then resolves the user's actual primary group whatever it happens to be called.&lt;/p&gt;

&lt;p&gt;Third, this playbook is still not idempotent, and now for exactly one reason. &lt;code&gt;mode&lt;/code&gt;, &lt;code&gt;owner&lt;/code&gt; and &lt;code&gt;group&lt;/code&gt; are comparisons: the module reads the current value and reports a change only if it differs, so all three settle after the first run. &lt;code&gt;state: touch&lt;/code&gt; defaults both timestamps to &lt;code&gt;now&lt;/code&gt;, as Day 84 covered, so a second run reports &lt;code&gt;changed=1&lt;/code&gt; on all three hosts and the only thing that changed is two timestamps nobody asked about.&lt;/p&gt;

&lt;p&gt;Three days, three playbooks, and the pattern is clear enough to state. &lt;code&gt;file&lt;/code&gt; is the only module in this batch that is not idempotent by default, and it is the one I used twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 2: A rule that deletes blobs after seven days
&lt;/h2&gt;

&lt;p&gt;The task: a lifecycle rule on a container, deleting blobs seven days after their last modification.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: There is no such thing as a rule on a container
&lt;/h3&gt;

&lt;p&gt;Azure has one management policy per storage account. Container scoping happens inside the rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"filters"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"blobTypes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"blockBlob"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"prefixMatch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"nautilus-container21738529"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;prefixMatch&lt;/code&gt; is a blob path prefix, and because a blob's full path begins with its container name, the container name alone scopes the rule to that container. More specific prefixes work too, so adding &lt;code&gt;/logs/&lt;/code&gt; would hit only that virtual folder, which is the flat-namespace behaviour from Day 18.&lt;/p&gt;

&lt;p&gt;Leave &lt;code&gt;prefixMatch&lt;/code&gt; out, and the rule applies to every blob in the account. For a delete action, that is the difference between tidying one container and emptying a storage account on a seven-day rolling basis.&lt;/p&gt;

&lt;p&gt;Which is the Ansible half inverted. There, one line resolving differently per host is the feature. Here, a filter that looks like it names a container is a prefix on an account-wide policy, and the scope is wider than the place you wrote it.&lt;/p&gt;

&lt;p&gt;Azure's own documentation signals this trips people up without explaining the mechanism. The configuration page's only mention of prefixes is a link to an FAQ entry named for the symptom: "The blob prefix match string didn't apply the policy to the expected blobs".&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: The policy replaces, and that is the service
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az storage account management-policy create --account-name &lt;span class="nv"&gt;$SA&lt;/span&gt; -g &lt;span class="nv"&gt;$RG&lt;/span&gt; --policy &lt;span class="s1"&gt;'{"rules":[...]}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;create&lt;/code&gt; sets the entire policy. I had written this up as CLI behaviour, and it is stated more strongly than that, as a property of the service: "You must read or write a lifecycle management policy in full. The service doesn't support partial updates."&lt;/p&gt;

&lt;p&gt;So adding a second rule later means reading the current policy, appending to its &lt;code&gt;rules&lt;/code&gt; array, and writing the whole thing back. Running &lt;code&gt;create&lt;/code&gt; again with just the new rule silently removes the first one.&lt;/p&gt;

&lt;p&gt;Third instance of the same pattern in this challenge:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Day&lt;/th&gt;
&lt;th&gt;Operation&lt;/th&gt;
&lt;th&gt;Replaces&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;&lt;code&gt;az resource tag&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;All tags&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS 46&lt;/td&gt;
&lt;td&gt;&lt;code&gt;put-bucket-notification-configuration&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;All notifications&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;36&lt;/td&gt;
&lt;td&gt;&lt;code&gt;management-policy create&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;All lifecycle rules&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Step 3: Modification is not creation
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Condition&lt;/th&gt;
&lt;th&gt;Clock starts at&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;daysAfterModificationGreaterThan&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Last write to the blob&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;daysAfterCreationGreaterThan&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Blob creation&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The task said "7 days of last modification", so the first. They diverge for anything rewritten: a blob overwritten weekly never ages past seven days under the modification rule, and would be deleted on schedule under the creation rule. For a retention policy, that distinction decides whether active data survives.&lt;/p&gt;

&lt;p&gt;Worth adding that delete is not the only action available. &lt;code&gt;tierToCool&lt;/code&gt;, &lt;code&gt;tierToCold&lt;/code&gt; and &lt;code&gt;tierToArchive&lt;/code&gt; move blobs to cheaper storage rather than destroying them, which is usually the better first move if the goal is cost. This task asked for deletion.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;Here is the thing I cannot do, and would rather say than imply otherwise.&lt;/p&gt;

&lt;p&gt;"Azure Storage runs the policy once per day", and the blob is seven days from being eligible. So there is no way to observe this rule working inside a one-hour lab, or any reasonable session.&lt;/p&gt;

&lt;p&gt;Which makes this a genuine exception to the rule these notes keep arriving at. Day 28 failed because behaviour was proven and the configuration was wrong. Day 38 failed because the configuration was right and behaviour was never tested. The resolution both times was to check both.&lt;/p&gt;

&lt;p&gt;Here behaviour is unobservable on a human timescale. So verification was configuration only, read back from the service rather than trusting the create response, with each requirement pulled out as its own field so a missing one is visible:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"Name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"nautilus-del-rule"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"Enabled"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"DeleteAfterDays"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;7.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"Prefix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"nautilus-container21738529"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"BlobTypes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"blockBlob"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Saying "the rule works" would be an inference dressed as a result. What would strengthen it in a real environment is the lifecycle management log category, which records what each rule matched and deleted on each run.&lt;/p&gt;

&lt;p&gt;Two smaller findings. &lt;code&gt;DeleteAfterDays&lt;/code&gt; came back as &lt;code&gt;7.0&lt;/code&gt; having been sent as &lt;code&gt;7&lt;/code&gt;, because the API models it as a number rather than an integer, so a scripted check needs a numeric comparison and not a string one. And two claims from my own notes I could not source this time, so they are marked unverified rather than repeated: that the first run after a policy change can take up to 48 hours, and that lifecycle management requires a &lt;code&gt;StorageV2&lt;/code&gt; account.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Scope, twice, pointing in opposite directions.&lt;/p&gt;

&lt;p&gt;The Ansible playbook is the version where this works for you. One line, three results, because the value lives in the inventory and the inventory knows about hosts. That is a tool designed so the thing you write once stays written once.&lt;/p&gt;

&lt;p&gt;The Azure rule is the version where it works against you. The task says container, the resource is an account, and the only thing standing between "delete blobs in this container" and "delete everything in this storage account" is a filter that is easy to leave out and that the documentation barely explains. It runs once a day, it does not ask, and if soft delete is off, which is the default, there is no undo.&lt;/p&gt;

&lt;p&gt;And the honest part of today is the bit I could not finish. The rule's configuration is verified exhaustively, and its behaviour is not verified at all, because nobody can watch a seven-day timer in a one-hour lab. Every other day in this series ends with a check that something actually happened. This one ends with a careful description of what was configured and a sentence saying which kind of check was possible.&lt;/p&gt;

&lt;p&gt;So here is the Day 86 question. Which of your scheduled deletion rules has anyone watched actually run?&lt;/p&gt;

&lt;p&gt;Day 86 down. Fourteen to go.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ansible</category>
      <category>azure</category>
      <category>automation</category>
    </item>
    <item>
      <title>Part 6: The Walkthrough That Only Worked on My Machine</title>
      <dc:creator>Nnamdi Felix Ibe</dc:creator>
      <pubDate>Wed, 18 Nov 2026 06:43:15 +0000</pubDate>
      <link>https://dev.to/ndcodes/part-6-the-walkthrough-that-only-worked-on-my-machine-15e8</link>
      <guid>https://dev.to/ndcodes/part-6-the-walkthrough-that-only-worked-on-my-machine-15e8</guid>
      <description>&lt;p&gt;This is Part 6 of a series building an HL7 v2-to-FHIR R4 interoperability service in public. The repository is &lt;a href="https://github.com/ND-codes/nhs-interop-platform" rel="noopener noreferrer"&gt;ND-codes/nhs-interop-platform&lt;/a&gt;,&lt;br&gt;
and the code as it stood for this article is tagged &lt;code&gt;part-6&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This week's plan was a ten-minute tour of the repository and the questions an interviewer asks about it. Before writing the tour, I did the obvious thing and followed the one I already had.&lt;/p&gt;

&lt;p&gt;It doesn't work on a machine that isn't mine. Not in a subtle way.&lt;/p&gt;
&lt;h2&gt;
  
  
  A walkthrough is a promise
&lt;/h2&gt;

&lt;p&gt;Most of what a repository claims is hard to check. A threat model, an&lt;br&gt;
architecture diagram, a note about scaling: a reader takes those on trust or not at all.&lt;/p&gt;

&lt;p&gt;A quickstart is different. It is a sequence of commands with stated outcomes, and the reader finds out within minutes whether you were telling the truth. It is the most falsifiable document in the repository and usually the least tested, because the author is the one person who can never run it fresh.&lt;/p&gt;

&lt;p&gt;Mine had four failures. Three of them break on the reader's machine and work perfectly on mine. The fourth was not about machines at all.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;code&gt;make test&lt;/code&gt; could not run outside Git Bash
&lt;/h2&gt;

&lt;p&gt;Step 7 of my quickstart said &lt;code&gt;make test&lt;/code&gt;. The recipe:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;docker run --rm -v &lt;span class="s2"&gt;"$$(cygpath -m $$(cd services/$$svc &amp;amp;&amp;amp; pwd))"&lt;/span&gt;:/app -w //app python:3.12-slim \
  sh -c &lt;span class="s2"&gt;"pip install -q -r requirements-dev.txt &amp;amp;&amp;amp; pytest -q"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;cygpath&lt;/code&gt; converts a Windows path into the &lt;code&gt;C:/&lt;/code&gt; form Docker wants. It exists&lt;br&gt;
in Git Bash on Windows and nowhere else. On macOS or Linux that line is&lt;br&gt;
&lt;code&gt;cygpath: command not found&lt;/code&gt;, and &lt;code&gt;make test&lt;/code&gt; and &lt;code&gt;make lint&lt;/code&gt; both die on the&lt;br&gt;
first service.&lt;/p&gt;

&lt;p&gt;I work in Git Bash on Windows. It had never once failed for me, which is the entire problem.&lt;/p&gt;

&lt;p&gt;The fix keeps the Windows behaviour exactly and adds the other path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;abs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; services/&lt;span class="nv"&gt;$svc&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nv"&gt;wd&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/app &lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;command&lt;/span&gt; -v cygpath &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null 2&lt;span class="o"&gt;&amp;gt;&amp;amp;&lt;/span&gt;1 &lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="nv"&gt;abs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;cygpath -m &lt;span class="s2"&gt;"$abs"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nv"&gt;wd&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;//app &lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;fi&lt;/span&gt; &lt;span class="o"&gt;;&lt;/span&gt;
docker run --rm -v &lt;span class="s2"&gt;"$abs"&lt;/span&gt;:/app -w &lt;span class="s2"&gt;"$wd"&lt;/span&gt; python:3.12-slim ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The doubled &lt;code&gt;//app&lt;/code&gt; is the other half of the same problem. MSYS rewrites a leading &lt;code&gt;/app&lt;/code&gt; into a Windows path, so Git Bash needs it doubled and nothing else does. Both branches were tested, the second by putting a fake &lt;code&gt;cygpath&lt;/code&gt; on &lt;code&gt;PATH&lt;/code&gt;. Then the Git Bash branch ran for real on my machine: 92 tests, all&lt;br&gt;
passing.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;code&gt;make integration&lt;/code&gt; installed into the system interpreter
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;python3 -m pip install --quiet httpx pytest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;On Debian, Ubuntu and Homebrew Python 3.11 and later, that is refused outright. PEP 668 lets a distribution mark its base interpreter as externally managed, and pip then declines with &lt;code&gt;error: externally-managed-environment&lt;/code&gt;. It works on my machine because my Python is not marked that way.&lt;/p&gt;

&lt;p&gt;It builds a throwaway virtualenv now, with a &lt;code&gt;bin&lt;/code&gt; and &lt;code&gt;Scripts&lt;/code&gt; fallback so the same line works in Git Bash.&lt;/p&gt;
&lt;h2&gt;
  
  
  A file the quickstart told you to copy did not exist
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cp terraform.tfvars.example terraform.tfvars
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;There was no &lt;code&gt;terraform.tfvars.example&lt;/code&gt;. There never had been. You only find that by following your own instructions as though you had not written them.&lt;/p&gt;
&lt;h2&gt;
  
  
  The alert that reached nobody
&lt;/h2&gt;

&lt;p&gt;The fourth is the one worth the article, and I did not find it. Nan, a reader of Part 4, did.&lt;/p&gt;

&lt;p&gt;Part 4 was about an alert that could never fire, because it watched a metric no service exported. I fixed that, exported the gauge, wrote the rule unit tests, added the runbook sections, and built scripts to open the circuit breaker on purpose so you could watch &lt;code&gt;PDSCircuitOpen&lt;/code&gt; go Firing.&lt;/p&gt;

&lt;p&gt;Nan's question was roughly: and then who gets told?&lt;/p&gt;

&lt;p&gt;Nobody. Here is the whole chain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;observability/alertmanager/alertmanager.yml&lt;/code&gt; exists, and is a reasonable config. It routes by severity, groups by alertname and service, and has an inhibit rule.&lt;/li&gt;
&lt;li&gt;Nothing starts an Alertmanager. There is no such service in Docker Compose and no such manifest anywhere in &lt;code&gt;k8s/&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;prometheus.yml&lt;/code&gt; had no &lt;code&gt;alerting&lt;/code&gt; block, so even if one had been running, Prometheus did not know where it was.&lt;/li&gt;
&lt;li&gt;That config's &lt;code&gt;smtp_smarthost&lt;/code&gt; pointed at &lt;code&gt;mailhog:1025&lt;/code&gt;. No file in the repository has ever started a mailhog.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the rules evaluated, turned red in the Prometheus UI, and stopped there.&lt;br&gt;
Meanwhile &lt;code&gt;docs/architecture.md&lt;/code&gt; said "Alertmanager routes pages" and the runbook's prerequisites told the on-call engineer they would need access to "the alerts Slack/PagerDuty queue".&lt;/p&gt;

&lt;p&gt;Part 4 made the alert fireable. Part 5 made the documentation honest about the controls. Neither of us noticed that the last hop did not exist, and it is the hop that makes the other two matter. An alert nobody receives is a dashboard.&lt;/p&gt;

&lt;p&gt;The fix is small, which is the irritating part:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;alerting&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;alertmanagers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;static_configs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;targets&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'alertmanager:9093'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Plus two services in Compose. Alertmanager and Mailpit as the destination: a disposable SMTP sink with a web inbox, which holds mail in memory and forwards it nowhere. That is what makes it safe to point a demo at. I used Mailpit rather than the MailHog the old config named, because MailHog has not been released since 2020 and Part 5 was about not shipping things you would not defend.&lt;/p&gt;

&lt;p&gt;Now &lt;code&gt;make break-pds&lt;/code&gt; opens the breaker, &lt;code&gt;PDSCircuitOpen&lt;/code&gt; goes Firing about two minutes later, and the notification arrives at a web inbox on port 8025 where you can read it. The whole path, end to end, is a demo you can run on a laptop.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhjcxf9vspxmzgf2knp6x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhjcxf9vspxmzgf2knp6x.png" alt="Prometheus alerts page showing PDSCircuitOpen in the Firing state, with the rule expression pybreaker_state equals 1 for 2 minutes, its runbook link and summary" width="800" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcr1clrsi0truaijavn5j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcr1clrsi0truaijavn5j.png" alt="Mailpit inbox with four alert emails, two PDSCircuitOpen and two IngestNoTraffic, and the newest PDSCircuitOpen email open showing its labels, runbook link and summary" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I ran it on 17 November, and again this morning for the screenshots. The subject line began &lt;code&gt;[FIRING:1] PDSCircuitOpen transform&lt;/code&gt;. Six parts in, it is the first alert this project has ever delivered to anything.&lt;/p&gt;

&lt;p&gt;The inbox also holds two &lt;code&gt;IngestNoTraffic&lt;/code&gt; alerts I did not ask for. I checked the rule in &lt;code&gt;alerts.yml&lt;/code&gt; before calling it a fault: it fires once ingest has gone 15 minutes without an HL7 message, and the stack sat idle overnight. So it is expected, but a demo stack left running will email you about its own quiet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making the tour testable
&lt;/h2&gt;

&lt;p&gt;The underlying failure is that a quickstart is prose, and prose does not run in CI. So the tour is now a script, and &lt;code&gt;make walkthrough&lt;/code&gt; runs it.&lt;/p&gt;

&lt;p&gt;Eight checks. The stack is up, ingest accepts an ADT, the Patient reaches FHIR keyed on the NHS number, a lab result produces Observations, Prometheus is scraping every service, Prometheus has discovered an Alertmanager, Alertmanager is healthy, and the inbox is reachable. Each one fails loudly and stops.&lt;/p&gt;

&lt;p&gt;The sixth is the one that would have caught Nan's finding:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;discovered&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$(&lt;/span&gt;curl -sf &lt;span class="s2"&gt;"$PROM/api/v1/alertmanagers"&lt;/span&gt; \
  &lt;span class="o"&gt;|&lt;/span&gt; python3 -c &lt;span class="s1"&gt;'import json,sys; print(len(json.load(sys.stdin)["data"]["activeAlertmanagers"]))'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"$discovered"&lt;/span&gt; -ge 1 &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; fail &lt;span class="s2"&gt;"Prometheus has no active Alertmanager."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two small things I would do again. The FHIR checks parse the Bundle rather than grepping for &lt;code&gt;"total"&lt;/code&gt;, because the whitespace is not guaranteed and a grep for that string also matches a zero. And the Mailpit check asserts reachability but reads the message count defensively, because I could not get Mailpit's API documentation to load and I was not willing to assert a field name I had not seen. A schema change should not turn a working inbox into a failed tour.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tour failed its own first run
&lt;/h2&gt;

&lt;p&gt;The script was written and checked without a Docker daemon. The first time it ran against a real stack, it stopped at check 3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[3/8] The Patient reaches FHIR, keyed on the NHS number
      FAIL the Patient did not become true within 30s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Patient was there. Asking HAPI for a count returned one. The query was the problem. A FHIR token search separates system and code with a pipe,&lt;br&gt;
&lt;code&gt;identifier=https://fhir.nhs.uk/Id/nhs-number|9000000009&lt;/code&gt;, and RFC 3986 does&lt;br&gt;
not allow an unencoded &lt;code&gt;|&lt;/code&gt; in a query string. HAPI runs on Tomcat, which enforces that by default and answers HTTP 400.&lt;/p&gt;

&lt;p&gt;The 400 never reached the screen. &lt;code&gt;curl -sf&lt;/code&gt; turns any HTTP error into a silent non-zero exit, and the retry loop read that as "not there yet". Thirty seconds later it reported a missing Patient that was never missing.&lt;/p&gt;

&lt;p&gt;The fix is &lt;code&gt;%7C&lt;/code&gt; in place of the pipe, in the script and in the quickstart. The quickstart needed it too: Tomcat's own documentation says the major browsers send that character unencoded, so the link would have failed in a browser as well.&lt;/p&gt;

&lt;p&gt;This is the alert story again, at a smaller scale. A check that cannot tell "not found" from "you asked the wrong way" will pass or fail for the wrong reason, and you only find out by running it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fls1d8v825s82anxk3mj0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fls1d8v825s82anxk3mj0.png" alt="Terminal output of make walkthrough with all eight checks reporting ok, including check 3 finding the Patient at a URL with the pipe encoded as %7C" width="800" height="576"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Four things the architecture document still claimed
&lt;/h2&gt;

&lt;p&gt;While I was at it. &lt;code&gt;docs/architecture.md&lt;/code&gt; said messages are dead-lettered to S3, which Part 5 established is false. It said GitLab CI gates quality, two weeks after we deleted &lt;code&gt;.gitlab-ci.yml&lt;/code&gt;. It said CI pushes to an image registry, which it does not, because there is nowhere to push to. And it said "every request is traced", when what actually exists is a trace id carried in log lines. That is correlation, not distributed tracing, and there is no OpenTelemetry in any of these services.&lt;/p&gt;

&lt;p&gt;All four are corrected in place, with a short note saying what each one used to claim. Quietly editing them would have been tidier and worse.&lt;/p&gt;

&lt;h2&gt;
  
  
  The questions an interviewer actually asks
&lt;/h2&gt;

&lt;p&gt;This is the other half of what Part 6 was meant to cover, and the walkthrough work made it easier rather than harder, because the questions people ask about a system are mostly the ones a broken walkthrough exposes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Walk me through what happens to a message.
&lt;/h3&gt;

&lt;p&gt;It arrives at &lt;code&gt;POST /hl7&lt;/code&gt; on ingest, which validates the MSH segment and assigns a trace id. Transform parses it, maps it to a FHIR R4 transaction Bundle, optionally enriches the Patient from PDS, and writes the Bundle to HAPI FHIR with a conditional update keyed on the NHS number. Failures dead-letter to a local path. The trace id&lt;br&gt;
follows the message through all three services.&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens when PDS is down?
&lt;/h3&gt;

&lt;p&gt;Enrichment fails open. A circuit breaker&lt;br&gt;
opens after five consecutive failures, and the pipeline keeps writing Patients with locally derived demographics. Data quality degrades; no clinical message is dropped. That is a deliberate trade-off and it is the seventh Caldicott principle in practice, the one that says the duty to share can matter as much as the duty to protect. You can watch it with &lt;code&gt;make break-pds&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Who gets paged?
&lt;/h3&gt;

&lt;p&gt;Until this week, nobody, and I would say exactly that. The&lt;br&gt;
rules evaluated and notified no one. It is fixed for the local stack and still missing in Kubernetes. A question like this is a gift, because the honest answer is more interesting than the tidy one.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do you know the mapping is correct?
&lt;/h3&gt;

&lt;p&gt;Unit tests per defect, each written to fail against the previous code. Part 3 covers nine specific ways an HL7 v2 to FHIR mapping goes wrong, most of them found by readers. The honest limit is that there is no conformance suite and no validation against the HL7 v2 to FHIR&lt;br&gt;
implementation guide; the tests encode the defects we know about.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where does patient data live and for how long?
&lt;/h3&gt;

&lt;p&gt;Mapped fields in HAPI FHIR on Postgres. Complete raw messages in the dead-letter path, which holds more patient data than the FHIR store does, for up to 72 hours. That retention is new as of Part 5 and the path still does not survive a pod restart.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the worst bug you have shipped here?
&lt;/h3&gt;

&lt;p&gt;Part 4's fix for the alert that could never fire. The circuit breaker was applied as a decorator to a coroutine function, so it counted the returned coroutine object as a success and never opened, which means the gauge I had just added and the alert I had just made fireable still could not fire. The test passed because it drove the breaker synchronously. I found it by running the stack.&lt;/p&gt;

&lt;h3&gt;
  
  
  How would you scale it?
&lt;/h3&gt;

&lt;p&gt;The ingest-to-transform hop is synchronous HTTP,&lt;br&gt;
which keeps the local demo one command and is the first thing I would replace with an SQS FIFO queue using the NHS number as the message group id so a patient's messages stay ordered. Beyond that the services are stateless and scale horizontally; the bottleneck is the FHIR write path.&lt;/p&gt;

&lt;h3&gt;
  
  
  What would you do differently?
&lt;/h3&gt;

&lt;p&gt;Wrote the documentation last. Almost every false claim in this repository was true of the design at the moment it was&lt;br&gt;
written and never revisited.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did not fix
&lt;/h2&gt;

&lt;p&gt;There is still no Alertmanager in the Helm charts, so the Kubernetes path notifies nobody. I did not write one, because I cannot deploy a cluster to test it and shipping untested YAML two days before publishing is the exact thing Part 5 was about. It is in the "Claimed, not built" section of &lt;code&gt;docs/security.md&lt;/code&gt; and a roadmap issue.&lt;/p&gt;

&lt;p&gt;There is no paging integration anywhere. The Alertmanager config has a PagerDuty receiver commented out and has never been pointed at a routing key.&lt;/p&gt;

&lt;p&gt;Correction: an earlier version of this paragraph said&lt;br&gt;
&lt;code&gt;make restore-pds&lt;/code&gt; does not clear the alert and that the script should send a message. It already does. It waits out the 30-second reset timeout and sends three synthetic messages, and has since Part 4. I described the script from what I saw on the dashboard instead of reading it.&lt;/p&gt;

&lt;p&gt;The real gap is the other end. Alertmanager's email receiver does not send a resolved notification unless you ask it to; &lt;code&gt;send_resolved&lt;/code&gt; defaults to false for email, though it defaults to true for webhooks and PagerDuty. So the inbox tells you an incident started and never tells you it ended. That is next week's pull request.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq0a90i5nogulu7ywfbil.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq0a90i5nogulu7ywfbil.png" alt="Grafana PDS circuit breaker panel holding at 1, open, for about seven minutes before dropping back to 0" width="800" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The retry loop still hides the status code. The pipe is fixed, but the next malformed query would fail the same silent way.&lt;/p&gt;

&lt;p&gt;And I have not timed the tour on a second machine. The series plan called this part a ten-minute walkthrough; the document now says the figure should be yours rather than mine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worth stealing
&lt;/h2&gt;

&lt;p&gt;Run your own quickstart on a machine you did not configure. A colleague's, a fresh VM, a container. The author is the one person who cannot test it.&lt;/p&gt;

&lt;p&gt;Grep your build tooling for anything platform-specific. &lt;code&gt;cygpath&lt;/code&gt;, &lt;code&gt;open&lt;/code&gt;, &lt;code&gt;sed -i&lt;/code&gt; with a bare &lt;code&gt;-i&lt;/code&gt;, &lt;code&gt;realpath&lt;/code&gt;, &lt;code&gt;date -d&lt;/code&gt;. Each one quietly scopes your repository to one operating system.&lt;/p&gt;

&lt;p&gt;Make the tour a target. Prose cannot run in CI; a script can, and then the document and the repository cannot drift apart silently.&lt;/p&gt;

&lt;p&gt;Check the last hop of anything that is supposed to tell a human. Working alert rules that notify nobody look identical to working alerting from inside the repository.&lt;/p&gt;

&lt;p&gt;Correct a stale claim in place, with a line saying what it used to say. The&lt;br&gt;
edit history is not where a reader looks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where AI helps here, and where it doesn't
&lt;/h2&gt;

&lt;p&gt;I built this with Claude Code, and this week drew the line unusually clearly.&lt;/p&gt;

&lt;p&gt;Reading the Makefile and noticing that &lt;code&gt;cygpath&lt;/code&gt; is Git Bash only is exactly the kind of thing it is good at. So is knowing that PEP 668 would refuse the pip line, and checking &lt;code&gt;terraform.tfvars.example&lt;/code&gt; against the variables that are actually declared. That sweep took minutes, and I would not have done it by hand two days before publishing.&lt;/p&gt;

&lt;p&gt;But none of that is the same as running the thing. It wrote and checked this week's changes in a sandbox with no Docker daemon, so "works on my machine" problems were invisible to it by construction. It found the &lt;code&gt;cygpath&lt;/code&gt; problem by reading, after I pointed it at the walkthrough, which is not the same as the problem announcing itself.&lt;/p&gt;

&lt;p&gt;The walkthrough script is the clearest example. It was reviewed, shellchecked and clean, and it failed its first real run on a URL encoding rule. Once the stack was up on my machine, the same assistant ran the query directly, found the 400 in about a minute, and checked the fix against the RFC and Tomcat's documentation. Reading wrote the bug. Running found it.&lt;/p&gt;

&lt;p&gt;The alert delivery gap is the sharper case. It was not found by reading at all, by a model or by me. Nan found it by asking the one question neither of us had: and then who gets told? Two articles in a row went past it while looking directly at the alerting configuration.&lt;/p&gt;

&lt;p&gt;The pattern I would now state plainly, three weeks running: reading finds inconsistencies, running finds defects, and other people find the questions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://peps.python.org/pep-0668/" rel="noopener noreferrer"&gt;PEP 668&lt;/a&gt;, on externally managed Python environments&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/" rel="noopener noreferrer"&gt;Prometheus configuration&lt;/a&gt;, for the top-level &lt;code&gt;alerting&lt;/code&gt; block&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://prometheus.io/docs/prometheus/latest/querying/api/" rel="noopener noreferrer"&gt;Prometheus HTTP API&lt;/a&gt;, for the &lt;code&gt;/api/v1/alertmanagers&lt;/code&gt; response shape&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.rfc-editor.org/rfc/rfc3986#section-3.4" rel="noopener noreferrer"&gt;RFC 3986, section 3.4&lt;/a&gt;, the characters allowed in a URI query&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://tomcat.apache.org/tomcat-10.1-doc/config/http.html" rel="noopener noreferrer"&gt;Apache Tomcat HTTP connector&lt;/a&gt;, &lt;code&gt;relaxedQueryChars&lt;/code&gt; and the characters rejected by default&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mailpit.axllent.org/docs/install/docker/" rel="noopener noreferrer"&gt;Mailpit, Docker install&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.gov.uk/government/publications/the-caldicott-principles" rel="noopener noreferrer"&gt;The Caldicott Principles&lt;/a&gt;, National Data Guardian&lt;/li&gt;
&lt;li&gt;Alertmanager and Prometheus configurations in this article were validated with &lt;code&gt;amtool check-config&lt;/code&gt; 0.34.1 and &lt;code&gt;promtool check config&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[Alertmanager configuration (&lt;a href="https://prometheus.io/docs/alerting/latest/configuration/" rel="noopener noreferrer"&gt;https://prometheus.io/docs/alerting/latest/configuration/&lt;/a&gt;), for the &lt;code&gt;send_resolved&lt;/code&gt; defaults&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Next
&lt;/h2&gt;

&lt;p&gt;Part 7 is the last one: where AI fits in this work and where it does not, with seven weeks of specifics rather than opinions.&lt;/p&gt;

&lt;p&gt;If you have a quickstart in a repository you maintain, run it somewhere else this week. What broke first?&lt;/p&gt;




&lt;p&gt;This is a personal project. It is not affiliated with or endorsed by NHS England or any NHS organisation. It uses the public PDS FHIR sandbox and synthetic test data only. Views are my own.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>ai</category>
      <category>programming</category>
      <category>career</category>
    </item>
    <item>
      <title>Day 85: A Task That Always Changes and Two Halves</title>
      <dc:creator>Nnamdi Felix Ibe</dc:creator>
      <pubDate>Tue, 17 Nov 2026 18:00:00 +0000</pubDate>
      <link>https://dev.to/ndcodes/day-85-one-direction-and-two-halves-5cic</link>
      <guid>https://dev.to/ndcodes/day-85-one-direction-and-two-halves-5cic</guid>
      <description>&lt;p&gt;Day 85 of DevOps, Day 35 of Azure. Both tasks today reported a state that is a word rather than a fact.&lt;/p&gt;

&lt;p&gt;An Ansible playbook reported &lt;code&gt;changed=1&lt;/code&gt;, and it would have reported that on every run for the rest of time, whether or not anything was different. And an Azure peering that was created reported a state, and moved no packets at all, because a peering is two resources and I had made one.&lt;/p&gt;

&lt;p&gt;One Ansible task, one Azure task. Write a playbook that creates a file, then peers two virtual networks. The tasks come from the KodeKloud Engineer platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 1: A playbook that creates a file
&lt;/h2&gt;

&lt;p&gt;The task: a playbook that creates an empty &lt;code&gt;/tmp/file.txt&lt;/code&gt; on App Server 01.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Look before you run
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;tony@stapp01 ~&lt;span class="o"&gt;]&lt;/span&gt;$ ls /tmp
systemd-private-...   &lt;span class="o"&gt;(&lt;/span&gt;no file.txt&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the step that makes the result mean something, and the next section is why. A file that was already there would produce an identical task result, so the before-check is the only thing that distinguishes creating a file from doing nothing to one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: The playbook
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---
&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;hosts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;app_server&lt;/span&gt;
  &lt;span class="na"&gt;become&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;yes&lt;/span&gt;

  &lt;span class="na"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create empty file&lt;/span&gt;
      &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/tmp/file.txt&lt;/span&gt;
        &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;touch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TASK [Create empty file] ***************  changed: [stapp01]
PLAY RECAP ***************  stapp01 : ok=2  changed=1  unreachable=0  failed=0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then after, &lt;code&gt;ls&lt;/code&gt; shows the file and &lt;code&gt;cat&lt;/code&gt; shows nothing, which is the check for "empty" and worth actually running. &lt;code&gt;touch&lt;/code&gt; creates an empty file; a &lt;code&gt;copy&lt;/code&gt; or &lt;code&gt;lineinfile&lt;/code&gt; task would not.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: That task will report a change forever
&lt;/h3&gt;

&lt;p&gt;Yesterday's playbook installed a package and started a service, and a second run reports &lt;code&gt;changed=0&lt;/code&gt;. Both modules describe a desired state, and a system already in that state needs no action. That is the property Ansible is usually sold on.&lt;/p&gt;

&lt;p&gt;This playbook does not have it, and the reason is a default that applies to exactly one state.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;access_time&lt;/code&gt; and &lt;code&gt;modification_time&lt;/code&gt; default to &lt;code&gt;None&lt;/code&gt;,"meaning that &lt;code&gt;preserve&lt;/code&gt; is the default for &lt;code&gt;state=[file,directory,link,hard]&lt;/code&gt;" while "&lt;code&gt;now&lt;/code&gt; is default for &lt;code&gt;state=touch&lt;/code&gt;."&lt;/p&gt;

&lt;p&gt;So every run sets both timestamps to the current time. That is a real change to the filesystem, and Ansible correctly reports it as one. The file's existence is idempotent. Its mtime is not.&lt;/p&gt;

&lt;p&gt;The documentation gives the fix as an example rather than a statement, in a snippet labelled "Touch again the same file, but do not change times this makes the task idempotent":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Create empty file, idempotently&lt;/span&gt;
  &lt;span class="na"&gt;ansible.builtin.file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/tmp/file.txt&lt;/span&gt;
    &lt;span class="na"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;touch&lt;/span&gt;
    &lt;span class="na"&gt;modification_time&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;preserve&lt;/span&gt;
    &lt;span class="na"&gt;access_time&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;preserve&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Worth more than tidiness. The &lt;code&gt;changed&lt;/code&gt; count in a recap is the signal that something moved, and it only works if tasks that change nothing say so. One bare &lt;code&gt;state: touch&lt;/code&gt; makes every run of that playbook report a change for the rest of its life. On a playbook with forty tasks, that is the difference between a recap you read and a recap you scroll past.&lt;/p&gt;

&lt;p&gt;The requirement was to create the file, so the version I wrote satisfies it. The version above satisfies it and is still honest on the second run.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;Two other things in those few lines, and the first is the third time this decision has come up in this series.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="na"&gt;stapp01 ansible_user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;tony&lt;/span&gt;  &lt;span class="n"&gt;ansible_ssh_common_args&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'-o StrictHostKeyChecking=no'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ansible documents both the behaviour and its own switch for it: "Ansible enables host key checking by default", because "Checking host keys guards against server spoofing and man-in-the-middle attacks". To turn it off, the documented route is &lt;code&gt;host_key_checking = False&lt;/code&gt; in &lt;code&gt;ansible.cfg&lt;/code&gt; or the &lt;code&gt;ANSIBLE_HOST_KEY_CHECKING&lt;/code&gt; variable. &lt;code&gt;StrictHostKeyChecking&lt;/code&gt; appears nowhere in Ansible's documentation; it is the ssh client's own option, passed through.&lt;/p&gt;

&lt;p&gt;The inventory version is arguably the better of the two, because of scope. The config setting disables verification for every host Ansible touches. The inventory variable disables it for &lt;code&gt;stapp01&lt;/code&gt; only.&lt;/p&gt;

&lt;p&gt;But it was not needed at all. My own transcript shows &lt;code&gt;ssh-copy-id&lt;/code&gt; and then an interactive &lt;code&gt;ssh&lt;/code&gt; answering &lt;code&gt;yes&lt;/code&gt; to the authenticity prompt, which writes the key into &lt;code&gt;known_hosts&lt;/code&gt;. Verification would have succeeded. The flag is insurance against a host key that is already known.&lt;/p&gt;

&lt;p&gt;And it is the same choice I made in Jenkins on Day 75, where the agent's host key strategy was set to Non verifying, and the plugin's page carries the advisory that setting re-opens: "Man-in-the-middle vulnerability due to missing host key verification". Three tools, three syntaxes, one decision, and the attack it protects against is the same every time.&lt;/p&gt;

&lt;p&gt;The second thing is quieter. &lt;code&gt;become: yes&lt;/code&gt; means root creates the file, so the file is root-owned. The module's &lt;code&gt;owner&lt;/code&gt; default explains why nothing else was possible: unspecified, "it uses the current user unless you are root, in which case it can preserve the previous ownership", and a file that did not exist has no previous ownership. Fine here, not usually what you want, and two lines to fix. Day 86's playbook sets it explicitly, so the pair makes the comparison on its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 2: Two virtual networks
&lt;/h2&gt;

&lt;p&gt;The task: peer a public VNet to a private one and prove a VM in each can talk.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: I made one and it did nothing
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xfusion-pub-to-priv-peering    State: Initiated
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ping 10.1.1.4  -&amp;gt;  4 packets transmitted, 0 received, 100% packet loss
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Azure peering is a pair of child resources, one on each VNet, each describing its own direction. A single half sits in &lt;code&gt;Initiated&lt;/code&gt;, which means the offer has been made and the other side has not agreed, and nothing routes.&lt;/p&gt;

&lt;p&gt;Creating the reverse flipped both to &lt;code&gt;Connected&lt;/code&gt;, and the ping went to 4 of 4.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;AWS&lt;/th&gt;
&lt;th&gt;Azure&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Resources&lt;/td&gt;
&lt;td&gt;One connection, &lt;code&gt;pcx-...&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Two peerings, one per VNet&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pending state&lt;/td&gt;
&lt;td&gt;&lt;code&gt;pending-acceptance&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Initiated&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Completing it&lt;/td&gt;
&lt;td&gt;&lt;code&gt;accept-vpc-peering-connection&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create the reverse peering&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Working state&lt;/td&gt;
&lt;td&gt;&lt;code&gt;active&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;Connected&lt;/code&gt; on both&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Different shapes, identical trap: a half-built peering looks like a resource that exists. Day 49's accept step and today's second create are the same lesson, that the thing you created is not the thing that works.&lt;/p&gt;

&lt;p&gt;And there is a third way for this to look finished and not be. &lt;code&gt;--allow-vnet-access&lt;/code&gt; is what actually permits traffic, and a peering can read &lt;code&gt;Connected&lt;/code&gt; with it set to false, which is a connected peering that forwards nothing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Azure wrote the routes for me
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az network nic show-effective-route-table --ids &lt;span class="nv"&gt;$PUB_NIC_ID&lt;/span&gt; -o table &lt;span class="o"&gt;|&lt;/span&gt; grep -i peering
Default   Active   10.1.0.0/16       VNetPeering
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Source &lt;code&gt;Default&lt;/code&gt;, meaning Azure created it. The moment both halves reached &lt;code&gt;Connected&lt;/code&gt;, a system route for the peer's address space appeared on every NIC in the VNet.&lt;/p&gt;

&lt;p&gt;Day 49 required this by hand, in both route tables, and that note called out the failure mode of doing only one: packets arrive and replies cannot get home. On Azure that mode does not exist, because the routes are a consequence of the peering rather than a separate thing to remember.&lt;/p&gt;

&lt;p&gt;The flip side is that a user-defined route can still override an injected one, which is the Day 28 fault pattern exactly. &lt;code&gt;show-effective-route-table&lt;/code&gt; stays the way to see what actually applies.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: No NSG change at all, and that is the part to be careful about
&lt;/h3&gt;

&lt;p&gt;Both NSGs had exactly one rule, SSH on port 22. Nothing permitting ICMP, nothing mentioning the peer's address space, and ping worked.&lt;/p&gt;

&lt;p&gt;The reason is the &lt;code&gt;VirtualNetwork&lt;/code&gt; service tag, which the default rule &lt;code&gt;AllowVnetInBound&lt;/code&gt; at priority 65000 permits all protocols from. My notes listed three things that tag covers. The documented list has six:&lt;/p&gt;

&lt;p&gt;"The virtual network address space (all IP address ranges defined for the virtual network), all connected on-premises address spaces, peered virtual networks, virtual networks connected to a virtual network gateway, the virtual IP address of the host, and address prefixes used on user-defined routes."&lt;/p&gt;

&lt;p&gt;Two of those I had missed, and both are worth having.&lt;/p&gt;

&lt;p&gt;"The virtual IP address of the host" is &lt;code&gt;168.63.129.16&lt;/code&gt;, yesterday's platform address. So the same tag that admits peered traffic also admits the platform channel, which is part of why that address is so hard to cut off.&lt;/p&gt;

&lt;p&gt;"Address prefixes used on user-defined routes" is the one that changed how I think about this. Adding a route widens the tag.&lt;/p&gt;

&lt;p&gt;So the set of sources &lt;code&gt;AllowVnetInBound&lt;/code&gt; admits grows when you peer a VNet, when you attach a gateway, and when you write a route. None of those are NSG changes. None of them appear anywhere in the NSG.&lt;/p&gt;

&lt;p&gt;Which makes the convenience and the hazard the same fact. Peering plus nothing else gave me working connectivity between two VMs. And an NSG audited as "only allows internal traffic" means something different afterwards, with no record in the NSG that anything happened.&lt;/p&gt;

&lt;p&gt;Day 49 needed an explicit security group rule for precisely this, because an AWS security group has no concept corresponding to "my VPC plus its peers". Day 49's list of peering requirements was four items. On Azure it is two: non-overlapping CIDRs, and both halves created.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;The best thing about this task was an accident.&lt;/p&gt;

&lt;p&gt;I ran the ping before creating the reverse peering, which was not the plan, and it gave a real baseline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;before:  4 packets transmitted, 0 received, 100% packet loss
after:   4 packets transmitted, 4 received, 0% packet loss
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A successful ping proves connectivity. A successful ping that failed completely from the identical command ten minutes earlier proves the peering caused it. That is the Day 19 and Day 40 pattern, establish the negative first, arrived at by luck rather than discipline.&lt;/p&gt;

&lt;p&gt;It is also the same thing the Ansible half did deliberately, with &lt;code&gt;ls -la /opt/data&lt;/code&gt; on each server first. One planned, one accidental, and both are the reason either result means anything.&lt;/p&gt;

&lt;p&gt;Worth noting too that the &lt;code&gt;Initiated&lt;/code&gt; state and the 100% packet loss agreed with each other. Configuration and behaviour pointed at the same gap, which is what makes a diagnosis solid rather than a guess, and is the opposite of Day 28 where a working site rested on wrong configuration.&lt;/p&gt;

&lt;p&gt;Two constraints that do carry over from AWS. Overlapping address space blocks peering on both platforms with no translation option, which is why Day 5 flagged that "any CIDR" is only safe in isolation. And peering is not transitive on either, so a third VNet peered with the public one would have no path to the private one. Past three or four VNets the answer is hub-and-spoke.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Both halves reported a state that is a word rather than a fact.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;changed=1&lt;/code&gt; looks like "the file was created". It means "the filesystem is different from before", and with &lt;code&gt;state: touch&lt;/code&gt; it will say that forever, because the default is to update the timestamps every run. The fix is two lines and it is in the documentation as an example rather than a warning, so you only find it if you go looking for why your recap never settles.&lt;/p&gt;

&lt;p&gt;The Azure peering is the sharper version. I created it, it reported a state, the state was a word rather than an error, and nothing moved. Three separate ways for that to happen: one half instead of two, both halves with &lt;code&gt;--allow-vnet-access&lt;/code&gt; false, or a user-defined route overriding the one Azure injects. In all three, the peering exists and reads as configured.&lt;/p&gt;

&lt;p&gt;The finding I would actually use is the service tag. Peering a network, attaching a gateway, or writing a route each silently widen what every NSG rule written against &lt;code&gt;VirtualNetwork&lt;/code&gt; permits, on both sides, with no change to the NSG and nothing in it to show what happened. An NSG review that only reads NSGs is not a complete review.&lt;/p&gt;

&lt;p&gt;So here is the Day 85 question. Which number on your dashboard would read exactly the same if the thing it measures had stopped changing a month ago?&lt;/p&gt;

&lt;p&gt;Day 85 down. Fifteen to go.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ansible</category>
      <category>azure</category>
      <category>automation</category>
    </item>
    <item>
      <title>Day 84: A Task That Always Changes and a Deny at 200</title>
      <dc:creator>Nnamdi Felix Ibe</dc:creator>
      <pubDate>Mon, 16 Nov 2026 18:00:00 +0000</pubDate>
      <link>https://dev.to/ndcodes/day-84-a-task-that-always-changes-and-a-deny-at-200-1ein</link>
      <guid>https://dev.to/ndcodes/day-84-a-task-that-always-changes-and-a-deny-at-200-1ein</guid>
      <description>&lt;p&gt;Day 84 of DevOps, Day 34 of Azure. Both tasks today turned on a path that is not where it looks like it is.&lt;/p&gt;

&lt;p&gt;An Ansible task with two paths in it, where one is on the machine running the playbook and the other is on the machine being configured, and nothing in the task says so. And an Azure VM that resolved DNS perfectly while being unable to open a single outbound connection, because that lookup travels down a channel the rule I was hunting for cannot touch.&lt;/p&gt;

&lt;p&gt;One Ansible task, one Azure task. Copy a file from the jumphost to three servers, then fix a VM that cannot install packages. The tasks come from the KodeKloud Engineer platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 1: One file, three servers
&lt;/h2&gt;

&lt;p&gt;The task: copy &lt;code&gt;/usr/src/data/index.html&lt;/code&gt; from the jumphost to &lt;code&gt;/opt/data&lt;/code&gt; on all three app servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Check empty first
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;tony@stapp01 ~&lt;span class="o"&gt;]&lt;/span&gt;$ ls -la /opt/data
total 12
drwxr-xr-x 2 root root 4096 May 23 12:11 .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On each of the three. Same discipline as yesterday, and it is what makes &lt;code&gt;changed: [stapp01]&lt;/code&gt; mean "the file arrived" rather than "something about the file is different now".&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: The playbook, and the direction hiding in it
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---
&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;hosts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;app_servers&lt;/span&gt;
  &lt;span class="na"&gt;become&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;yes&lt;/span&gt;

  &lt;span class="na"&gt;tasks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Copy file from the jumphost server to the remote app servers.&lt;/span&gt;
      &lt;span class="na"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/usr/src/data/index.html&lt;/span&gt;
        &lt;span class="na"&gt;dest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/opt/data&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two paths, two machines, and the parameter names do not tell you which is which.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;src&lt;/code&gt; is documented as "Local path to a file to copy to the remote server", meaning the control node. &lt;code&gt;dest&lt;/code&gt; is "Remote absolute path where the file should be copied to", meaning the managed host. So the task straddles two filesystems and the YAML reads as though it is operating on one.&lt;/p&gt;

&lt;p&gt;The switch that reverses it is &lt;code&gt;remote_src&lt;/code&gt;. At its default of &lt;code&gt;false&lt;/code&gt; the module "searches for &lt;code&gt;src&lt;/code&gt; on the controller node"; set to &lt;code&gt;true&lt;/code&gt; it "searches for &lt;code&gt;src&lt;/code&gt; on the managed (remote) node", which turns the same four lines into a copy within the target rather than a transfer to it.&lt;/p&gt;

&lt;p&gt;One boolean, two entirely different jobs, and no visible difference in the rest of the task.&lt;/p&gt;

&lt;p&gt;One thing the documentation does not cover: &lt;code&gt;dest: /opt/data&lt;/code&gt; is an existing directory, and the file landed inside it as &lt;code&gt;/opt/data/index.html&lt;/code&gt;. The page covers &lt;code&gt;src&lt;/code&gt; being a directory, and &lt;code&gt;dest&lt;/code&gt; being a non-existent path, and it warns that for a file-to-file copy "the parent directory of &lt;code&gt;dest&lt;/code&gt; is not created and the task fails if it does not already exist". The directory-as-destination case is not described, so I am recording it as observed rather than quoted.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: The output arrives out of order
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TASK [Gathering Facts] ***************  ok: [stapp01]  ok: [stapp03]  ok: [stapp02]
TASK [Copy file...] ***************  changed: [stapp02]  changed: [stapp03]  changed: [stapp01]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;stapp01&lt;/code&gt;, &lt;code&gt;stapp03&lt;/code&gt;, &lt;code&gt;stapp02&lt;/code&gt;, then &lt;code&gt;stapp02&lt;/code&gt;, &lt;code&gt;stapp03&lt;/code&gt;, &lt;code&gt;stapp01&lt;/code&gt;. Neither is inventory order, and the tool is working correctly.&lt;/p&gt;

&lt;p&gt;Ansible runs each task against several hosts in parallel, so the order they report in is the order they finished. Which means the task output is not a list you can read down to check every host did the thing. The recap is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stapp01 : ok=2  changed=1   stapp02 : ok=2  changed=1   stapp03 : ok=2  changed=1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;This playbook is idempotent and the previous one was not, and the difference is the module rather than anything I did.&lt;/p&gt;

&lt;p&gt;Run this again and it reports &lt;code&gt;changed=0&lt;/code&gt;, because &lt;code&gt;copy&lt;/code&gt; compares source and destination content and does nothing when they match. Day 83's &lt;code&gt;package&lt;/code&gt; and &lt;code&gt;service&lt;/code&gt; tasks are the same, because they describe a desired state. Day 85's &lt;code&gt;file&lt;/code&gt; with &lt;code&gt;state: touch&lt;/code&gt; is not, because it defaults both timestamps to &lt;code&gt;now&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So "is Ansible idempotent" turns out to have no single answer. Each module decides, and the only reliable way to know is to run a playbook twice and read the number.&lt;/p&gt;

&lt;p&gt;Two other things worth knowing before this pattern grows.&lt;/p&gt;

&lt;p&gt;The scaling note in the documentation: "The ansible.builtin.copy module recursively copy facility does not scale to lots (&amp;gt;hundreds) of files." The alternative it points at is &lt;code&gt;ansible.posix.synchronize&lt;/code&gt;, "A wrapper around rsync to make common tasks in your playbooks quick and easy."&lt;/p&gt;

&lt;p&gt;Which is the same shape as the Azure half of Day 82, where &lt;code&gt;az storage blob copy start&lt;/code&gt; does one blob and &lt;code&gt;azcopy sync&lt;/code&gt; is the tool for an actual sync. One file is a different problem from many files, and in both ecosystems the answer is a purpose-built transfer tool rather than the convenient one.&lt;/p&gt;

&lt;p&gt;And the file came out root-owned, because &lt;code&gt;become: yes&lt;/code&gt; means root writes it. Fine here, since mode 644 means a web server can read it. Not fine if anything is supposed to write it. Tomorrow is the day that sets ownership on purpose.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 2: A VM that cannot install packages
&lt;/h2&gt;

&lt;p&gt;The task: a VM where &lt;code&gt;apt-get&lt;/code&gt; does not work. Find out why.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: The symptom made no sense
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TCP to 1.1.1.1:443  -&amp;gt;  TCP_FAIL
DNS lookup          -&amp;gt;  resolved fine
SSH into the VM     -&amp;gt;  worked throughout
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An outbound connection to a literal IP fails, DNS resolves, and SSH is unaffected. Three facts that look mutually exclusive.&lt;/p&gt;

&lt;p&gt;The fault was one rule:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Name                 Dir       Access  Pri   Port  Proto
Block-All-Outbound   Outbound  Deny    200   *     *
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every NSG carries three default outbound rules at fixed priorities: &lt;code&gt;AllowVnetOutBound&lt;/code&gt; at 65000, &lt;code&gt;AllowInternetOutBound&lt;/code&gt; at 65001, and &lt;code&gt;DenyAllOutBound&lt;/code&gt; at 65500.&lt;/p&gt;

&lt;p&gt;A custom Deny at 200 is evaluated long before the Allow at 65001, because "Rules are processed in priority order, with lower numbers processed before higher numbers", and "Once traffic matches a rule, processing stops."&lt;/p&gt;

&lt;p&gt;The bit worth internalising is why this is so easy to do. The defaults cannot be removed, only outranked: "You can't remove the default rules, but you can override them by creating rules with higher priorities." Azure has deliberately put its permissive defaults where any custom rule beats them. So one rule at a low number silently replaces the platform's behaviour, and nothing warns you.&lt;/p&gt;

&lt;p&gt;This is the ordering hazard AWS security groups cannot produce. AWS rules are allow-only and unordered, so no rule can contradict another. An Azure NSG can.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Why SSH still worked
&lt;/h3&gt;

&lt;p&gt;NSG rules are stateful, and the documentation states it in the mirror direction: "A flow record is created for existing connections... If you specify an outbound security rule to any address over port 80, for example, it's not necessary to specify an inbound security rule for the response to the outbound traffic. You only need to specify an inbound security rule if communication is initiated externally."&lt;/p&gt;

&lt;p&gt;So the inbound SSH rule kept SSH entirely working. The connection is inbound, and its replies belong to an established flow rather than being new outbound traffic. The Deny only touched connections the VM started, which is precisely the reported symptom: you can log in, and the machine cannot fetch anything.&lt;/p&gt;

&lt;p&gt;Worth setting beside Day 28, where the fault was a route rather than a rule:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Day 28, route to &lt;code&gt;None&lt;/code&gt;
&lt;/th&gt;
&lt;th&gt;Day 34, outbound Deny&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Mechanism&lt;/td&gt;
&lt;td&gt;Routing, not stateful&lt;/td&gt;
&lt;td&gt;NSG, stateful&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Breaks VM-initiated traffic&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Breaks replies to inbound traffic&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Symptom&lt;/td&gt;
&lt;td&gt;Nothing works at all&lt;/td&gt;
&lt;td&gt;Inbound fine, outbound dead&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A broken egress route takes the replies with it, because replies are egress too. A directional NSG Deny does not. Same apparent problem, opposite diagnostic signature.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Why DNS still worked, and a correction
&lt;/h3&gt;

&lt;p&gt;My notes said traffic to Azure's platform address &lt;code&gt;168.63.129.16&lt;/code&gt; "is not subject to NSG rules", full stop. That is too broad, and the real picture is more useful because the exemptions differ by function:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;th&gt;NSG treatment&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Agent ports 80 and 32526&lt;/td&gt;
&lt;td&gt;"The communication on these ports with 168.63.129.16 isn't subject to the configured network security groups."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DNS, port 53&lt;/td&gt;
&lt;td&gt;"By default DNS communication isn't subject to the configured network security groups unless targeted using the AzurePlatformDNS service tag."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Load balancer health probes&lt;/td&gt;
&lt;td&gt;Not exempt. They work because "The default network security group configuration has a rule that allows this communication."&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So DNS survived not because the address is untouchable, but because a generic Deny does not reach it. A rule that named the &lt;code&gt;AzurePlatformDNS&lt;/code&gt; service tag as its destination would have killed DNS too, and the documentation spells out how.&lt;/p&gt;

&lt;p&gt;Which sharpens the diagnostic rather than weakening it. On Azure, "DNS works" tells you the platform channel is intact and nothing whatsoever about internet connectivity.&lt;/p&gt;

&lt;p&gt;One more fact from the same page, which explains something about Day 28 I had not connected: "168.63.129.16 is a virtual IP of the host node and as such it isn't subject to user-defined routes." So Day 28's route blackholing everything never cut the platform's own path to that VM, which is why it stayed manageable while being unable to reach anything at all.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;The test that found this in one command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;timeout 6 bash -c &lt;span class="s2"&gt;"&amp;lt;/dev/tcp/1.1.1.1/443"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; TCP_OK &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; TCP_FAIL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A literal IP, no name resolution. That separates routing and filtering from DNS, and it returned &lt;code&gt;TCP_FAIL&lt;/code&gt; while DNS succeeded, which located the fault immediately.&lt;/p&gt;

&lt;p&gt;Testing with &lt;code&gt;apt-get update&lt;/code&gt; or a curl to a hostname would have failed too and told me nothing, because both need DNS and egress, so a failure implicates either. When two subsystems are both required, test them separately before testing them together. And &lt;code&gt;/dev/tcp&lt;/code&gt; is a bash built-in, so it works with no &lt;code&gt;nc&lt;/code&gt; or &lt;code&gt;telnet&lt;/code&gt; installed.&lt;/p&gt;

&lt;p&gt;Then on the fix: delete the rule rather than flipping it to Allow.&lt;/p&gt;

&lt;p&gt;Day 28 taught the opposite, that repointing a broken route beats deleting it, so the difference matters. There, deleting left an empty route table still attached to a subnet: configuration that functions and makes no sense. Here, an NSG with no custom outbound rules is the normal state, because Azure's defaults already allow internet outbound and that is what a fresh NSG looks like.&lt;/p&gt;

&lt;p&gt;So the rule from Day 28 holds and resolves differently. Minimise what you change, then check the end state is a configuration someone would deliberately choose. An empty route table fails that test; an NSG with only inbound rules passes it. Flipping it to Allow would also have left a rule named &lt;code&gt;Block-All-Outbound&lt;/code&gt; that permits everything, which is Day 28's other mistake.&lt;/p&gt;

&lt;p&gt;And verify the sentence in the requirement. "Restore package installation capabilities" is a claim about &lt;code&gt;apt-get install&lt;/code&gt;, so the closing check installs a package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TCP_OK
APT_UPDATE_OK
INSTALL_OK
tree v2.0.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A TCP connection proves egress. &lt;code&gt;apt-get update&lt;/code&gt; proves the repositories resolve and respond. Only the install proves the thing asked for, because it also exercises package resolution, download and dpkg.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Both halves were about a path that is not where it looks like it is.&lt;/p&gt;

&lt;p&gt;The Ansible task has two paths in it, and the YAML gives no hint that they live on different machines. One boolean reverses which machine &lt;code&gt;src&lt;/code&gt; means, and the task text is otherwise identical. If you read that playbook cold, there is nothing to tell you the file is crossing a network.&lt;/p&gt;

&lt;p&gt;"DNS resolves" looks like "the network is fine". On Azure it means the platform's own channel is intact, which it almost always is, because that traffic is exempt from the rule you are hunting for. The only test that said anything useful was a TCP connection to a bare IP address.&lt;/p&gt;

&lt;p&gt;And the thing that caught me out in my own notes was the blanket claim. I had written that the platform address bypasses NSGs. It bypasses them on two ports, bypasses them for DNS unless you aim at it specifically, and does not bypass them for health probes at all. Three answers where I had recorded one.&lt;/p&gt;

&lt;p&gt;So here is the Day 84 question. Which of your working signals travels on a path that the thing you are testing cannot affect?&lt;/p&gt;

&lt;p&gt;Day 84 down. Sixteen to go.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ansible</category>
      <category>azure</category>
      <category>automation</category>
    </item>
    <item>
      <title>Day 83: Two Files and Four Parts</title>
      <dc:creator>Nnamdi Felix Ibe</dc:creator>
      <pubDate>Sun, 15 Nov 2026 13:47:01 +0000</pubDate>
      <link>https://dev.to/ndcodes/day-83-two-files-and-four-parts-40hc</link>
      <guid>https://dev.to/ndcodes/day-83-two-files-and-four-parts-40hc</guid>
      <description>&lt;p&gt;Day 83 of DevOps, Day 33 of Azure. Both tasks today were made of parts that are each correct on their own and do nothing until something joins them.&lt;/p&gt;

&lt;p&gt;An Ansible inventory and an Ansible playbook are two files, neither of which references the other. A load balancer has four kinds of components, and three of them are inert until a rule names all three together.&lt;/p&gt;

&lt;p&gt;One Ansible task, one Azure task. Create an inventory so an existing playbook runs, then put a load balancer in front of a VM. The tasks come from the KodeKloud Engineer platform.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 1: An inventory for a playbook that already exists
&lt;/h2&gt;

&lt;p&gt;The task: create an inventory at &lt;code&gt;/home/thor/playbook/inventory&lt;/code&gt; so the playbook sitting next to it can run against &lt;code&gt;stapp03&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Keys before the file
&lt;/h3&gt;

&lt;p&gt;The security point is worth making before writing anything, and it is the Day 82 finding: storing a password in a plain-text inventory is what Ansible's own documentation tells you not to do, in the description of the variable itself. "Never store this variable in plain text; always use a vault."&lt;/p&gt;

&lt;p&gt;So the key goes in first, and the inventory describes who to connect as rather than what password to use.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="k"&gt;[app_server]&lt;/span&gt;
&lt;span class="na"&gt;stapp03 ansible_host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;stapp03&lt;/span&gt; &lt;span class="n"&gt;ansible_user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;banner&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One thing in that line is redundant. &lt;code&gt;ansible_host&lt;/code&gt; is documented as "The name of the host to connect to, if different from the alias you wish to give to it", and the alias on the left is already &lt;code&gt;stapp03&lt;/code&gt;. Harmless, and it hides what the parameter is actually for, which is pointing an inventory name at a different address.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Two files, joined at the command line
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;thor@jump-host ~/playbook$ ansible-playbook -i inventory playbook.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the bit worth sitting with, because it is the shape of the whole tool.&lt;/p&gt;

&lt;p&gt;The playbook says which group it targets. The inventory says which machines are in that group. Neither file mentions the other, and the command line is where they meet. Change the inventory and the identical playbook deploys to somewhere else entirely.&lt;/p&gt;

&lt;p&gt;That separation is the reason Ansible scales to more than one environment without templating anything. It is also the reason a playbook that works in staging can hit production by mistake, because the only thing that decided which was a flag.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Read the recap
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TASK [Gathering Facts] ***************  ok: [stapp03]
TASK [Install httpd package] ***************  changed: [stapp03]
TASK [Start service httpd] ***************  changed: [stapp03]

PLAY RECAP ***************  stapp03 : ok=3  changed=2  unreachable=0  failed=0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three tasks ran, two of them altered the system. The one that did not is Gathering Facts, which collects information and changes nothing by design.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;Run this playbook a second time and it reports &lt;code&gt;changed=0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The package task finds httpd installed and reports &lt;code&gt;ok&lt;/code&gt;. The service task finds it running and reports &lt;code&gt;ok&lt;/code&gt;. Both modules describe a desired state, and a system already in that state needs no action. That is the property Ansible is usually sold on, and it is what makes the &lt;code&gt;changed&lt;/code&gt; number in a recap worth reading: on a stable system it should be zero, so anything non-zero means something actually moved.&lt;/p&gt;

&lt;p&gt;Worth establishing deliberately now, because tomorrow's playbook breaks it. &lt;code&gt;file: state=touch&lt;/code&gt; reports a change on every single run, by design, and once one task does that the recap stops being a signal.&lt;/p&gt;

&lt;p&gt;One correction to my own notes while I am here. For this day and the next three, I wrote &lt;code&gt;&amp;lt;Enter-your-passphrase&amp;gt;&lt;/code&gt; at the &lt;code&gt;ssh-keygen&lt;/code&gt; prompt, as a placeholder, and then showed a successful Ansible run. Day 82's notes record the prompt as it actually appeared, with an empty passphrase, which is the version that works: Ansible "does not expose a channel to allow communication between the user and the ssh process to accept a password manually to decrypt an ssh key", so a passphrase-protected key cannot be decrypted during a run without an agent, and none of my notes mention one.&lt;/p&gt;

&lt;p&gt;A placeholder in a write-up reads as an instruction. Anyone following it literally ends up with a key Ansible cannot use, so it should be the real prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 2: A load balancer in front of a VM
&lt;/h2&gt;

&lt;p&gt;The task: a load balancer, a frontend IP, a backend pool containing the VM, a health probe on port 80, and a rule.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: The title is AWS vocabulary
&lt;/h3&gt;

&lt;p&gt;There is no "Azure Application Load Balancer". The products split differently:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;AWS&lt;/th&gt;
&lt;th&gt;Azure&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;4, TCP and UDP&lt;/td&gt;
&lt;td&gt;Network Load Balancer&lt;/td&gt;
&lt;td&gt;Azure Load Balancer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7, HTTP&lt;/td&gt;
&lt;td&gt;Application Load Balancer&lt;/td&gt;
&lt;td&gt;Application Gateway&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;What this task describes, a frontend, a pool, a probe and a port-to-port rule, is Azure Load Balancer, which is layer 4. It forwards TCP and knows nothing about HTTP. No paths, no host headers, no cookie affinity, no TLS termination.&lt;/p&gt;

&lt;p&gt;Worth being precise about, because the AWS Day 36 ALB took &lt;code&gt;--health-check-path /&lt;/code&gt; and this probe cannot have one.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Standard is not a choice, and it changes the inbound rules
&lt;/h3&gt;

&lt;p&gt;"On September 30, 2025, Basic Load Balancer was retired."&lt;/p&gt;

&lt;p&gt;So Standard brings a constraint worth checking before building: "When using a Public Standard Load Balancer, the SKU of the public IP must be Standard. Basic Public IPs are not supported on Standard LB." A public IP's SKU cannot be changed in place, so a Basic one means detach, delete, recreate, reattach.&lt;/p&gt;

&lt;p&gt;The part my notes had as an aside, and that the documentation makes central, is the inbound posture:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Standard&lt;/th&gt;
&lt;th&gt;Basic&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Secure by default&lt;/td&gt;
&lt;td&gt;"Closed to inbound flows unless allowed by a network security group."&lt;/td&gt;
&lt;td&gt;"Open by default. Network security group optional."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Outbound Rules&lt;/td&gt;
&lt;td&gt;"Declarative outbound NAT configuration."&lt;/td&gt;
&lt;td&gt;"Not available."&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So the &lt;code&gt;Allow-HTTP&lt;/code&gt; rule I added at priority 900 is not extra hardening. It is required by the SKU. The same deployment on a Basic load balancer would have served traffic with no NSG rule at all, which is exactly the kind of difference that breaks a migration nobody thinks of as a change.&lt;/p&gt;

&lt;p&gt;The probe is the exception, and the service tag says why. &lt;code&gt;AzureLoadBalancer&lt;/code&gt; "translates to the virtual IP address of the host (168.63.129.16) where the Azure health probes originate", and then the sentence I was missing: "This only includes probe traffic, not real traffic to your backend resource."&lt;/p&gt;

&lt;p&gt;Which is the whole answer. The default rule at 65001 admits the probe and nothing else. Omit the client rule, and you get a load balancer whose backend is marked healthy and whose visitors get refused.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: The rule is what makes the other three real
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az network lb probe create ... -n datacenter-health-probe --protocol tcp --port 80
az network lb rule create ... --frontend-port 80 --backend-port 80 \
    --frontend-ip-name datacenter-lb-ip --backend-pool-name datacenter-backend-pool \
    --probe-name datacenter-health-probe
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Frontend IP configuration&lt;/td&gt;
&lt;td&gt;Where traffic arrives&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend pool&lt;/td&gt;
&lt;td&gt;Where traffic goes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Health probe&lt;/td&gt;
&lt;td&gt;Which members are eligible&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rule&lt;/td&gt;
&lt;td&gt;Binds the other three together&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The rule names all three. Build the frontend, the pool and the probe without one and you have an address that accepts connections and forwards nothing, which is the trap Day 36 described for an ALB with no listener.&lt;/p&gt;

&lt;p&gt;Same shape as the Ansible half, with fewer parts. An inventory and a playbook each describe half of a deployment, and the command line is the rule.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Pool membership lives on the NIC
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az network nic ip-config address-pool add -g &lt;span class="nv"&gt;$RG&lt;/span&gt; --nic-name &lt;span class="nv"&gt;$NIC&lt;/span&gt; --ip-config-name &lt;span class="nv"&gt;$IPCFG&lt;/span&gt; \
  --lb-name datacenter-lb --address-pool datacenter-backend-pool
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing is added from the load balancer's side. Membership is a property of the NIC's IP configuration, which is why the command lives under &lt;code&gt;az network nic&lt;/code&gt; and needs the IP config name as well as the NIC.&lt;/p&gt;

&lt;p&gt;Same pattern as attaching a public IP on Day 10. The thing that looks like it belongs to the network resource turns out to be a field on the NIC. And the names came from &lt;code&gt;az vm create&lt;/code&gt; defaults, &lt;code&gt;datacenter-vmVMNic&lt;/code&gt; and &lt;code&gt;ipconfigdatacenter-vm&lt;/code&gt;, so both were derived rather than guessed. &lt;code&gt;ipconfig1&lt;/code&gt; would have failed.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;The probe is the thing I would change.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;--protocol tcp --port 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Probe&lt;/th&gt;
&lt;th&gt;Healthy means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;TCP on 80&lt;/td&gt;
&lt;td&gt;Something accepted a TCP connection&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP on 80 with &lt;code&gt;--path /&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The application returned 200&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A TCP probe passes happily against an nginx that is listening and returning 500 to every request. The task said only "on port 80" and TCP is the portal's default, so it satisfied the requirement. In a real deployment, the probe decides whether a broken instance keeps receiving traffic, so it should test the application rather than the socket.&lt;/p&gt;

&lt;p&gt;Which is Day 81's Test stage all over again, two days later and one layer down. There, a curl proved the web server answered and not that the deployment had happened. Here, a probe proves a socket is open and not that the application works.&lt;/p&gt;

&lt;p&gt;Two smaller things. &lt;code&gt;az network lb create&lt;/code&gt; returns the load balancer at the top level with no wrapping object, where &lt;code&gt;vnet create&lt;/code&gt; wraps in &lt;code&gt;newVNet&lt;/code&gt; and &lt;code&gt;public-ip create&lt;/code&gt; wraps in &lt;code&gt;publicIp&lt;/code&gt;. Three conventions in one command group, no rule to learn, and the fix is Day 32's: run an unfamiliar command with plain &lt;code&gt;-o json&lt;/code&gt; once before writing a query. The failure mode is nastier than usual here, because a blank output from a create reads as a failed command.&lt;/p&gt;

&lt;p&gt;And the VM kept its own public IP, so nginx is now reachable two ways, directly and through the load balancer. Fine for the task and wrong for anything real: the point of a load balancer is to be the only entrance, because that is where health checking and traffic policy live.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Both halves came down to the same question. Which of these things is doing the joining?&lt;/p&gt;

&lt;p&gt;With Ansible it is the command line, and that is a design decision rather than an accident. Two files that know nothing about each other, bound at the moment you run them, which is what lets one playbook serve several environments and also what lets it hit the wrong one.&lt;/p&gt;

&lt;p&gt;With the load balancer, it is the rule, and three resources sit there looking configured until it exists. Then the thing I would not have guessed: pool membership is not on the load balancer at all, it is a field on the network card.&lt;/p&gt;

&lt;p&gt;The Standard SKU finding is the one I would act on. I had written the NSG rule up as sensible hardening. It is mandatory because Standard is closed to inbound unless an NSG opens it, and Basic was open by default. Anyone migrating from Basic inherits a load balancer whose backend reads healthy and whose users cannot reach it.&lt;/p&gt;

&lt;p&gt;So here is the Day 83 question. In your setup, what is the single thing that joins the pieces, and what happens the day someone changes it?&lt;/p&gt;

&lt;p&gt;Day 83 down. Seventeen to go.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ansible</category>
      <category>azure</category>
      <category>automation</category>
    </item>
    <item>
      <title>Part 5: The Control That Protected an Empty Bucket</title>
      <dc:creator>Nnamdi Felix Ibe</dc:creator>
      <pubDate>Wed, 11 Nov 2026 06:32:19 +0000</pubDate>
      <link>https://dev.to/ndcodes/part-5-the-control-that-protected-an-empty-bucket-e1j</link>
      <guid>https://dev.to/ndcodes/part-5-the-control-that-protected-an-empty-bucket-e1j</guid>
      <description>&lt;p&gt;This is Part 5 of a series building an HL7 v2 to FHIR R4 interoperability service in public. The repository is &lt;a href="https://github.com/ND-codes/nhs-interop-platform" rel="noopener noreferrer"&gt;ND-codes/nhs-interop-platform&lt;/a&gt;, and the code as it stood for this article is tagged &lt;a href="https://github.com/ND-codes/nhs-interop-platform/tree/part-5" rel="noopener noreferrer"&gt;&lt;code&gt;part-5&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Part 4 was about an alert that watched a metric that nothing exported. This part is about the same failure in documentation. I had written a security document with a threat table, a Caldicott mapping, a UK GDPR table and a DSPT mapping, all in the present tense, all with an evidence column. Then I checked every row against the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with a control table
&lt;/h2&gt;

&lt;p&gt;A security document is read differently from other documentation. Nobody reads a threat table for inspiration. They read it to find out what is true, usually because they have to decide whether to trust the system or sign something about it.&lt;/p&gt;

&lt;p&gt;That makes the format itself a risk. Mine put aspiration and fact in the same table, in the same tense, with the same kind of evidence citation beside each. There was no way to tell, from the inside, which rows described code and which described intent. An assessor reading it would have believed all of it.&lt;/p&gt;

&lt;p&gt;Ten of those rows did not hold. The most instructive one was not a missing control. It was a control that was built properly and protected nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The control that protected an empty bucket
&lt;/h2&gt;

&lt;p&gt;The GDPR table cited an S3 lifecycle rule as the storage-limitation control for patient data. That rule is real. It is in &lt;code&gt;infra/terraform/s3.tf&lt;/code&gt;, it moves objects to infrequent access at 30 days and Glacier at 90, and it expires them at 2555 days, which is the seven-year NHS records retention. The bucket it governs is versioned, encrypted with a customer-managed key, has public access blocked and has Object Lock configured. If you were auditing the Terraform, you&lt;br&gt;
would tick that row and move on.&lt;/p&gt;

&lt;p&gt;Nothing writes to it.&lt;/p&gt;

&lt;p&gt;No service in the repository imports boto3, or any other S3 client. The only mention of S3 anywhere in the application code is in the transform service's own docstring, which says the dead-letter path is "S3 in prod". That was an intention someone wrote down once, and it then got cited in a compliance table as though it described the system.&lt;/p&gt;

&lt;p&gt;In every configuration that actually runs, the dead-letter path is local. Under Docker Compose it is a named volume at &lt;code&gt;/tmp/dlq&lt;/code&gt;. In Kubernetes it is an&lt;br&gt;
&lt;code&gt;emptyDir&lt;/code&gt; mounted at &lt;code&gt;/tmp&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Both of those matter more than they look.&lt;/p&gt;

&lt;p&gt;An &lt;code&gt;emptyDir&lt;/code&gt; does not survive the pod. A restart or a reschedule discards it. So in the deployed configuration, the dead-letter path loses exactly the messages it exists to preserve, precisely when it is most likely to be restarted, which is during the outage that filled it. Meanwhile, the runbook told the on-call engineer to "inspect the DLQ bucket" and said messages "will replay once the write path recovers". There is no bucket to inspect, and nothing replays.&lt;/p&gt;

&lt;p&gt;The Docker Compose case was worse and is the one that got caught first. The named volume was root-owned while the container runs as uid 10001, so every dead-letter write failed with &lt;code&gt;PermissionError&lt;/code&gt;, and the message was lost silently. That was found by running &lt;code&gt;make break-fhir&lt;/code&gt;, the failure demonstration script from Part 4, in its first week of existence.&lt;/p&gt;

&lt;p&gt;And the dead-letter path is the most sensitive store in the stack. A&lt;br&gt;
dead-lettered message is the complete raw HL7 message: every PID field,&lt;br&gt;
including the ones the mapper deliberately drops before building the Bundle. The FHIR store holds less patient data than the dead-letter path does. It had no retention rule of any kind.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2er7g8s7jcw7khvogwyu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2er7g8s7jcw7khvogwyu.png" alt="Two panels. Left: infra/terraform/s3.tf, the dead-letter bucket, with a customer-managed key, versioning, Object Lock, public access blocked and expiry at 2555 days, but nothing writes to it. Right: /tmp/dlq, where messages actually go, holding complete raw HL7 with no retention rule." width="800" height="488"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So the real compliance position was a well-built seven-year retention control protecting an empty bucket, while the patient data sat in an ephemeral volume with no retention, no durability, and a runbook pointing the wrong way.&lt;/p&gt;
&lt;h2&gt;
  
  
  The NHS number in four log lines
&lt;/h2&gt;

&lt;p&gt;The second finding is smaller and more common.&lt;/p&gt;

&lt;p&gt;The pds-client service logged the NHS number at INFO on every lookup, every cache hit, every stub response and every upstream error. Four call sites.&lt;/p&gt;

&lt;p&gt;What makes it easy to miss is the serialisation. The log format string is &lt;code&gt;"%(asctime)s %(levelname)s %(name)s %(message)s"&lt;/code&gt;, which does not mention the identifier at all. The call looks harmless:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"PDS cache hit"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;extra&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"nhs_number"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;nhs_number&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;python-json-logger&lt;/code&gt; serialises everything passed in &lt;code&gt;extra&lt;/code&gt;, whether or not&lt;br&gt;
the format string names it. The line that reaches stdout is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"asctime"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2026-11-09 14:07:46,693"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"levelname"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"INFO"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
 &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"pds-client"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"PDS cache hit"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
 &lt;span class="nl"&gt;"nhs_number"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"9000000009"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcz2hwkzf0mlrvbc73qug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcz2hwkzf0mlrvbc73qug.png" alt="A pds-client log call passes the NHS number in extra. The JSON format string never names it, yet the line written to stdout still contains nhs_number 9000000009." width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The NHS number is the strongest patient identifier in English healthcare, and it was going to stdout, which in the Helm deployment means a log store with different retention and different access control from the patient record itself. The document, meanwhile, cited Caldicott principle 3 and told the reader that only the minimum necessary data was used. The National Data Guardian's wording for principle 2 is that confidential information "should not&lt;br&gt;
be included unless it is necessary for the specified purpose(s)".&lt;/p&gt;

&lt;p&gt;It was also going somewhere worse. The outbound call to the PDS sandbox set the correlation header from the patient:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"X-Request-ID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;nhs_number&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A request id is echoed in upstream error responses and recorded by every intermediary that handles the request. That leaks considerably further than our own log store.&lt;/p&gt;

&lt;p&gt;The fix turned out to be a deletion rather than an addition, and the reason is the interesting part. The transform service already sends &lt;code&gt;X-Trace-Id&lt;/code&gt; on every call to pds-client. The handler signature was &lt;code&gt;async def lookup(nhs_number: str)&lt;/code&gt;, which reads no headers, so the trace id was being sent and thrown away. With the correlation identifier discarded, the NHS number was the only thing left to log. Accepting the header makes the patient identifier unnecessary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;lookup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;nhs_number&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;x_trace_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Header&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;trace_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x_trace_id&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;uuid4&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I did consider logging a hash instead, and decided against it. An NHS number is ten digits with a constrained check digit, so an unsalted hash of one is recoverable by brute force almost immediately. A salted hash would work, but it needs the salt managed as a secret, and it would only be earning back correlation that the trace id already provides.&lt;/p&gt;

&lt;h2&gt;
  
  
  The test that had to look at the bytes
&lt;/h2&gt;

&lt;p&gt;The obvious way to test this is &lt;code&gt;caplog&lt;/code&gt;. It is the wrong way.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;caplog&lt;/code&gt; inspects the log record. The defect lives in serialisation: the record carries &lt;code&gt;nhs_number&lt;/code&gt; as an attribute, and the question is whether it reaches stdout. A &lt;code&gt;caplog&lt;/code&gt; assertion can pass while the leak continues.&lt;/p&gt;

&lt;p&gt;So the tests attach the service's real &lt;code&gt;JsonFormatter&lt;/code&gt; to a &lt;code&gt;StringIO&lt;/code&gt; and assert on the output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setFormatter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;jsonlogger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;JsonFormatter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"%(asctime)s %(levelname)s %(name)s %(message)s"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addHandler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="no"&gt;NHS_NUMBER&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;captured_log&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getvalue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is a substring assertion over the exact bytes the container would write, across the cache path, the stub path, the upstream error path and the open breaker path. It does not care how the identifier got there, as long as the test makes that path fail the way it fails for real. It will catch the next person who adds a fifth log line, including me. Further down is the case where my first version of this test didn't.&lt;/p&gt;

&lt;p&gt;All ten of those tests fail against the previous version of the service and pass against the current one. That is the only check I trust on work like this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Eight runbook links that never resolved
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvfrarn7nihbnwol31p9n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvfrarn7nihbnwol31p9n.png" alt="The runbook anchors the alerts cited, such as #pds-circuit, beside the ones GitHub actually builds from the headings, such as #2-pdscircuitopen." width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each of the eight alert rules carried a &lt;code&gt;runbook&lt;/code&gt; annotation, like this one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;runbook&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"docs/runbook.md#pds-circuit"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;None of them resolved. There are no anchor tags anywhere in the runbook, and GitHub generates a heading's anchor from its text, so the real target for that section is &lt;code&gt;#2-pdscircuitopen&lt;/code&gt;. An on-call engineer clicking an alert link landed at the top of the file.&lt;/p&gt;

&lt;p&gt;I did not work this out from the slug rules. I fetched the rendered file from GitHub and read the anchors out of the DOM, which gave the actual list rather than my recollection of the algorithm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#1-transformlatencyhigh   #2-pdscircuitopen   #3-dlqratehigh
#4-transformerrorratehigh #5-ingestnotraffic  #6-fieldsdroppedratehigh
#7-invalidnhsnumbers      #8-patientwriteswithoutidentity
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three of those eight dead links were mine. I added them in Part 4 by copying the convention the existing five used, and the convention had never worked. The sections even carried a line reading &lt;code&gt;Anchor: #fields-dropped&lt;/code&gt;, which was decoration. It declared an anchor rather than creating one.&lt;/p&gt;

&lt;p&gt;The annotations now point at the generated anchors, every section states its own link, and the alert rule tests assert the exact annotation string, so a renumbering that breaks a link breaks a test. That trade-off is written down in the runbook, because tying a link to a section number is not obviously right.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tag that existed only in a comment
&lt;/h2&gt;

&lt;p&gt;The data sensitivity section claimed &lt;code&gt;DataClass = patient-identifiable&lt;/code&gt; was applied to every AWS resource through Terraform default tags. The provider block containing those tags was commented out. The string &lt;code&gt;DataClass&lt;/code&gt; appeared exactly once in the whole Terraform directory, inside that comment.&lt;/p&gt;

&lt;p&gt;This matters more than cost allocation. The data classification tag is what an access review or an assessment uses to find the resources holding patient data. A tag that exists only in a comment finds nothing.&lt;/p&gt;

&lt;p&gt;It is now in the live provider block. Two small honesty notes came out of writing it. The claim can only be "every taggable resource", because several resources here take no tags argument at all, including &lt;code&gt;aws_kms_alias&lt;/code&gt; and the S3 bucket sub-resources. And the block syntax was checked against HashiCorp's own tutorial rather than written from memory: &lt;code&gt;default_tags&lt;/code&gt; is a block with a nested &lt;code&gt;tags&lt;/code&gt; map and no equals sign. Part 2 went out with a Terraform CI job that used an invalid Trivy flag, because the flag was recalled instead of looked up, and that is a cheap mistake to stop repeating.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one boundary that takes arbitrary input
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;POST /hl7&lt;/code&gt; read its body with &lt;code&gt;await request.body()&lt;/code&gt; and no limit. The document claimed Pydantic validation at every HTTP boundary, which is true everywhere except the one place it matters, because an HL7 v2 message is not JSON and has no model.&lt;/p&gt;

&lt;p&gt;It now reads the stream in chunks and stops at 256 KiB. The limit is checked against &lt;code&gt;Content-Length&lt;/code&gt; first because that is cheap, and then enforced while reading anyway, because Content-Length is a claim the client makes and a chunked request need not send one. There is a test for each of those, plus one that an exactly-at-the-limit body is still accepted, which is where this kind of check is usually wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I did not fix
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;POST /hl7&lt;/code&gt; still has no authentication. Anything that can reach the service can submit a message that becomes a Patient record. The mitigations that exist are that the subnets are tagged for an internal load balancer and that NetworkPolicy restricts pod-to-pod traffic, and neither of those is authentication.&lt;/p&gt;

&lt;p&gt;I thought about adding a shared-secret header and decided not to, two days before publishing. A trust would use mutual TLS or the Spine Secure Proxy, and shipping an API key check would have produced exactly the thing this article is about: a row in a table saying authentication is implemented, describing something nobody would actually deploy. It is in the "Claimed, not built" section, and it is a roadmap issue.&lt;/p&gt;

&lt;p&gt;The dead-letter path still has no durability. It has a 72-hour retention window, pruning on write and on startup, an exported age, an alert and a runbook entry. It does not survive a pod restart. Fixing that means writing to the bucket that already has the right controls, which needs an AWS account.&lt;/p&gt;

&lt;p&gt;And pruning on write and startup has a hole I should name: a stack that dead-letters nothing and never restarts keeps its oldest message past the window. The alert on &lt;code&gt;hl7_dlq_oldest_seconds&lt;/code&gt; is there because that case should be visible rather than silent. The actual fix is to move retention to the storage layer, where it runs whether or not the application does.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where AI helps here, and where it doesn't
&lt;/h2&gt;

&lt;p&gt;I built this project with Claude Code, and this week it gave a clean read on both halves of that.&lt;/p&gt;

&lt;p&gt;The sweep is where it earns its place. Reading every row of a control table, finding the file each row cites, and checking whether the thing is actually there is tedious, mechanical work that gets skipped precisely because it is tedious. Most of these ten findings came out of that pass, and I would not have done it by hand two days before publishing.&lt;/p&gt;

&lt;p&gt;The failure mode is sharper, and this part of the series has now shown it twice.&lt;/p&gt;

&lt;p&gt;Part 4 shipped a fix for an alert that could never fire. The fix did not work either. The breaker was applied as a decorator to a coroutine function, so pybreaker counted the returned coroutine object as a success and the real failure raised later, on await, outside the breaker. The breaker never opened, which means the gauge that had just been added and the alert that had just been&lt;br&gt;
made fireable still could not fire.&lt;/p&gt;

&lt;p&gt;The test for it passed. It drove the breaker with a synchronous function, so it proved the gauge worked rather than proving the breaker worked, which is the same shape of error as the original bug, one layer down. I only found it by starting the stack and watching the breaker refuse to open. The commit is&lt;br&gt;
&lt;a href="https://github.com/ND-codes/nhs-interop-platform/commit/b43f462" rel="noopener noreferrer"&gt;b43f462&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This week the identical defect turned up in pds-client, and it was only found because I now knew to look for it. The same fix applies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;breaker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;calling&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"X-Request-ID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;trace_id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;calling()&lt;/code&gt; is the right API here rather than &lt;code&gt;call_async&lt;/code&gt;, because&lt;br&gt;
&lt;code&gt;call_async&lt;/code&gt; is implemented with &lt;code&gt;tornado.gen.coroutine&lt;/code&gt; and this service runs on asyncio. That came from reading the installed pybreaker source rather than assuming.&lt;/p&gt;

&lt;p&gt;The runbook anchors are the same failure in a smaller form: a broken convention reproduced faithfully three times, because reproducing a convention does not involve testing it.&lt;/p&gt;

&lt;p&gt;And while writing this part up, I nearly shipped two more. Before merging, I had Claude Code review the finished week, and this time the review ran the code instead of reading it.&lt;/p&gt;

&lt;p&gt;The first find was that the NHS number still reached the logs. The test for the upstream error path raised a connection error, which is the one httpx exception whose message carries no URL. A real 500 or 429 from PDS raises &lt;code&gt;HTTPStatusError&lt;/code&gt;, httpx builds that message from the request URL, and the URL ends in the NHS number.&lt;/p&gt;

&lt;p&gt;Both services logged &lt;code&gt;str(exc)&lt;/code&gt;, so the leak was open while the test guarding it passed. They now log the error type, status code and trace id, and the test makes PDS answer with a real 500.&lt;/p&gt;

&lt;p&gt;The second was worse, because it was Part 4's bug again. The new retention alert fires when the oldest dead-lettered message passes 80 hours, and the gauge it reads was only updated when pruning ran. Pruning deletes anything past 72 hours, so the gauge could never get past 72, and then froze until the next write.&lt;/p&gt;

&lt;p&gt;The promtool test fed the rule a made-up 290,000 seconds and the rule fired. That proved the rule and said nothing about the metric, which is the breaker test from Part 4 all over again. The gauge is now read from disk at scrape time, and a new test ages a file past the threshold with nothing else happening.&lt;/p&gt;

&lt;p&gt;The pattern across both weeks is that an assistant is reliable at applying a shape and unreliable at noticing the shape is wrong, and that tests written in the same pass as the fix inherit the same blind spot. Every time, what caught it was running the system. That is an argument for the failure demonstration scripts from Part 4 rather than against the tooling, and it is why &lt;code&gt;make break-fhir&lt;/code&gt; found the root-owned volume in its first week.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worth stealing
&lt;/h2&gt;

&lt;p&gt;Separate what is built from what is intended, structurally, not with a&lt;br&gt;
qualifier. One table for implemented controls, one section headed "Claimed, not built". A hedged row still reads as a yes.&lt;/p&gt;

&lt;p&gt;Make the evidence column name a file that exists and, for a document, an anchor you have checked. Four of my rows cited &lt;code&gt;.gitlab-ci.yml&lt;/code&gt;, a pipeline that cannot run because the repository is on GitHub. That file is deleted now rather than left to be cited again.&lt;/p&gt;

&lt;p&gt;Point a control at a test where you can. A row that names a test is the only kind of security documentation that stays true without somebody remembering to update it.&lt;/p&gt;

&lt;p&gt;Test the serialised output, not the record, whenever the question is what leaves the process. The same applies to metric labels, error responses and anything that gets rendered on the way out.&lt;/p&gt;

&lt;p&gt;Check which store actually holds the data before you write a retention&lt;br&gt;
control. The bucket with the seven-year rule held nothing.&lt;/p&gt;

&lt;p&gt;Give a retention rule a metric. A rule nothing measures is a sentence in a document.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;p&gt;I would have written the security document last. Writing it early, from the architecture rather than from the code, is precisely how it filled up with things that were true of the design and not of the system.&lt;/p&gt;

&lt;p&gt;I would have audited it when the repository moved from GitLab to GitHub. That move invalidated four evidence citations in one commit and nobody checked.&lt;/p&gt;

&lt;p&gt;And I would have treated the first "in prod" in a docstring as a flag. Both of this week's worst findings trace back to a sentence describing an intended future, which later got read as a description of the present.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.gov.uk/government/publications/the-caldicott-principles" rel="noopener noreferrer"&gt;The Caldicott Principles&lt;/a&gt;, National Data Guardian, GOV.UK&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dsptoolkit.nhs.uk/" rel="noopener noreferrer"&gt;Data Security and Protection Toolkit&lt;/a&gt;, NHS England&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developer.hashicorp.com/terraform/tutorials/aws/aws-default-tags" rel="noopener noreferrer"&gt;Configure default tags for AWS resources&lt;/a&gt;, HashiCorp&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;calling()&lt;/code&gt; context manager and the Tornado implementation of
&lt;code&gt;call_async&lt;/code&gt; were read from the installed pybreaker 1.2.0 source&lt;/li&gt;
&lt;li&gt;The runbook anchor list was read from the rendered file on GitHub, not
derived from the slug rules&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Next
&lt;/h2&gt;

&lt;p&gt;Part 6 is the ten-minute walkthrough: running the stack from nothing, and the&lt;br&gt;
questions an interviewer actually asks about it.&lt;/p&gt;

&lt;p&gt;Have you ever audited a control table against a codebase, and what did you find&lt;br&gt;
that was worse than an empty bucket?&lt;/p&gt;




&lt;p&gt;This is a personal project. It is not affiliated with or endorsed by NHS England or any NHS organisation. It uses the public PDS FHIR sandbox and synthetic test data only. Views are my own.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>security</category>
      <category>ai</category>
      <category>programming</category>
    </item>
    <item>
      <title>Day 82: A Password Removed and a Copy That Stayed Put</title>
      <dc:creator>Nnamdi Felix Ibe</dc:creator>
      <pubDate>Mon, 09 Nov 2026 18:20:21 +0000</pubDate>
      <link>https://dev.to/ndcodes/day-82-a-password-removed-and-a-copy-that-stayed-put-35jd</link>
      <guid>https://dev.to/ndcodes/day-82-a-password-removed-and-a-copy-that-stayed-put-35jd</guid>
      <description>&lt;p&gt;Day 82 of DevOps, Day 32 of Azure. Both tasks today returned a cheerful single word that meant less than it looked.&lt;/p&gt;

&lt;p&gt;Ansible said &lt;code&gt;pong&lt;/code&gt;, which does not mean what most people think it means. Azure said &lt;code&gt;success&lt;/code&gt;, which, for a small file, means finished, and for a large one, means scheduled. In both cases, the documentation is clear about the difference, and nothing in the output is.&lt;/p&gt;

&lt;p&gt;One Ansible task, one Azure task. Fix an inventory file so Ansible can reach three servers, then migrate a blob between containers. The tasks come from the KodeKloud Engineer platform.&lt;/p&gt;

&lt;p&gt;This is the first Ansible day. Days 82 to 93 are Ansible, which closes the gap I have been calling the clearest one on my CV since August.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 1: An inventory with three passwords in it
&lt;/h2&gt;

&lt;p&gt;The task: modify the inventory so Ansible can reach all three app servers, and prove it works.&lt;/p&gt;

&lt;p&gt;Here is what the lab hands you:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="na"&gt;stapp01 ansible_ssh_pass&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;Ir0nM&lt;/span&gt;@&lt;span class="n"&gt;n&lt;/span&gt;
&lt;span class="na"&gt;stapp02 ansible_ssh_pass&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;Am3ric&lt;/span&gt;@
&lt;span class="na"&gt;stapp03 ansible_ssh_pass&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nc"&gt;BigGr33&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three passwords, in a file, in plain text.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Ansible's documentation states the rule at the point of use
&lt;/h3&gt;

&lt;p&gt;I went in thinking replacing those with keys was good practice. It is stronger than that. Of &lt;code&gt;ansible_password&lt;/code&gt;, the inventory documentation says flatly: "never store this variable in plain text; always use a vault."&lt;/p&gt;

&lt;p&gt;And the same page sets the default expectation, which the lab file is working around rather than using: "By default, Ansible assumes you are using SSH keys to connect to remote machines", and "SSH keys are encouraged, but you can use password authentication if needed with the &lt;code&gt;--ask-pass&lt;/code&gt; option."&lt;/p&gt;

&lt;p&gt;So the supplied inventory does two things wrong at once. It stores secrets in plain text, and it bypasses the connection method the tool assumes, in order to avoid setting that method up.&lt;/p&gt;

&lt;p&gt;Worth putting next to Day 80, nine days ago, where a Jenkins job had a server password typed into a build step three times over, readable by anyone with Configure on the job. Same decision, opposite outcome, and I do not think the difference is the engineer. Ansible tells you the rule in the variable's own description. Jenkins has no documentation page for the freestyle shell step at all.&lt;/p&gt;

&lt;p&gt;A tool that states the rule where you are working gets the rule followed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: The key, and the passphrase that matters more than it looks
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;thor@jump-host ~$ ssh-keygen
Generating public/private ed25519 key pair.
Enter passphrase &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="s2"&gt;"/home/thor/.ssh/id_ed25519"&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;empty &lt;span class="k"&gt;for&lt;/span&gt; no passphrase&lt;span class="o"&gt;)&lt;/span&gt;:

thor@jump-host ~$ ssh-copy-id tony@stapp01
Number of key&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt; added: 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things in that output are worth stopping on.&lt;/p&gt;

&lt;p&gt;Bare &lt;code&gt;ssh-keygen&lt;/code&gt; with no flags gives ed25519. Which is the Day 74 correction landing: I used &lt;code&gt;-t rsa -b 4096&lt;/code&gt; on Day 71 and &lt;code&gt;-t rsa -b 2048&lt;/code&gt; on Day 74, and neither was a decision, because the manual gives ed25519 as the default type and 3072 as the RSA default size. So one was an upgrade and the other a downgrade from a default I had not looked up. Omitting both flags, as here, takes the newer default and stops the question arising.&lt;/p&gt;

&lt;p&gt;And the passphrase is empty, which turns out to matter more than it looks. In my notes for the next four days I wrote &lt;code&gt;&amp;lt;Enter-your-passphrase&amp;gt;&lt;/code&gt; at that prompt instead, as a placeholder, and then showed a successful Ansible run.&lt;/p&gt;

&lt;p&gt;Those two are not interchangeable, and this is the day whose transcript records which one actually happened. Ansible's connection documentation states the limitation outright: with the default ssh connection plugin, Ansible "does not expose a channel to allow communication between the user and the ssh process to accept a password manually to decrypt an ssh key."&lt;/p&gt;

&lt;p&gt;A passphrase-protected key cannot be decrypted during an Ansible run. The documented way to use one is an agent, which the same page recommends: "The use of &lt;code&gt;ssh-agent&lt;/code&gt; is highly recommended." None of my notes mention one.&lt;/p&gt;

&lt;p&gt;So the options are an empty passphrase, which makes the key file itself the only credential, or a passphrase plus a loaded agent, which is better and one more step. A passphrase with no agent does not work, and a placeholder in a write-up reads as an instruction, so it is worth replacing with the real prompt.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: The inventory, and the group that isn't there
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="na"&gt;stapp01 ansible_user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;tony&lt;/span&gt;
&lt;span class="na"&gt;stapp02 ansible_user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;steve&lt;/span&gt;
&lt;span class="na"&gt;stapp03 ansible_user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;banner&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No group header. Ansible does not need one: "Even if you do not define any groups in your inventory file, Ansible creates two default groups: all and ungrouped", and "The all group contains every host."&lt;/p&gt;

&lt;p&gt;So those three lines are addressable individually, as &lt;code&gt;all&lt;/code&gt;, and as &lt;code&gt;ungrouped&lt;/code&gt;. Every other day in this batch adds a &lt;code&gt;[group]&lt;/code&gt; header, and this task works without one.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;thor@jump-host ~/ansible$ ansible stapp01 -i inventory -m ping
stapp01 | SUCCESS =&amp;gt; {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3"
    },
    "changed": false,
    "ping": "pong"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the right verification for this task, and it is worth knowing exactly what it proves, because the name misleads.&lt;/p&gt;

&lt;p&gt;The module's own documentation: "This is NOT ICMP ping, this is just a trivial test module that requires Python on the remote-node." And its narrow purpose and exactly what an inventory change needs: "It does not make sense in playbooks, but it is useful from &lt;code&gt;/usr/bin/ansible&lt;/code&gt; to verify the ability to login and that a usable Python is configured."&lt;/p&gt;

&lt;p&gt;Two things, then. The login, which is what the key was for. And a usable Python, which is why the reply carries &lt;code&gt;discovered_interpreter_python&lt;/code&gt; rather than nothing. That field is the second half of the check, made visible.&lt;/p&gt;

&lt;p&gt;Which means a host that is up, routable and listening on port 22 but has no Python fails this check, and a host unreachable by ICMP but reachable by SSH passes it. It is the correct tool for verifying an inventory and the wrong one for diagnosing a network.&lt;/p&gt;

&lt;p&gt;Day 8 of this series, back in July, was titled on exactly this point. The documentation has not changed and the trap has not stopped being worth stating.&lt;/p&gt;

&lt;h2&gt;
  
  
  Task 2: A blob copied between containers
&lt;/h2&gt;

&lt;p&gt;The task: create a private container, migrate a file into it, and prove the content is identical.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: The data never came to my machine
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az storage blob copy start --destination-container &lt;span class="nv"&gt;$DEST&lt;/span&gt; --destination-blob devops.txt \
  --source-container &lt;span class="nv"&gt;$SRC&lt;/span&gt; --source-blob devops.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Azure does this inside the storage service. The bytes move between containers without passing through the client at all, which matters three ways.&lt;/p&gt;

&lt;p&gt;Scale: identical command and identical cost for 33 bytes or 33 terabytes, with no local disk involved. Billing: a download followed by an upload pulls the data out of Azure and back in, billed as egress, where a same-account server-side copy transfers nothing externally. Speed: this returned immediately rather than streaming anything.&lt;/p&gt;

&lt;p&gt;The naive version, &lt;code&gt;download&lt;/code&gt; then &lt;code&gt;upload&lt;/code&gt;, gives the same result for a small file and is the wrong habit to carry into a real migration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: The word "success" is doing less work than it appears to
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"copy_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"d356b703-fd74-43df-8b00-77e4f5540992"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="nl"&gt;"copy_status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"success"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;copy start&lt;/code&gt; schedules the operation and hands back a &lt;code&gt;copy_id&lt;/code&gt;. For a small blob inside one storage account it finishes before the response is written, so the status reads &lt;code&gt;success&lt;/code&gt; straight away.&lt;/p&gt;

&lt;p&gt;A large blob, or a copy across accounts or regions, returns &lt;code&gt;pending&lt;/code&gt;. Progress then lives on the destination blob rather than in the command's output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;az storage blob show -c &lt;span class="nv"&gt;$DEST&lt;/span&gt; -n devops.txt --query &lt;span class="s2"&gt;"properties.copy.{Status:status,Progress:progress}"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So a migration script cannot infer completion from what &lt;code&gt;copy start&lt;/code&gt; returned. It has to poll until the status leaves &lt;code&gt;pending&lt;/code&gt;, and handle &lt;code&gt;failed&lt;/code&gt; and &lt;code&gt;aborted&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Which is the same shape as &lt;code&gt;pong&lt;/code&gt; in the first half of today. Both commands answer with one encouraging word, both words cover less ground than they suggest, and in both cases the documentation says precisely what the word covers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: And the field names changed convention
&lt;/h3&gt;

&lt;p&gt;This is why I ran the command without a &lt;code&gt;--query&lt;/code&gt; first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"client_request_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"copy_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"copy_status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"last_modified"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"..."&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Snake_case. Nearly every other &lt;code&gt;az&lt;/code&gt; command returns camelCase, because the CLI serialises a typed SDK model. This one passes through a plain dictionary from the Python SDK, so the keys arrive as the SDK produced them. &lt;code&gt;--query "{Status:copyStatus}"&lt;/code&gt; returns &lt;code&gt;null&lt;/code&gt;; the correct form is &lt;code&gt;--query copy_status&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Fourth variant of one problem in this track:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variant&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Casing differs between resources&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;diskSizeGB&lt;/code&gt; against &lt;code&gt;diskSizeGb&lt;/code&gt;, Day 8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Field absent from one command&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;contentMd5&lt;/code&gt; on upload, Day 18&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sparse response object&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;siteConfig&lt;/code&gt; on webapp create, Day 31&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Different naming convention entirely&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;copy_status&lt;/code&gt;, here&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One habit covers all four. Run an unfamiliar command with plain &lt;code&gt;-o json&lt;/code&gt; once, then write the query. Guessing gives you &lt;code&gt;null&lt;/code&gt;, and &lt;code&gt;null&lt;/code&gt; is indistinguishable from an empty value.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the docs recommend
&lt;/h3&gt;

&lt;p&gt;The requirement was that both containers hold the file and the content is identical. Those are two claims and they need different evidence:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Proves&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;blob list&lt;/code&gt; on both containers&lt;/td&gt;
&lt;td&gt;The file exists in both&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Matching &lt;code&gt;contentMd5&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;The service believes the content matches&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;cmp&lt;/code&gt; on two downloads&lt;/td&gt;
&lt;td&gt;The bytes are identical&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The MD5 comparison is strong and still second-hand. It compares what Azure recorded at upload time, and a blob whose content settings were set wrongly would report a stale digest quite happily. &lt;code&gt;cmp&lt;/code&gt; on the actual downloaded bytes is the only check that depends on nothing but the data.&lt;/p&gt;

&lt;p&gt;While doing that, a nice demonstration of something Day 18 described without an example. Azure reported &lt;code&gt;Lu7zilatbGguzSz2Ecn5IQ==&lt;/code&gt; and &lt;code&gt;md5sum&lt;/code&gt; printed &lt;code&gt;2eeef38a56ad6c682ecd2cf611c9f921&lt;/code&gt;. Those are the same 16 bytes: decode the base64 and you get that hex string exactly. Worth knowing before concluding a checksum mismatch means corruption.&lt;/p&gt;

&lt;p&gt;One last thing, on the task's title. It says "Synchronizing Containers" and the requirement is one file, which is the Day 14 pattern again: the title names a topic, the numbered requirements are the contract. If you did want the thing the title says, &lt;code&gt;azcopy sync&lt;/code&gt; is it, because it compares source and destination and transfers only the differences. &lt;code&gt;copy start-batch&lt;/code&gt; copies everything, every time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Two commands, two reassuring words, and neither means what it looks like.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pong&lt;/code&gt; means Ansible logged in and found a working Python interpreter. It says nothing about the network, and a perfectly reachable host with no Python fails it. &lt;code&gt;success&lt;/code&gt; means the copy was scheduled, and for anything big enough to matter it will say &lt;code&gt;pending&lt;/code&gt; instead and expect you to go and look somewhere else.&lt;/p&gt;

&lt;p&gt;The useful part is that both tools document this precisely, in the place you would look if you thought to look. Which is the same thing the first half of today turned out to be about: Ansible puts "never store this variable in plain text" in the description of the variable itself, and that is why I replaced three passwords with a key without having to be clever about it.&lt;/p&gt;

&lt;p&gt;Nine days ago I wrote up a Jenkins job with a password in its build step three times over. The difference between these two days is not that I got better at security. It is that one tool told me the rule where I was standing.&lt;/p&gt;

&lt;p&gt;So here is the Day 82 question. Which of your green checks is reporting that something was scheduled rather than that it finished?&lt;/p&gt;

&lt;p&gt;Day 82 down. Eighteen to go.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>ansible</category>
      <category>azure</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
