This website contains age-restricted materials including nudity and explicit depictions of sexual activity.
By entering, you affirm that you are at least 18 years of age or the age of majority in the jurisdiction you are accessing the website from and you consent to viewing sexually explicit content.
It can do that, but it gets more complicated because you are doing this is in an imperative way. For example, in Nix it’s trivial to change the config and remove something.
In ansible there’s no guarantee installing a package and removing it won’t have side effects. You could install a DE and decide to switch back, but it already changed some files on your system
This is true. It can be done but would require functionality not included in stock Ansible.