문제

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.

도움이 되었습니까?

해결책

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top