Use the apt Chef InSpec audit resource to verify Apt repositories on the Debian and Ubuntu platforms, and also PPA repositories on the Ubuntu platform.
This resource is distributed along with Chef InSpec itself. You can use it automatically.
This resource first became available in v1.0.0 of InSpec.
An apt resource block tests the contents of Apt and PPA repositories:
describe apt('path') do
it { should exist }
it { should be_enabled }
end
where
apt('path') must specify an Apt or PPA repository('path') may be an http:// address, a ppa: address, or a short repo-name/ppa addressexist and be_enabled are a valid matchers for this resourceThe following examples show how to use this Chef InSpec audit resource.
describe apt('http://ppa.launchpad.net/juju/stable/ubuntu') do
it { should exist }
it { should be_enabled }
end
describe apt('ppa:nginx/stable') do
it { should exist }
it { should be_enabled }
end
describe apt('ubuntu-wine/ppa') do
it { should_not exist }
it { should_not be_enabled }
end
For a full list of available matchers, please visit our matchers page.
The be_enabled matcher tests if a repository is enabled on the system:
it { should be_enabled }
The exist matcher tests if a repository exists on the system:
it { should exist }
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/apt/