Skip to content

Instantly share code, notes, and snippets.

@joshgarnett
Created June 3, 2015 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshgarnett/c226e366e01f2c0bc2fb to your computer and use it in GitHub Desktop.
Save joshgarnett/c226e366e01f2c0bc2fb to your computer and use it in GitHub Desktop.
yum_repository 'mono' do
description 'Mono repository'
baseurl node['mono']['yum_repository']
gpgkey node['mono']['yum_repository_key']
end
# yum install does not play well with older versions of the mono-complete package. It marks many
# packages as obsolete and then tries to upgrade everything to version 4. To work around this we
# will download the rpms manually and then use yum localinstall.
package 'yum-utils' do
action :install
end
directory '/tmp/mono-packages' do
owner 'root'
group 'root'
mode '0700'
action :create
not_if "rpm -qa | grep -q 'mono-core'"
end
bash 'download-mono-packages' do
user 'root'
cwd '/tmp/mono-packages'
code 'yumdownloader ibm-data-db2-3.12.1 libmono-2_0-1-3.12.1-0 libmono-2_0-devel-3.12.1-0 libmonoboehm-2_0-1-3.12.1-0 libmonoboehm-2_0-devel-3.12.1-0 libmonosgen-2_0-1-3.12.1-0 libmonosgen-2_0-devel-3.12.1-0 mono-core-3.12.1-0 mono-data-3.12.1-0 mono-data-oracle-3.12.1-0 mono-data-postgresql-3.12.1-0 mono-data-sqlite-3.12.1-0 mono-devel-3.12.1-0 mono-entityframework-3.12.1-0 mono-extras-3.12.1-0 mono-locale-extras-3.12.1-0 mono-mvc-3.12.1-0 mono-nunit-3.12.1-0 mono-reactive-3.12.1-0 mono-wcf-3.12.1-0 mono-web-3.12.1-0 mono-winforms-3.12.1-0 mono-winfxcore-3.12.1-0 monodoc-core-3.12.1-0 libgdiplus-devel-3.12-1'
action :run
not_if "rpm -qa | grep -q 'mono-core'"
end
bash 'install-mono-packages' do
user 'root'
cwd '/tmp/mono-packages'
code 'yum localinstall -y /tmp/mono-packages/*.rpm'
action :run
not_if "rpm -qa | grep -q 'mono-core'"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment