saltstack/salt — Issue #431: Manipulating packages with 'apt' can cause a minion to hang
Author: fatbox
Created: 2012-01-05 03:27:59+00:00
State: open

When the `apt` module is used to install packages it can, and quite often does, cause the minion to hang.

It does this because apt-get is not being told that it's running without a user controlling it.

An easy way to replicate this issue is ensure the postfix package is not installed (`apt-get purge postfix`), then use `salt-call state.highstate` to apply a state that installs postfix. Once the apt-get command is launched you will be presented with the dpkg configuration dialog asking you to choose a postfix config type. Obviously if this happens with a minion running in daemon mode this will cause the minion to hang.

The solution is to set `DEBIAN_FRONTEND=noninteractive` in the environment before running apt-get.

I'll be submitting a pull request for this shortly.