It looks interesting, now, I have a few observations, that I think can help to improve the playbook.
- Why always use
dist-upgrade? It would be safer just to useapt upgradeand leave theapt dist-upgradefor manual intervention, to ensure nothing breaks. - Using
autoremoveandautocleancan bring some headaches with over enthusiastic packages removal. cd /var/discourse && git pullalthough nice, not needed. My understanding is that./launcher rebuild appalready does thegit pull.
I think the playbook could get a lot more powerful using variables, like choosing which upgrade process will be used. Adding conditionals for autoremove and autoclean. As well for the rebooting as it’s not always needed.