File configure-nonroot.sh of Package ironic

#!/usr/bin/bash

NONROOT_UID=10475
NONROOT_GID=10475
USER="ironic-suse"

groupadd -r -g ${NONROOT_GID} ${USER}
useradd -r -g ${NONROOT_GID} \
           -u ${NONROOT_UID} \
           -d /var/lib/ironic \
           -s /sbin/nologin \
           ${USER}

# create ironic's certs directory
mkdir /certs
chown "${NONROOT_UID}":"${NONROOT_GID}" /certs

# create ironic's http_root directory
mkdir -p /shared/html
chown "${NONROOT_UID}":"${NONROOT_GID}" /shared/html

# ironic permission changes
chown -R "${NONROOT_UID}":"${NONROOT_GID}" /etc/ironic/
chown -R "${NONROOT_UID}":"${NONROOT_GID}" /run/ironic/
chown -R "${NONROOT_UID}":"${NONROOT_GID}" /var/lib/ironic

# apache2 permission changes
chown -R "${NONROOT_UID}":"${NONROOT_GID}" /etc/apache2
chown -R "${NONROOT_UID}":"${NONROOT_GID}" /var/log/apache2/
# change default location of httpd.pid file
echo "PidFile /run/ironic/httpd.pid" >> /etc/apache2/httpd.conf

# ironic-inspector permission changes
chown -R "${NONROOT_UID}":"${NONROOT_GID}" /etc/ironic-inspector/
chown -R "${NONROOT_UID}":"${NONROOT_GID}" /var/log/ironic-inspector

# ca-certificates permission changes
touch /var/lib/ca-certificates/ca-bundle.pem.new
chown -R "${NONROOT_UID}":"${NONROOT_GID}" /var/lib/ca-certificates/
chmod -R +w /var/lib/ca-certificates/
openSUSE Build Service is sponsored by