how to activate virtualenv on remote host

54 views
Skip to first unread message

SysAdmin EM

unread,
Feb 6, 2023, 4:30:39 PM2/6/23
to ansible...@googlegroups.com
Hi all, i try activate an virtualenv on remote host but not work.

I see this error:

fatal: [wc2-prod]: FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": true,
    "cmd": "source env/bin/activate",
    "delta": "0:00:00.004889",
    "end": "2023-02-06 20:45:55.637264",
    "invocation": {
        "module_args": {
            "_raw_params": "source env/bin/activate",
            "_uses_shell": true,
            "argv": null,
            "chdir": "/opt/wc2_3.0/",
            "creates": null,
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": false
        }
    },
    "msg": "non-zero return code",
    "rc": 127,
    "start": "2023-02-06 20:45:55.632375",
    "stderr": "/bin/sh: 1: source: not found",
    "stderr_lines": [
        "/bin/sh: 1: source: not found"
    ],
    "stdout": "",
    "stdout_lines": []
}

This is the tasks:

    - name: "Activating env"
      shell: . env/bin/activate
      args:
        chdir: '{{ webpath }}'

any ideas?? 
Reply all
Reply to author
Forward
0 new messages