we use an apt cookbook, so you could just use that.
https://github.com/index/apt/blob/master/recipes/default.rb

This will work too though.