Skip to content

Commit 0c8d947

Browse files
authored
adds host_sudoers example to the role spec reference (#46027)
1 parent b453967 commit 0c8d947

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/pages/includes/role-spec.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,15 @@ spec:
150150
# is not 'off'.
151151
host_groups: [ubuntu, nginx, other]
152152

153+
# List of entries to include in a temporary sudoers file created in
154+
# `/etc/sudoers.d`. The records are removed on session close.
155+
host_sudoers: [
156+
# This line will allow the login user to run `systemctl restart nginx.service`
157+
# as root without requiring a password. The sudoers entry will be prefixed
158+
# with the logged in username.
159+
"ALL = (root) NOPASSWD: /usr/bin/systemctl restart nginx.service"
160+
]
161+
153162
# kubernetes_groups specifies Kubernetes groups a user with this role will assume.
154163
# You can refer to a SAML/OIDC trait via the 'external' property bag.
155164
# This allows you to specify Kubernetes group membership in an identity manager:

0 commit comments

Comments
 (0)