summaryrefslogtreecommitdiff
path: root/4 Archives/Disable unattended-upgrades VPS.md
diff options
context:
space:
mode:
authorJasper Ras <jras@hostnet.nl>2025-03-20 11:07:49 +0100
committerJasper Ras <jras@hostnet.nl>2025-03-20 11:07:49 +0100
commit80ccf68f55dbb70d7e5ed52ee95b3c9d1b6ce264 (patch)
tree93e28e85ab70052aa6f577998ec7dc1f413b40c0 /4 Archives/Disable unattended-upgrades VPS.md
parent9642cd7ae24f0ba79ce5647c709b35ae8f06a285 (diff)
vault backup: 2025-03-20 11:07:48
Diffstat (limited to '4 Archives/Disable unattended-upgrades VPS.md')
-rw-r--r--4 Archives/Disable unattended-upgrades VPS.md66
1 files changed, 66 insertions, 0 deletions
diff --git a/4 Archives/Disable unattended-upgrades VPS.md b/4 Archives/Disable unattended-upgrades VPS.md
new file mode 100644
index 0000000..c32ada0
--- /dev/null
+++ b/4 Archives/Disable unattended-upgrades VPS.md
@@ -0,0 +1,66 @@
+---
+tags:
+ - chef
+references:
+ - https://docs.chef.io/nodes/#node-objects
+ - https://docs.chef.io/attribute_precedence/
+---
+```
+cookbooks/onecom-baseline/attributes/default.rb
+122:# unattended-upgrades
+123:default['unattended-upgrades']['enable'] = false
+```
+We should override that somehow. Let's take a look below at how the attribute can be overridden.
+```
+chef-repo master
+❯ cat roles/onecom-mailpod-mailstorage-focal-22.json
+{
+ "name": "onecom-mailpod-mailstorage-focal-22",
+ "description": "One.com mailpod mailstorage Ubuntu Focal role - Dovecot 2.2.x",
+ "json_class": "Chef::Role",
+ "default_attributes": {
+ "apt": {
+ "repositories": {
+ "dovecot22-production": {
+ "action": "add"
+ }
+ }
+ },
+ "dovecot": {
+ "version": "1:2.2.36.4-1onecom5+20201026.1518.12cbf375.dovecot22.focal1"
+ }
+ },
+ "override_attributes": {
+ "unattended-upgrades": {
+ "enable": false,
+ "upgrade": "0"
+ },
+ "prometheus": {
+ "node_exporter": {
+ "collector": {
+ "systemd": {
+ "unit-whitelist": {
+ "unattended-upgrades": false
+ }
+ }
+ }
+ }
+ }
+ },
+ "chef_type": "role",
+ "run_list": [
+ "role[onecom-mailpod-mailstorage-focal]"
+ ]
+}
+```
+
+**The following table specifies attribute precedence:**
+|Application Order (Last One Wins)|Attribute Type|Source Order|
+|1|`default`|Cookbook attribute fileRecipeEnvironmentRole|
+|2|`force_default`|Cookbook attribute fileRecipe|
+|3|`normal`|JSON file passed with `chef-client -j`Cookbook attribute fileRecipe|
+|4|`override`|Cookbook attribute fileRecipeRoleEnvironment|
+|5|`force_override`|Cookbook attribute fileRecipe|
+|6|`automatic`|Identified by Ohai at the start of a Chef Infra Client Run|
+
+So apparently for level 4 we have to set "override_attributes" in the node definition.0-= \ No newline at end of file