Comments (5)
+1 for this issue, is not working when package is already installed.
from apt.
@rmoriz / @fabn Can you elaborate on this a bit more. I'm trying to understand exactly what wouldn't work here. I was under the impression from reading the Debian docs that all you needed was the proper config in the 20auto-upgrades file to get the contents of the 50unattended-upgrades to be respected. If the user has the attribute set to enable upgrades they're getting true set in the seed file, but also APT::Periodic::Unattended-Upgrade set as well in 20auto-upgrades.
from apt.
I don't really remember the details, but the chef seed file is ignored if the package is already installed.
Even when the /etc/apt/apt.conf.d/20auto-upgrades
file now gets created using chef, the next update of the unattended-upgrades
package will disable it again because of running the postinstall: https://sources.debian.net/src/unattended-upgrades/0.93.1%2Bnmu1/debian/postinst/#L41
from apt.
I believe that this is a problem with the implementation of the :reconfig action in the package provider. Idempotency is enforced only by checking that the seed file has not changed. The actual state of the configuration database is not checked. Thus, the :reconfig action is not actually enforcing compliance.
The relevant code seems to be here;
https://github.com/chef/chef/blob/4332122132da81eac1f3ab0f28f3cbce365b85a4/lib/chef/provider/package.rb#L197-L220
from apt.
In the case of https://github.com/chef-cookbooks/apt/blob/master/recipes/unattended-upgrades.rb#L28 the install
action is used, not reconfig
.
install
will not seed if the package is already there, as explained in the OP.
If, after a successfull seed+install, something changes the config db (as you describe), it will not fix and reconfigure. But IMO this is a rare case because it requires active "destruction" after chef took over the management of the node. In my case, the problem starts before Chef is bootstrapped and run.
Here is some in-house hack I'm using to deal with the situation:
auto_updates_enabled = !node['apt']['unattended_upgrades']['enable'].nil?
execute 'debconf_seeding_unattended_upgrades' do
command "echo 'unattended-upgrades unattended-upgrades/enable_auto_updates boolean #{auto_updates_enabled}' | debconf-set-selections"'
cwd '/tmp'
not_if "debconf-show unattended-upgrades | grep 'enable_auto_updates: #{auto_updates_enabled}'"
notifies :run, 'execute[reconfigure_unattended_upgrades]', :immediately
end
execute 'reconfigure_unattended_upgrades' do
command 'dpkg-reconfigure unattended-upgrades'
environment(
'DEBIAN_FRONTEND' => 'noninteractive'
)
action :nothing
end
from apt.
Related Issues (20)
- apt_repository should honour the components values given, regardless of whether it's a ppa repository HOT 2
- Issue with v3.0.0 execute[apt-get update] HOT 5
- Truncating URI HOT 1
- apt_repository with key option creates ~/.gnupg owned by root in Vagrant's homedir HOT 2
- Add a warning on the README that https://github.com/chef/chef/pull/4782 supersedes this cookbook's `apt_repository` LWRP HOT 6
- execute[apt-cache gencaches] cannot be found in the resource collection HOT 6
- Apt update fails on Chef < 12.4.0 HOT 1
- Port apt_preference to chef/chef HOT 3
- Adding apt key doesn't work on Ubuntu 16.10 HOT 2
- apt update fails with "STDERR: E: The method driver /usr/lib/apt/methods/deb https could not be found."
- 6.1.0 removal of apt_update isn't actually in 6.1.0 supermarket code. HOT 3
- Request to add attribute allow-unauthenticated config option HOT 4
- apt_repository needs dirmngr installed HOT 1
- origins_patterns not applied for unattended_upgrades HOT 6
- master build fails with "undefined method contains"
- unattended-upgrades forced to check daily HOT 3
- apt_package resource should support source HOT 4
- Converge of apt::default fails as it tries to install version of a package that does not exist HOT 1
- Dependency Dashboard
- apt-key deprecated - use signed-by
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apt.