Pattu
Pattu

Reputation: 3799

Ansible source virtualenvwrapper

I am trying to source virtualenvwrapper file on a remote server using Ansible.

- name: Source virtualenvwrapper
  shell: >
    . /usr/local/bin/virtualenvwrapper.sh

But I am getting Bad Substitution error. Any ideas on fixing it..??

Upvotes: 0

Views: 185

Answers (1)

Kadir
Kadir

Reputation: 1752

Ansible is not explicitly using /bin/sh and the shell module uses shell=True as an argument to subprocess. So probably Python subprocess uses /bin/sh and not all shell settings. There is an option for shell module named executable that can be used to specify another shell.

Try this one:

- name: Source virtualenvwrapper
  shell: >
    . /usr/local/bin/virtualenvwrapper.sh
  args:
    executable: /bin/bash

Upvotes: 1

Related Questions