From fba185085b53f7813b433166c00c0249ea4f2ac3 Mon Sep 17 00:00:00 2001 From: Ani Sinha Date: Thu, 20 Jun 2024 11:18:40 +0530 Subject: [PATCH 3/4] doc: update examples to reflect alternative ways to provide `sudo` option (#5418) RH-Author: Ani Sinha RH-MergeRequest: 91: fix(jsonschema): Add missing sudo definition (#5418) RH-Jira: RHEL-44338 RH-Acked-by: Emanuele Giuseppe Esposito RH-Acked-by: Miroslav Rezanina RH-Commit: [2/2] fdaf2d29b4e90882435bfcdcb57a3b8a1d574082 (anisinha/cloud-init) For creating users and groups, it is possible to pass a `sudo` option to the config file that accepts a sudo rule. The option can be a sudo rule string, a list of sudo rule strings or `False` to explicitly deny sudo usage. Update examples to show how a list of strings can be used with `sudo` option. Signed-off-by: Ani Sinha (cherry picked from commit cbcb05349e35023ee6e81ccaf13e79adb8f65f63) --- doc/examples/cloud-config-user-groups.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/examples/cloud-config-user-groups.txt b/doc/examples/cloud-config-user-groups.txt index 87fc52e8..56eb674f 100644 --- a/doc/examples/cloud-config-user-groups.txt +++ b/doc/examples/cloud-config-user-groups.txt @@ -35,6 +35,10 @@ users: lock_passwd: true ssh_authorized_keys: - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSL7uWGj8cgWyIOaspgKdVy0cKJ+UTjfv7jBOjG2H/GN8bJVXy72XAvnhM0dUM+CCs8FOf0YlPX+Frvz2hKInrmRhZVwRSL129PasD12MlI3l44u6IwS1o/W86Q+tkQYEljtqDOo0a+cOsaZkvUNzUyEXUwz/lmYa6G4hMKZH4NBj7nbAAF96wsMCoyNwbWryBnDYUr6wMbjRR1J9Pw7Xh7WRC73wy4Va2YuOgbD3V/5ZrFPLbWZW/7TFXVrql04QVbyei4aiFR5n//GvoqwQDNe58LmbzX/xvxyKJYdny2zXmdAhMxbrpFQsfpkJ9E/H5w0yOdSvnWbUoG5xNGoOB csmith@fringe + - name: testuser + gecos: Mr. Test + homedir: /local/testdir + sudo: ["ALL=(ALL) NOPASSWD:ALL"] - name: cloudy gecos: Magic Cloud App Daemon User inactive: '5' @@ -100,6 +104,8 @@ users: # # Allow a user unrestricted sudo access. # sudo: ALL=(ALL) NOPASSWD:ALL +# or +# sudo: ["ALL=(ALL) NOPASSWD:ALL"] # # Adding multiple sudo rule strings. # sudo: -- 2.39.3