Found it. The textwrap.dedent combined with the f-string interpolation of do_lines breaks the indentation. The first line of do_lines gets the f-string's indentation (4 spaces from dedent context), but subsequent lines have only their own 2-space indent, losing the nesting under digital-ocean:.
The fix is to not use textwrap.dedent with multi-line f-string interpolation, or to properly indent do_lines: