Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Salt - multiple requirement files to virtualenv

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.

like image 423
Tom Tichý Avatar asked Dec 10 '25 08:12

Tom Tichý


1 Answers

There is an easier way, set no_chown: True on the virtualenv and it works. See this issue for more info:

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

like image 64
Frank Wiles Avatar answered Dec 12 '25 23:12

Frank Wiles



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!