Question

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.

Was it helpful?

Solution

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

OTHER TIPS

What worked for me was in salt roots to add a requirements.txt that had:

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

then in the state, link to it via salt like so:

- requirements: salt://requirements.txt

This then allows you to include further requirements as normal without issues.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top