3

I would like to manage my Django project with Salt (http://saltstack.com). In my states I have

/srv/MyProject/venv:
    virtualenv.managed:
        - no_site_packages: True
        - runas: myproject
        - requirements: /srv/MyProject/src/requirements.txt
        - require:
            - user: myproject

And in requirements.txt I load other files (production.txt, local.txt...):

-r requirements/production.txt

When I run salt, it fails:

Could not open requirements file: [Errno 2] No such file or directory: '/tmp/requirements/production.txt'

How can I change path from /tmp/ to /srv/MyProject/src/? I tried to use cwd option, but it is the same.

4

2 回答 2

4

有一种更简单的方法,在 virtualenv 上设置 no_chown: True 并且它可以工作。有关更多信息,请参阅此问题:

https://github.com/saltstack/salt/pull/4832

于 2013-11-04T20:38:15.123 回答
0

对我有用的是在盐根中添加一个 requirements.txt 具有:

-r /srv/MyProject/src/requirements.txt

然后在该州,通过盐链接到它,如下所示:

- requirements: salt://requirements.txt

然后,这使您可以正常包含更多要求而不会出现问题。

于 2013-10-21T22:17:58.527 回答