Update apt cookbook

This commit is contained in:
Greg Karékinian
2018-04-17 13:43:22 +02:00
parent 6a86fc64fa
commit b92cc6e5d7
21 changed files with 833 additions and 441 deletions

View File

@@ -1,8 +1,8 @@
#
# Cookbook Name:: apt
# Cookbook:: apt
# Library:: helpers
#
# Copyright 2013 Chef Software, Inc.
# Copyright:: 2013-2017, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -27,18 +27,6 @@ module Apt
!which('apt-get').nil?
end
# Determines whether we need to run `apt-get update`
#
# @return [Boolean]
def apt_up_to_date?
if ::File.exist?('/var/lib/apt/periodic/update-success-stamp') &&
::File.mtime('/var/lib/apt/periodic/update-success-stamp') > Time.now - node['apt']['periodic_update_min_delay']
true
else
false
end
end
# Finds a command in $PATH
#
# @return [String, nil]