-if node[:lsb][:release].to_f >= 16.04
- apt_source "brightbox-ruby-ng" do
- action :delete
- end
-else
- apt_source "brightbox-ruby-ng" do
- url "http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu"
- key "C3173AA6"
- end
+repository_actions = Hash.new do |_, repository|
+ node[:apt][:sources].include?(repository) ? :add : :remove
+end
+
+apt_repository "brightbox-ruby-ng" do
+ action repository_actions["brightbox-ruby-ng"]
+ uri "ppa:brightbox/ruby-ng"
+end
+
+apt_repository "ubuntugis-stable" do
+ action repository_actions["ubuntugis-stable"]
+ uri "ppa:ubuntugis/ppa"
+end
+
+apt_repository "ubuntugis-unstable" do
+ action repository_actions["ubuntugis-unstable"]
+ uri "ppa:ubuntugis/ubuntugis-unstable"
+end
+
+apt_repository "maxmind" do
+ action repository_actions["maxmind"]
+ uri "ppa:maxmind/ppa"