Last active
August 29, 2015 14:04
-
-
Save martinisoft/baf030f286d9616cc928 to your computer and use it in GitHub Desktop.
Ugly Chef hackery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The problem: I've got to swap the apt mirror out (idempotently) and update apt | |
# BEFORE build-essential triggers at compile time. Hence the run_action trick | |
# to force the resource to trigger at compile time, not run time. | |
# | |
# Why? Old Ubuntu release apt mirrors get retired to old-releases.ubuntu.com | |
if node['platform_version'].to_f == 13.04 | |
execute "swap in old release mirror" do | |
user 'root' | |
command "/bin/sed -i -e 's#http:\/\/.*.ubuntu.com#http:\/\/old-releases.ubuntu.com#g' /etc/apt/sources.list && apt-get update" | |
not_if "grep 'old-releases.ubuntu.com' /etc/apt/sources.list" | |
action :nothing | |
end.run_action(:run) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment