saltstack/salt — Issue #683: modules fail before required packages are installed
Author: akoumjian
Created: 2012-02-10 19:32:22+00:00
State: open

I think this could be a serious bug worth a high priority. The following very simple sls configuration will fail:

```yaml
/var/www/env/:
virtualenv:
- manage
- no_site_packages: True
- require:
- pkg: python-virtualenv

python-virtualenv:
pkg:
- installed
```
With the following error:

```
local:
Data failed to compile:
----------
State virtualenv.manage found in sls webserver is unavailable
```

thatch45@2a0d6df69795bf21fe6ad9fb93a19cebc6ff1633 attempted to fix the error, but I think the solution is incorrect. The problem is that the `require` needs to be executed before we check to see if the virtualenv module is available or not. It's also possible I do not understand when salt is checking for available modules, but the error persists.