Skip to content

Commit

Permalink
[#12] wip: kinda understand the issue, documenting and working on fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thmttch committed Sep 7, 2014
1 parent 0ba4985 commit 6787f39
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ gem 'chefspec'
gem 'kitchen-vagrant'

gem 'foodcritic'

gem 'chef-rewind'
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ To use it in a cookbook:
include_recipe 'anaconda::default'
```

## Warning! If you're also using the [python](https://github.com/poise/python) cookbook...

You MUST include `recipe[anaconda::python_workaround]`, otherwise subsequent
chef runs will fail. See [the
issue](https://github.com/thmttch/chef-continuum-anaconda/issues/12) for
details.

## Usage, recipes, attributes, and resources

The main recipe is `anaconda::default`. Include it in your runlist, and it will
Expand Down
5 changes: 0 additions & 5 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
version = node.anaconda.version
flavor = node.anaconda.flavor

# hack: the standard python cookbook gets confused and tries to upgrade
# setuptools since it can't find it; this will break the chef run.
# explicitly set version to trick python into not upgrading setuptools
node.force_default.python.setuptools_version = '3.6'

anaconda_install_dir = "#{node.anaconda.install_root}/#{version}"
installer = "Anaconda-#{version}-Linux-#{flavor}.sh"
installer_path = "#{Chef::Config[:file_cache_path]}/#{installer}"
Expand Down
22 changes: 22 additions & 0 deletions recipes/python_workaround.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Cookbook Name:: anaconda
# Recipe:: python_workaround
#
# Copyright (C) 2014 Matt Chu
#
# All rights reserved - Do Not Redistribute
#

# https://github.com/thmttch/chef-continuum-anaconda/issues/12

# hack: the standard python cookbook gets confused and tries to upgrade
# setuptools since it can't find it (TODO actually, i think because it's not
# the latest version); this will break the chef run.
Chef::Log.warn 'Applying the python workaround: https://github.com/thmttch/chef-continuum-anaconda/issues/12'

chef_gem 'chef-rewind'
require 'chef/rewind'

unwind 'python_pip[setuptools]' do
ignore_failure true
end

0 comments on commit 6787f39

Please sign in to comment.