# Playbook Ansible pour la mise à jour de Discourses

**URL:** <https://meta.discourse.org/t/ansible-playbook-for-updating-discourses/119268>\
**Category:** Sysadmins\
**Tags:** explanation\
**Created:** [Juin 1, 2019, 10:01 UTC](https://meta.discourse.org/t/ansible-playbook-for-updating-discourses/119268 "2019-06-01T10:01:07Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![marianord](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marianord/32/90502_2.png) [@marianord](https://meta.discourse.org/u/marianord)\
**Post date:** [Juin 1, 2019, 6:52 UTC](https://meta.discourse.org/t/ansible-playbook-for-updating-discourses/119268/4 "2019-06-01T18:52:45Z")

</div>

The possible issue (is not common, but possible) is that by using anything else than `apt upgrade` you might break something else. Assuming you’d like a broader public to use that playbook giving the choice of using `upgrade` or `dist-upgrade` is a nice to have. I’d default it to `apt upgrade` and enable a variable to change it to `apt dist-upgrade`.

Why? Because `apt upgrade` is the only command that ensures it won’t break something upgrading other things. For example, let’s say someone is running Discourse with nginx as a reverse proxy. And for some hypothetical reason both nginx and Docker (or Redis, PostgreSQL, etc) use `libhypothetical`. Nginx doesn’t update it to the lastest version, but that other package does. If the library made breaking changes Nginx will stop working if the system is updated with anything else than `apt upgrade`, bringing the service down.

The issue with `autoremove` and `autoclean` is the same one as with `apt dist-upgrade`, if `libhypothetical` is a dependency of two packages, one updates and doesn’t needs it anymore `apt` might fail to know that the other package still needs it and remove it. Having old packages, for me, is not that big of an issue as they don’t usually take more than a couple hundred megabytes, until I get in there manually and remove them.

My understanding is that they updated the `.launcher rebuild` command and added the `git pull` that wasn’t there before. But people more knowledgeable about that can tell us definitively.

---

_[View the full topic](https://meta.discourse.org/t/ansible-playbook-for-updating-discourses/119268)._
