Forgot to mention - Ansible 2.2.1.0 on the control machine, pip 1.5.6 from 
/usr/lib/python2.7/dist-packages (python 2.7) on the Pi.


On Monday, January 23, 2017 at 10:23:22 AM UTC-5, Greg Trasuk wrote:
>
> I'm seeing a funny behavior when using Ansible to manage an installation 
> on a Raspberry Pi running Raspbian Jessie lite.
>
> The playbook includes the following, to install a Python program called 
> 'power-cycle' from a GitHub repo:
>
> - hosts: power_controllers
>   tasks:
>     - name: Install the power cycle utility
>       pip: name='git+
> http://github.com/burlington-arc/power-cycle.git#egg=power-cycle'
>
> After running the playbook, the 'power-cycle' command is available and 
> works fine.  However, if I run it after a reboot, it fails with a 
> 'distribution not found':
>
> pi@barcpi004:~ $ power-cycle
> Traceback (most recent call last):
>   File "/usr/local/bin/power-cycle", line 5, in <module>
>     from pkg_resources import load_entry_point
>   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2876, in 
> <module>
>     working_set = WorkingSet._build_master()
>   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 449, in 
> _build_master
>     ws.require(__requires__)
>   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 745, in 
> require
>     needed = self.resolve(parse_requirements(requirements))
>   File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 639, in 
> resolve
>     raise DistributionNotFound(req)
> pkg_resources.DistributionNotFound: power-cycle==1.0.2
>
> In other words, the installation with 'pip' didn't survive a reboot.
>
> If I install the same egg from the command line, it all works fine and 
> survives the reboot.
>
> It appears that the pip module is doing some kind of incomplete or perhaps 
> temporary installation.  After the playbook has run, the 
> '/usr/local/lib/python2.7/dist-packages/' dir looks like this:
>
> pi@barcpi004:~ $ ls /usr/local/lib/python2.7/dist-packages/
> daemon                     lockfile
> docutils                   lockfile-0.12.2.dist-info
> docutils-0.13.1.dist-info  power-cycle.egg-link
> easy-install.pth           python_daemon-2.1.2.dist-info
>
> ...whereas, after running 'sudo pip install git+
> http://github.com/burlington-arc/power-cycle.git#egg=power-cycle' from 
> the command line, it looks like:
> pi@barcpi004:~ $ ls /usr/local/lib/python2.7/dist-packages/
> daemon                     lockfile-0.12.2.dist-info
> docutils                   power_cycle-1.0.2.egg-info
> docutils-0.13.1.dist-info  power-cycle.egg-link
> easy-install.pth           powerpi
> lockfile                   python_daemon-2.1.2.dist-info
> ...which has a directory for 'powerpi', which has the required scripts in 
> it.
>
> Any ideas?  Am I missing something with the 'pip' task?
>  
>
Thanks in advance,
>
> Greg
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c5e07c95-528a-4e05-bb1b-21c3d10b15db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to