Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 730f866

Browse files
committed
Remove apt_preference and require Chef 13.3
apt_preference now ships in the Chef client itself. Signed-off-by: Tim Smith <[email protected]>
1 parent 9a1d3b4 commit 730f866

File tree

4 files changed

+10
-171
lines changed

4 files changed

+10
-171
lines changed

.kitchen.dokken.yml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ platforms:
3232
- name: centos-7
3333
driver:
3434
image: dokken/centos-7
35-
platform: rhel
3635
pid_one_command: /usr/lib/systemd/systemd
3736

3837

@@ -45,31 +44,3 @@ platforms:
4544
driver:
4645
image: dokken/ubuntu-16.04
4746
pid_one_command: /bin/systemd
48-
49-
suites:
50-
- name: default
51-
run_list:
52-
- recipe[apt]
53-
54-
- name: cacher
55-
run_list:
56-
- recipe[test::cacher]
57-
58-
- name: compile-time
59-
run_list:
60-
- recipe[apt::default]
61-
attributes:
62-
apt:
63-
compile_time_update: true
64-
65-
- name: resources
66-
run_list:
67-
- recipe[test::resources]
68-
69-
- name: unattended-upgrades
70-
run_list:
71-
- recipe[test::unattended-upgrades]
72-
attributes:
73-
apt:
74-
unattended_upgrades:
75-
enable: true

README.md

Lines changed: 9 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ May work with or without modification on other Debian derivatives.
1515

1616
### Chef
1717

18-
- Chef 12.9+
18+
- Chef 13.3+
1919

2020
### Cookbooks
2121

@@ -149,55 +149,6 @@ To pull just security updates, set `origins_patterns` to something like `["origi
149149

150150
There is an `interface_ipaddress` method that returns the IP address for a particular host and interface, used by the `cacher-client` recipe. To enable it on the server use the `['apt']['cacher_interface']` attribute.
151151

152-
## Resources/Providers
153-
154-
### apt_preference
155-
156-
This resource provides an easy way to pin packages in /etc/apt/preferences.d. Although apt-pinning is quite helpful from time to time please note that Debian does not encourage its use without thorough consideration.
157-
158-
Further information regarding apt-pinning is available via <https://wiki.debian.org/AptPreferences>.
159-
160-
#### Actions
161-
162-
- `:add`: creates a preferences file under /etc/apt/preferences.d
163-
- `:remove`: Removes the file, therefore unpin the package
164-
165-
#### Attribute Parameters
166-
167-
- package_name: name attribute. The name of the package
168-
- glob: Pin by glob() expression or regexp surrounded by /.
169-
- pin: The package version/repository to pin
170-
- pin_priority: The pinning priority aka "the highest package version wins" (required)
171-
172-
#### Examples
173-
174-
Pin libmysqlclient16 to version 5.1.49-3:
175-
176-
```ruby
177-
apt_preference 'libmysqlclient16' do
178-
pin 'version 5.1.49-3'
179-
pin_priority '700'
180-
end
181-
```
182-
183-
Unpin libmysqlclient16:
184-
185-
```ruby
186-
apt_preference 'libmysqlclient16' do
187-
action :remove
188-
end
189-
```
190-
191-
Pin all packages from dotdeb.org:
192-
193-
```ruby
194-
apt_preference 'dotdeb' do
195-
glob '*'
196-
pin 'origin packages.dotdeb.org'
197-
pin_priority '700'
198-
end
199-
```
200-
201152
## Usage
202153

203154
Put `recipe[apt]` first in the run list. If you have other recipes that you want to use to configure how apt behaves, like new sources, notify the execute resource to run, e.g.:
@@ -214,6 +165,14 @@ Put `recipe[apt::cacher-ng]` in the run_list for a server to provide APT caching
214165

215166
If you want to cleanup unused packages, there is also the `apt-get autoclean` and `apt-get autoremove` resources provided for automated cleanup.
216167

168+
## Resources
169+
170+
### apt_preference
171+
172+
The apt_preference resource has been moved into chef-client in Chef 13.3.
173+
174+
See <https://docs.chef.io/resource_apt_preference.html> for usage details
175+
217176
### apt_repository
218177

219178
The apt_repository resource has been moved into chef-client in Chef 12.9.
@@ -232,7 +191,6 @@ This cookbook is maintained by Chef's Community Cookbook Engineering team. Our g
232191

233192
## License
234193

235-
236194
**Copyright:** 2009-2017, Chef Software, Inc.
237195

238196
```

metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
source_url 'https://github.com/chef-cookbooks/apt'
1818
issues_url 'https://github.com/chef-cookbooks/apt/issues'
19-
chef_version '>= 12.9' if respond_to?(:chef_version)
19+
chef_version '>= 13.3' if respond_to?(:chef_version)

resources/preference.rb

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)