-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1231 from Nordix/tuomo/run-ironic-non-root
⚠️ run BMO ironic deployment as non-root
- Loading branch information
Showing
5 changed files
with
236 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
# create nonroot image matching the keepalived manifest | ||
NONROOT_USER="nonroot" | ||
NONROOT_GROUP="nonroot" | ||
NONROOT_UID=65532 | ||
NONROOT_GID=65532 | ||
|
||
# run as non-root, allow editing the keepalive.conf during startup | ||
groupadd -g "${NONROOT_GID}" "${NONROOT_GROUP}" | ||
useradd -u "${NONROOT_UID}" -g "${NONROOT_GID}" -m "${NONROOT_USER}" | ||
|
||
mkdir -p /run/keepalived | ||
chown -R root:"${NONROOT_GROUP}" /etc/keepalived /run/keepalived | ||
chmod 2775 /etc/keepalived /run/keepalived | ||
chmod 664 /etc/keepalived/keepalived.conf | ||
|
||
setcap "cap_net_raw,cap_net_broadcast,cap_net_admin=+eip" /usr/sbin/keepalived |
Oops, something went wrong.