Skip to content

Commit

Permalink
resolved Youscribe#12
Browse files Browse the repository at this point in the history
  • Loading branch information
acholt committed Nov 22, 2015
1 parent 1047cac commit de6fc71
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 9 additions & 2 deletions attributes/host.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# packages to install as kvm host
case node['platform_family']
when 'debian'
default['kvm']['host']['packages'] = %w(qemu-kvm libvirt-bin)
if (node['platform'] == 'ubuntu' && node['platform_version'].to_i >= 12) \
or (node['platform'] == 'debian' && node['platform_version'].to_i <= 7)
default['kvm']['host']['service_name'] = 'libvirt-bin'
else
default['kvm']['host']['service_name'] = 'libvirtd'
end
default['kvm']['host']['packages'] = %w(qemu-kvm libvirt-bin)
when 'rhel'
default['kvm']['host']['packages'] = %w(qemu-kvm libvirt)
default['kvm']['host']['service_name'] = 'libvirtd'
default['kvm']['host']['packages'] = %w(qemu-kvm libvirt)
else
fail 'unsupported platform'
end
4 changes: 4 additions & 0 deletions recipes/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@
action :install
end
end

service node['kvm']['host']['service_name'] do
action [ :enable, :start ]
end

0 comments on commit de6fc71

Please sign in to comment.