#
define :apt_source do
- if node.apt.sources.include?(params[:name])
+ if node[:apt][:sources].include?(params[:name])
source_action = :create
- execute "apt-key-#{params[:key]}" do
- command "/usr/bin/apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys #{params[:key]}"
- not_if "/usr/bin/apt-key list | /bin/fgrep -q #{params[:key]}"
+ if params[:key]
+ execute "apt-key-#{params[:key]}" do
+ command "/usr/bin/apt-key adv --keyserver hkp://keys.gnupg.net --recv-keys #{params[:key]}"
+ not_if "/usr/bin/apt-key list | /bin/fgrep -q #{params[:key]}"
+ end
end
else
source_action = :delete
owner "root"
group "root"
mode 0644
- notifies :run, resources(:execute => "apt-update")
+ notifies :run, "execute[apt-update]"
variables :url => params[:url]
end
end