Skip to content

Commit

Permalink
docs: Add deprecated system_info to schema (#5168)
Browse files Browse the repository at this point in the history
In some cases, `system_info` can be passed via user data or vendor data
to override the system_info in /etc/cloud/cloud.cfg . While this
technically can work, this is a use case we no longer support and should
indicate that it is deprecated.

Also remove/update examples.
  • Loading branch information
TheRealFalcon authored Apr 19, 2024
1 parent 5a40b3b commit 7c67f77
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 47 deletions.
7 changes: 7 additions & 0 deletions cloudinit/config/schemas/schema-cloud-config-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,12 @@
},
"merge_type": {
"$ref": "#/$defs/merge_definition"
},
"system_info": {
"type": "object",
"description": "System and/or distro specific settings. This is not intended to be overridden by user data or vendor data.",
"deprecated": true,
"deprecated_version": "24.2"
}
}
},
Expand Down Expand Up @@ -3876,6 +3882,7 @@
"ssh_pwauth": {},
"ssh_quiet_keygen": {},
"swap": {},
"system_info": {},
"timezone": {},
"ubuntu_advantage": {},
"ubuntu_pro": {},
Expand Down
23 changes: 0 additions & 23 deletions doc/examples/cloud-config-apt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,6 @@
# Number: Set pipelining to some number (not recommended)
apt_pipelining: False

## apt config via system_info:
# under the 'system_info', you can customize cloud-init's interaction
# with apt.
# system_info:
# apt_get_command: [command, argument, argument]
# apt_get_upgrade_subcommand: dist-upgrade
#
# apt_get_command:
# To specify a different 'apt-get' command, set 'apt_get_command'.
# This must be a list, and the subcommand (update, upgrade) is appended to it.
# default is:
# ['apt-get', '--option=Dpkg::Options::=--force-confold',
# '--option=Dpkg::options::=--force-unsafe-io', '--assume-yes', '--quiet']
#
# apt_get_upgrade_subcommand: "dist-upgrade"
# Specify a different subcommand for 'upgrade. The default is 'dist-upgrade'.
# This is the subcommand that is invoked for package_upgrade.
#
# apt_get_wrapper:
# command: eatmydata
# enabled: [True, False, "auto"]
#

# Install additional packages on first boot
#
# Default: none
Expand Down
12 changes: 2 additions & 10 deletions doc/examples/cloud-config-user-groups.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,5 @@ users:
#
# users[0] (the first user in users) overrides the user directive.
#
# The 'default' user above references the distro's config:
# system_info:
# default_user:
# name: Ubuntu
# plain_text_passwd: 'ubuntu'
# homedir: /home/ubuntu
# shell: /bin/bash
# lock_passwd: True
# gecos: Ubuntu
# groups: [adm, cdrom, dip, lxd, sudo]
# The 'default' user above references the distro's config set in
# /etc/cloud/cloud.cfg.
10 changes: 0 additions & 10 deletions tests/data/user_data.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,3 @@ write_files:
- content: blah
path: /etc/blah.ini
permissions: 493

system_info:
package_mirrors:
- arches: [i386, amd64, blah]
failsafe:
primary: http://my.archive.mydomain.com/ubuntu
security: http://my.security.mydomain.com/ubuntu
search:
primary: []
security: []
16 changes: 15 additions & 1 deletion tests/unittests/runs/test_merge_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,21 @@ def test_none_ds(self):
cfg = {
"datasource_list": ["None"],
"cloud_init_modules": ["write_files"],
"system_info": {"paths": {"run_dir": new_root}},
"system_info": {
"paths": {"run_dir": new_root},
"package_mirrors": [
{
"arches": ["i386", "amd64", "blah"],
"failsafe": {
"primary": "http://my.archive.mydomain.com/ubuntu",
"security": (
"http://my.security.mydomain.com/ubuntu"
),
},
"search": {"primary": [], "security": []},
},
],
},
}
ud = helpers.readResource("user_data.1.txt")
cloud_cfg = safeyaml.dumps(cfg)
Expand Down
3 changes: 0 additions & 3 deletions tests/unittests/sources/test_vultr.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
expire: false
list:
- root:$6$SxXx...k2mJNIzZB5vMCDBlYT1
system_info:
default_user:
name: root
"""

# Vultr metadata test data
Expand Down

0 comments on commit 7c67f77

Please sign in to comment.