使用 ansible 运行 mkvirtualenv [英] running mkvirtualenv using ansible

查看:27
本文介绍了使用 ansible 运行 mkvirtualenv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 ansible 配置一台机器.我设法在虚拟机上安装了 virtualenv 和 virtualenvwrapper .但是,我似乎无法在 vm 上创建 virtualenv.

I am provisioning a machine using ansible. I managed to install virtualenv and virtualenvwrapper fine on the vm. However, I can't seem to create a virtualenv on the vm.

我正在尝试使用

- name: create virtualenv test
  shell: >
    executable=/bin/zsh
    source `which virtualenvwrapper.sh` && mkvirtualenv test
  register: run_cmd

- name: create virtualenv test
  action: command mkvirtualenv test

但没有运气.有什么想法吗?

but no luck. Any ideas?

推荐答案

Source 仅将 virtualenvwrappers 添加到调用它的 shell,然后立即退出.无论如何,我不会为此使用 virtualenvwrapper.直接调用 virtualenv.

Source only adds virtualenvwrappers to the shell its invoked in, which you then exit immediately. In any case, I would not use virtualenvwrapper for this. Invoke virtualenv directly.

这篇关于使用 ansible 运行 mkvirtualenv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆