4

The following repo-install.sls used to work on ubuntu 16, python 3.5

repo-install-dependencies:
    pkg.installed:
        - names:
            - python3-pip
            - python3-venv
            - mercurial
            - git
            - subversion

bin_env:
    virtualenv.managed:
        - name: {{ bin_env }}
        - pip_pkgs: 
            - pip
            - setuptools
        - require:
            - pkg: repo-install-dependencies
        - venv_bin: "/usr/bin/pyvenv"

On a new Ubuntu 20 server, I am trying to get the above working using salt 3002.2. I know on python 3.8 use of pyvenv is deprecated and it is recommended to use python3 -m venv <dirname> to create virtual env.

My question is, how do I set bin_env? Is virtualenv.managed still relevant, if yes, how can we make it pick venv in python distribution? Or are we supposed to use custom function, something like the following?

bin_env:
    cmd.run:
        - name : python3 -m venv {{ bin_env }}
        - require:
                - pkg: repo-install-dependencies
kundan
  • 1,278
  • 14
  • 27

0 Answers0