{"id":368,"date":"2026-11-30T12:00:00","date_gmt":"2026-11-30T12:00:00","guid":{"rendered":"https:\/\/rezachegini.com\/?p=368"},"modified":"2026-11-30T19:21:36","modified_gmt":"2026-11-30T19:21:36","slug":"building-a-job-board-api-part-32-the-fresh-machine-found-two-bugs","status":"publish","type":"post","link":"https:\/\/rezachegini.com\/?p=368","title":{"rendered":"Building a Job Board API, Part 32: The Fresh Machine Found Two Bugs"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Where we are<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Hi, I&#8217;m Reza. In my newsletter, Root Access, I am sharing one of my projects from the very beginning: a Job Board API built with Django, Postgres, Docker, AWS and Azure. I am a junior engineer looking for my first SRE, DevOps or Cloud job, and that is why I build my projects in public. You can see how I think, what breaks, and how I fix it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the last three parts, I built dev-toolchain, a shared Ansible role that installs and verifies a project&#8217;s local tools. Every test so far ran on thor, my home lab machine. And thor already had almost everything. So most &#8220;install&#8221; steps only ever skipped.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Setup&#8217;s &#8220;Done when&#8221; line is:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One command readies a fresh machine, and a second run reports changed=0.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two things were missing for that:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>One command. So far it was several: install uv, install Ansible, install the role, run the playbook. Ansible can&#8217;t install itself.<\/li>\n\n\n\n<li>A fresh machine. I needed a clean Ubuntu 26.04 with nothing on it, which I can throw away and rebuild every time.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">So this part adds a bootstrap script and a fresh-machine test. And the fresh machine did exactly what it was for: it found two real bugs that thor had been hiding.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1437\" height=\"310\" src=\"http:\/\/rezachegini.com\/wp-content\/uploads\/2026\/11\/job-board-api-part-32-diagram.png\" alt=\"Three fresh runs and two fixes to reach changed=0\" class=\"wp-image-367\" srcset=\"https:\/\/rezachegini.com\/wp-content\/uploads\/2026\/11\/job-board-api-part-32-diagram.png 1437w, https:\/\/rezachegini.com\/wp-content\/uploads\/2026\/11\/job-board-api-part-32-diagram-300x65.png 300w, https:\/\/rezachegini.com\/wp-content\/uploads\/2026\/11\/job-board-api-part-32-diagram-1024x221.png 1024w, https:\/\/rezachegini.com\/wp-content\/uploads\/2026\/11\/job-board-api-part-32-diagram-768x166.png 768w\" sizes=\"auto, (max-width: 1437px) 100vw, 1437px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Each bug became a tagged patch release, and the project&#8217;s pin moved with it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">scripts\/bootstrap.sh: one command<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ansible can&#8217;t install itself, and ansible-galaxy must run before the playbook. So a small shell script wraps everything. It takes a bare Ubuntu machine with only sudo to a ready dev toolchain.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/env bash\n# One command readies an Ubuntu machine for this project. Run from anywhere:\n#   .\/scripts\/bootstrap.sh            (extra arguments go to ansible-playbook, e.g. --tags verify)\n# Safe to run again: everything below installs only what's missing.\nset -euo pipefail<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>#!\/usr\/bin\/env bash.<\/strong> The script uses bash arrays, so it must not run under sh, which is dash on Ubuntu.<\/li>\n\n\n\n<li><strong>set -euo pipefail<\/strong> makes bash strict:<ul class=\"wp-block-list\"><\/ul>\n<li>-e: stop at the first failing command. Without it, a failed apt-get install would let the script continue and fail later with a confusing error.<\/li>\n\n\n\n<li>-u: an unset variable is an error. A typo like $UV_VERSON stops the script.<\/li>\n\n\n\n<li>-o pipefail: a pipeline fails if any part fails. Without it, curl \u2026 | sh would count as a success even if curl failed.<\/li>\n<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>UV_VERSION=\"0.13.0\"                       # same uv as the Dockerfile and the dev-toolchain role\ncd \"$(dirname \"$0\")\/..\"                   # the repo root, where ansible.cfg and bootstrap.yml live\nexport PATH=\"$HOME\/.local\/bin:$PATH\"      # uv and ansible-core install here<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>One uv version everywhere: the Dockerfile, the role, and this script.<\/li>\n\n\n\n<li>cd &#8220;$(dirname &#8220;$0&#8243;)\/..&#8221; goes to the repo root, wherever you run the script from. Ansible reads ansible.cfg from the current folder, so running from somewhere else would lose roles_path and inventory.<\/li>\n\n\n\n<li>export PATH. On a fresh machine, ~\/.local\/bin isn&#8217;t on PATH until the next login. Without this line, command -v uv would fail right after installing uv.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 1: Ansible&#8217;s own prerequisites<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>missing=()\nfor pkg in curl git python3-apt; do\n  dpkg -s \"$pkg\" &gt;\/dev\/null 2&gt;&amp;1 || missing+=(\"$pkg\")\ndone\nif &#91; ${#missing&#91;@]} -gt 0 ]; then\n  echo \"==&gt; Installing prerequisites: ${missing&#91;*]}\"\n  sudo apt-get update -qq\n  sudo apt-get install -y -qq \"${missing&#91;@]}\"\nfi<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Three packages Ansible needs before the role can run: curl for the uv installer, git so ansible-galaxy can clone the role, and python3-apt for the apt module (my old trap from Part 29).<\/li>\n\n\n\n<li>dpkg -s asks the package database if a package is installed. Only the exit code matters.<\/li>\n\n\n\n<li>|| missing+=(\u2026) adds the package only if the check failed. The || also stops set -e from ending the script on that &#8220;failure&#8221;.<\/li>\n\n\n\n<li>On a machine that has all three, nothing runs: no sudo, no apt-get update. So a rerun is fast and quiet.<\/li>\n\n\n\n<li>-y means no &#8220;Do you want to continue?&#8221; prompt, which would hang a script.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 2: uv, then Ansible<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if ! command -v uv &gt;\/dev\/null 2&gt;&amp;1; then\n  echo \"==&gt; Installing uv ${UV_VERSION}\"\n  curl -LsSf \"https:\/\/astral.sh\/uv\/${UV_VERSION}\/install.sh\" | sh\nfi\nif ! command -v ansible-playbook &gt;\/dev\/null 2&gt;&amp;1; then\n  echo \"==&gt; Installing ansible-core\"\n  uv tool install \"ansible-core&gt;=2.17\"\nfi<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>command -v is the POSIX way to ask &#8220;is this command on PATH?&#8221;.<\/li>\n\n\n\n<li>curl -LsSf: -L follows redirects, -s is silent, -S still shows errors, and -f fails on HTTP errors, instead of piping an HTML error page into sh. With pipefail, a failed download stops the script.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 3: the role, then the playbook<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ansible-galaxy role install -r requirements.yml\nif sudo -n true 2&gt;\/dev\/null; then ask=(); else ask=(--ask-become-pass); fi\nansible-playbook bootstrap.yml \"${ask&#91;@]}\" \"$@\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The middle line answers one question: when should Ansible ask for the sudo password?<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>sudo -n true means &#8220;run true with sudo, but never prompt&#8221;. It works only if sudo needs no password, for example in a test container or with a recently cached password.<\/li>\n\n\n\n<li>If it works, ask is empty, and Ansible doesn&#8217;t ask. If not, ask is &#8211;ask-become-pass (the long form of -K).<\/li>\n\n\n\n<li>Why it matters: with -K always on, the container test would wait for a password that nobody types. With -K never on, a normal laptop would fail on the first sudo task. This way, the same script works in both places.<\/li>\n\n\n\n<li>&#8220;$@&#8221; passes on any arguments. So .\/scripts\/bootstrap.sh &#8211;tags verify runs only the health check from Part 31.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">A fresh machine in a container<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A real new laptop for every test would take hours. A VM would be closer to real, but slower and more setup. So I used an ubuntu:26.04 container as a throwaway &#8220;fresh machine&#8221;. It is clean every time, and it is the same release as thor.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># A \"fresh Ubuntu 26.04\" for testing scripts\/bootstrap.sh: a normal user with sudo, nothing else.\nFROM ubuntu:26.04\nRUN apt-get update \\\n &amp;&amp; apt-get install -y --no-install-recommends sudo \\\n &amp;&amp; rm -rf \/var\/lib\/apt\/lists\/* \\\n &amp;&amp; useradd --create-home --shell \/bin\/bash dev \\\n &amp;&amp; echo \"dev ALL=(ALL) NOPASSWD:ALL\" &gt; \/etc\/sudoers.d\/dev \\\n &amp;&amp; chmod 0440 \/etc\/sudoers.d\/dev\nUSER dev\nWORKDIR \/home\/dev<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Only sudo is installed. No curl, no git, no python3-apt, no Docker. Everything the script needs, it must install itself. That is what &#8220;fresh&#8221; means.<\/li>\n\n\n\n<li>&#8211;no-install-recommends. No extra suggested packages that could hide a missing prerequisite.<\/li>\n\n\n\n<li>rm -rf \/var\/lib\/apt\/lists\/* deletes the package index. It keeps the image small, and it makes the test honest: the script must run apt-get update itself, like on a real machine.<\/li>\n\n\n\n<li>A normal user, dev, not root. The role installs things per user, in ~\/.local\/bin. Testing as root would hide bugs. And this detail is what exposed both bugs: dev is not in the docker group at the start.<\/li>\n\n\n\n<li>NOPASSWD lets the test run unattended. It also tests the sudo -n true branch of the script, the one without -K.<\/li>\n\n\n\n<li>chmod 0440 is the standard mode for sudoers files. sudo ignores files with unsafe permissions.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Running the test<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>docker build -t jobboard-fresh scripts\/fresh-machine-test\ndocker run -d --name jb-fresh -v \/var\/run\/docker.sock:\/var\/run\/docker.sock jobboard-fresh sleep infinity\ndocker exec jb-fresh mkdir -p \/home\/dev\/app\ngit archive HEAD | docker exec -i jb-fresh tar -x -C \/home\/dev\/app<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>sleep infinity keeps the container alive, so the bootstrap can run twice on the same machine. Run 2 proves idempotency only if it runs where run 1 ran.<\/li>\n\n\n\n<li>The mounted Docker socket. The role installs the Docker client inside the container, and it talks to thor&#8217;s daemon through the socket. This has a limit, which I come back to at the end.<\/li>\n\n\n\n<li>git archive HEAD | tar -x copies only committed files into the container. A file I forgot to commit, or .env, or roles\/, won&#8217;t be there. That is why I committed every fix before each test.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>docker exec jb-fresh bash -c 'cd ~\/app &amp;&amp; time .\/scripts\/bootstrap.sh' &gt; \/tmp\/fresh-run1.txt 2&gt;&amp;1; echo \"run 1 exit: $?\"\ngrep -E \"\\\"msg\\\"|fatal|^localhost|^real\" \/tmp\/fresh-run1.txt\ndocker exec jb-fresh bash -c 'cd ~\/app &amp;&amp; .\/scripts\/bootstrap.sh' &gt; \/tmp\/fresh-run2.txt 2&gt;&amp;1; echo \"run 2 exit: $?\"\ntail -4 \/tmp\/fresh-run2.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The full output goes to a file for debugging. Then grep shows only the lines that matter: the version messages, failures, the recap, and the time. The exit code is the real signal: set -e and the verify assert mean a non-zero exit is a failure.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Bug 1: awslocal was broken, only on a fresh machine<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The first fresh run on v0.2.0 installed everything, and then failed, after 1m10.6s:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>awslocal: MISSING OR BROKEN (exit 1)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Every other tool passed. And on thor, this same check had always passed. The raw output showed the reason:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Error: Docker is not available ... permission denied ... \/var\/run\/docker.sock<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here is the chain:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>lstk aws &#8211;version checks the Docker daemon first, even when it is only printing a version.<\/li>\n\n\n\n<li>The role had just added dev to the docker group.<\/li>\n\n\n\n<li>But in Linux, a new group membership only works after the next login. So dev still couldn&#8217;t reach the Docker socket.<\/li>\n\n\n\n<li>lstk printed its error on stdout, grep aws-cli\/ found nothing, and the check failed.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">On thor, my user reza has been in the docker group for a long time. That hid the bug completely. This is exactly why the fresh-machine test exists.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note that the verify step did its job, too: it failed loudly and named the tool.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The fix, v0.2.1<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In Part 31, only the Azurite check ran as root. Now there is a list of every check that talks to the Docker daemon:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Checks that talk to the Docker daemon. They run as root: right after the role adds the user to\n# the docker group, that membership only works after the next login (lstk aws checks Docker first).\ntoolchain_verify_as_root: &#91;azurite, awslocal]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And the verify task uses it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>become: \"{{ tool in toolchain_verify_as_root }}\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Jinja2&#8217;s in tests list membership. So every daemon-dependent check is listed, and explained, in one place.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The other option was to tell the user to run the bootstrap again after logging in. But then the first run would always fail on a new machine. That is not &#8220;one command&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The fix also adds a message, telling the user to log in again. Without it, their first docker ps after bootstrapping would fail with the same permission error, and no explanation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before testing it on a fresh machine, I ran the role&#8217;s own test on thor with v0.2.1: awslocal: aws-cli\/2.40.2 \u2026, azurite: \u20263.37.0, and ok=46 changed=0 failed=0. The fix didn&#8217;t break the existing machine.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Bug 2: the re-login message never appeared<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The fresh run on v0.2.1 passed: exit 0, failed=0, all 9 versions including awslocal, in 1m10.3s. Bug 1 was fixed. But the new message, dev was just added to the &#8216;docker&#8217; group\u2026, was missing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The cause: register keeps only the last run<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>tasks\/tools\/docker.yml runs twice per bootstrap: once for the docker tool, and again because azurite.yml includes it (Azurite needs Docker).<\/li>\n\n\n\n<li>The first run of the group task added dev to the group. Result: changed.<\/li>\n\n\n\n<li>The second run found dev already in the group. Result: ok. And register overwrote the first result.<\/li>\n\n\n\n<li>So when the message task checked is changed, the saved result said &#8220;not changed&#8221;.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The code looked correct. It only breaks when the same task runs twice.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The fix, v0.2.2: a flag that can only be set<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>- name: \"docker | let {{ ansible_facts&#91;'user_id'] }} run docker without sudo\"\n  ansible.builtin.user:\n    name: \"{{ ansible_facts&#91;'user_id'] }}\"\n    groups: docker\n    append: true\n  become: true\n  register: toolchain_docker_group\n\n# register keeps only the LAST run, and this file runs again via azurite. set_fact with a\n# `when` only ever SETS the flag, so a later \"ok\" run can't clear it.\n- name: docker | remember that the user was just added to the docker group\n  ansible.builtin.set_fact:\n    toolchain_docker_group_added: true\n  when: toolchain_docker_group is changed<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>On the run where the group was added, the flag becomes true.<\/li>\n\n\n\n<li>On any later run, is changed is false, so the task is skipped. A skipped set_fact doesn&#8217;t touch the flag. Once it is set, it stays set.<\/li>\n\n\n\n<li>The comment explains why. The plain register version looks correct, and someone might &#8220;simplify&#8221; it back.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The other option was to remove the second include from azurite.yml. But then a project that asks for azurite without docker would break.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And the message, as the last task of the role:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>- name: Tell the user to log in again if they were just added to the docker group\n  ansible.builtin.debug:\n    msg: &gt;-\n      {{ ansible_facts&#91;'user_id'] }} was just added to the 'docker' group. Log out and back in\n      (or run: newgrp docker) before using docker without sudo.\n  when: toolchain_docker_group_added | default(false)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The last task, so the message shows near the end of the output, where people actually read.<\/li>\n\n\n\n<li>newgrp docker starts a new shell with the group active, a shortcut instead of a full logout.<\/li>\n\n\n\n<li>| default(false). A project that doesn&#8217;t ask for docker never runs docker.yml, so the flag doesn&#8217;t exist. Without default, the when would fail with &#8220;undefined variable&#8221;.<\/li>\n\n\n\n<li>Not tagged verify. The health check doesn&#8217;t change groups, so the message doesn&#8217;t apply there.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Testing a &#8220;first time&#8221; fix needs a real first time<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I couldn&#8217;t test v0.2.2 in the old container. There, dev was already in the docker group, so the message would never show. So I built a brand-new container for the final test.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Final results<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run 1 on v0.2.2, in a brand-new container:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>exit 0, ok=54 changed=14 failed=0<\/li>\n\n\n\n<li>all 9 version lines, plus dev was just added to the &#8216;docker&#8217; group\u2026<\/li>\n\n\n\n<li>1m9.4s from a bare Ubuntu with only sudo to a ready toolchain<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Run 2, in the same container:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>exit 0, ok=43 changed=0 failed=0 skipped=23<\/li>\n\n\n\n<li>no group message, because nothing was added<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Run 2 has fewer ok tasks (43 instead of 54), because the install steps, the flag and the message are now skipped. Everything is already there.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Every fix is a pushed, tagged release in the role repo: v0.1.0, v0.2.0, v0.2.1 and v0.2.2. The project&#8217;s requirements.yml was bumped and committed before each test.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Done when: &#8220;one command readies a fresh machine, and a second run reports changed=0.&#8221; Met.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One honest note: I didn&#8217;t paste a thor role test for v0.2.2. The fresh run covers it, because the container fetched v0.2.2 from GitHub and passed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Known limitations<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The container can&#8217;t prove the Docker daemon starts on a fresh install. It uses thor&#8217;s daemon through the socket. On a real new machine, the docker.io package starts the daemon with systemd.<\/li>\n\n\n\n<li>&#8220;Present&#8221; means any version, except the pinned tools. lstk 1.4.5, uv 0.13.0 and the Azurite image are pinned. Everything else is whatever is current that day. I measured it: the fresh machine got aws-cli 2.40.3, while thor has 2.40.2. For a dev toolchain that is acceptable, because the app&#8217;s runtime versions are pinned in its Dockerfile and lockfile.<\/li>\n\n\n\n<li>The role assumes the machine&#8217;s apt sources work.<\/li>\n\n\n\n<li>The first docker use without sudo needs a re-login. The role says so, but it can&#8217;t do it for you.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What I learned<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A machine that already has everything can&#8217;t test your installer. thor hid both bugs. The fresh machine found them.<\/li>\n\n\n\n<li>Linux reads group membership at login. Anything in the same run that needs the new group must run as root.<\/li>\n\n\n\n<li>register keeps only the last run of a task. If a task can run twice, use a set_fact flag that is only ever set.<\/li>\n\n\n\n<li>Test only what is committed. git archive HEAD makes forgotten files visible.<\/li>\n\n\n\n<li>Strict bash: set -euo pipefail, and check-then-act with dpkg -s and command -v, so a rerun does nothing.<\/li>\n\n\n\n<li>sudo -n true lets one script work both unattended and on a laptop.<\/li>\n\n\n\n<li>Patch releases for bug fixes. v0.2.1 and v0.2.2, each pinned by the project.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What is next<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Setup phase is done: one command, a fresh machine, and changed=0 on the second run. And my next projects can use the same role, pinned to the version they want.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Where we are Hi, I&#8217;m Reza. In my newsletter, Root Access, I am sharing one of my projects from the very beginning:&hellip;<\/p>\n","protected":false},"author":2,"featured_media":366,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_rezaops_part":"32","_rezaops_linkedin_url":"https:\/\/www.linkedin.com\/pulse\/building-job-board-api-part-32-fresh-machine-found-two-reza-chegini-nqv0c\/","footnotes":""},"categories":[63,85,10,116,74],"tags":[65,60,222,8,111,35,118,194,25,112,17,221],"series":[117],"class_list":["post-368","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ansible","category-aws","category-devops","category-django","category-linux","tag-ansible","tag-aws","tag-azurite","tag-devops","tag-django","tag-docker","tag-job-board","tag-localstack","tag-python","tag-rest-api","tag-ubuntu","tag-uv","series-job-board-api"],"jetpack_featured_media_url":"https:\/\/rezachegini.com\/wp-content\/uploads\/2026\/11\/job-board-api-part-32-cover.png","_links":{"self":[{"href":"https:\/\/rezachegini.com\/index.php?rest_route=\/wp\/v2\/posts\/368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rezachegini.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rezachegini.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rezachegini.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/rezachegini.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=368"}],"version-history":[{"count":1,"href":"https:\/\/rezachegini.com\/index.php?rest_route=\/wp\/v2\/posts\/368\/revisions"}],"predecessor-version":[{"id":369,"href":"https:\/\/rezachegini.com\/index.php?rest_route=\/wp\/v2\/posts\/368\/revisions\/369"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rezachegini.com\/index.php?rest_route=\/wp\/v2\/media\/366"}],"wp:attachment":[{"href":"https:\/\/rezachegini.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rezachegini.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rezachegini.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=368"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/rezachegini.com\/index.php?rest_route=%2Fwp%2Fv2%2Fseries&post=368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}