How would you install a python module with a chef?

We use EngineYard, which has Python installed by default. But when we turned on SSL, we got the following error message from our chef's recipe for the lottery.

WARNING: The ssl module is missing. Using an unreliable workaround, the host ID cannot be verified. If possible, install the ssl module or a newer version of Python (2.6).

I'm looking for a way to install an SSL module with a chef's recipe, but I just don't have enough experience. Can someone point me in the right direction?

Resources: Logentries Chef Recipe: https://github.com/logentries/le_chef

Logentries EY docs: https://logentries.com/doc/engineyard/

SSL module: http://pypi.python.org/pypi/ssl/

+6
source share
3 answers

I just wrote a recipe for this, and now I can run the latest Logentries client on EngineYard. Here you are:

file_dir = "/mnt/src/python-ssl" file_name = "ssl-1.15.tar.gz" file_path = File.join(file_dir,file_name) uncompressed_file_dir = File.join(file_dir, file_name.split(".tar.gz").first) directory file_dir do owner "deploy" group "deploy" mode "0755" recursive true action :create end remote_file file_path do source "http://pypi.python.org/packages/source/s/ssl/ssl-1.15.tar.gz" mode "0644" not_if { File.exists?(file_path) } end execute "gunzip ssl" do command "gunzip -c #{file_name} | tar xf -" cwd file_dir not_if { File.exists?(uncompressed_file_dir) } end installed_file_path = File.join(uncompressed_file_dir, "installed") execute "install python ssl module" do command "python setup.py install" cwd uncompressed_file_dir not_if { File.exists?(installed_file_path) } end execute "touch #{installed_file_path}" do action :run end 
+3
source

Now a solution appears with better community support (based on the fact that it is registered on the opscode website).

You may try:

 include_recipe 'python' python_pip 'ssl' 

As described: here or here

+13
source

You can install the new Python using PythonBrew: https://github.com/utahta/pythonbrew . Just try installing libssl before creating, or it will still not be able to use SSL. However, based on the warning, it looks like SSL might work, but it will not be able to verify the host. Of course, this is one of the main goals of SSL, so it's probably not a starter.

NTN

0
source

All Articles