I am writing some Ansible plays for setting up virtual virtual python, and also during development to update the python package and restart the server. I am having problems getting a service pack package. I donβt care how it is done, but during development I would prefer to just add the path to the python path in virtualenv and then just restart the server, but I still do not understand how to do this in Ansible.
So my question is how to configure the local git repository, which is either installed in the packages of the virtualenv site or configures Ansible for sys.path. Includes the repo location using the correct virtualenv.
Currently, I tried:
sudo pip install ~/workspace/python-repo
Before installing the package, I renamed the class that I have from Authenticator to something completely wrong, like Authen. The class shows Authen during a new installation. Then I change the class name to the correct name (Authenticator), downgrade and run
sudo pip install ~/workspace/python-repo
but after checking the actual file in the site packages, it still shows the name Authen, not the updated file.
How can I do this to use a local repo during development and get instant updated files in my environment? And also make it a repeatable process through Ansible.
Here is what I am trying to do in Ansible. My first game is setting up an environment that I want to run only once.
- name: Install python-repo local_action: pip name=${python_root} virtualenv=${working_dir}/development
$ {python_root} is just the place for my python project, and of course the working directory is the new virtualenv setting.
Then somehow I want the development game to update the python repository in virtualenv. This is what I have, but it doesnβt work either.
- name: Update python-repo local_action: pip name=${python_root} virtualenv=${working_dir}/development state=latest - name: Restart services. local_action: service name=${item} state=restarted with_items: ${services}