installing ansible in isolated virtual env

33 views
Skip to first unread message

Tony Wong

unread,
Jun 16, 2020, 9:58:54 AM6/16/20
to ansible...@googlegroups.com
Is there a way to install ansible on osX in an isolated virtual environment? without having to setup a ubuntu VM?

I dont want the ansible binaries or whatever software it installs on osx to interfere with my working environment

Dick Visser

unread,
Jun 16, 2020, 10:18:02 AM6/16/20
to ansible...@googlegroups.com
python3 -m venv venv
source venv/bin/activate
pip install ansible


ansible --version
ansible 2.9.9
config file = /Users/dnmvisser/.ansible.cfg
configured module search path =
['/Users/dnmvisser/.ansible/plugins/modules',
'/usr/share/ansible/plugins/modules']
ansible python module location =
/Users/dnmvisser/venv/lib/python3.7/site-packages/ansible
executable location = /Users/dnmvisser/venv/bin/ansible
python version = 3.7.3 (default, Sep 5 2019, 17:14:41) [Clang
11.0.0 (clang-1100.0.33.8)]


On Tue, 16 Jun 2020 at 15:58, Tony Wong <tdub...@gmail.com> wrote:
>
> Is there a way to install ansible on osX in an isolated virtual environment? without having to setup a ubuntu VM?
>
> I dont want the ansible binaries or whatever software it installs on osx to interfere with my working environment
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CALmkhkq2QdoMbdYxJ-Hr%2BO%3DJfrfvkfxx0Sf%3D5ojL6TWW4%3D85-w%40mail.gmail.com.



--
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

Tony Wong

unread,
Jun 16, 2020, 10:37:18 AM6/16/20
to ansible...@googlegroups.com
Thanks

but i got this

NAR33051M:Resources twong$ sudo python3 -m venv venv
Password:
Error: [Errno 1] Operation not permitted: '/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/venv'
pyenv: no such command `sh-activate'
NAR33051M:Resources twong$ 



Antony Stone

unread,
Jun 16, 2020, 11:04:54 AM6/16/20
to ansible...@googlegroups.com
On Tuesday 16 June 2020 at 16:36:51, Tony Wong wrote:

> NAR33051M:Resources twong$ sudo python3 -m venv venv
> Password:
> Error: [Errno 1] Operation not permitted:
> '/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resour
> ces/venv' pyenv: no such command `sh-activate'

Did you try it as written - without the "sudo"?

> On Tue, Jun 16, 2020 at 7:17 AM Dick Visser <dick....@geant.org> wrote:
> > python3 -m venv venv
> > source venv/bin/activate
> > pip install ansible
> >
> >
> > ansible --version
> > ansible 2.9.9


Antony.

--
The gravitational attraction exerted by a single doctor at a distance of 6
inches is roughly twice that of Jupiter at its closest point to the Earth.

Please reply to the list;
please *don't* CC me.

Tony Wong

unread,
Jun 16, 2020, 11:08:09 AM6/16/20
to ansible...@googlegroups.com
ok fixed the issue.


Tony Wong

unread,
Jun 16, 2020, 11:16:20 AM6/16/20
to ansible...@googlegroups.com
where is the venv stored? how do I remove it? 

how do i enter the environment?

like this everytime I open a terminal?
 
source venv/bin/activate

how do i list what venv insgtalled and how do I remove


how do i exit?

when i try to. exit its stuck on this

(venv) NAR33051M:~ twong$ venv
-bash: venv: command not found
(venv) NAR33051M:~ twong$ virtualenv
-bash: virtualenv: command not found
(venv) NAR33051M:~ twong$ ansible
(venv) NAR33051M:~ twong$ exit
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

Dick Visser

unread,
Jun 17, 2020, 12:56:16 AM6/17/20
to ansible...@googlegroups.com
This is a support list for problems related to ansible, not for basic system administration help. 
Instead of copy pasting commands please do a little bit of effort yourself and at least try to understand what they mean. 
If you spend one minute on google you will find the answers to all your questions. Please also do that before posting future questions here.

One advice for now, if you do copy paste commands without knowing what they mean, certainly not use sudo.



--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.
Reply all
Reply to author
Forward
0 new messages