summaryrefslogtreecommitdiffstats
path: root/images/installer/root/usr/local/bin/user_setup
blob: dba0af3e4f05770a708bf1f96c7e62ad9eb28e2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
set -x

# ensure $HOME exists and is accessible by group 0 (we don't know what the runtime UID will be)
mkdir -p ${HOME}
chown ${USER_UID}:0 ${HOME}
chmod ug+rwx ${HOME}

# runtime user will need to be able to self-insert in /etc/passwd
chmod g+rw /etc/passwd

# ensure that the ansible content is accessible
chmod -R g+r ${WORK_DIR}
find ${WORK_DIR} -type d -exec chmod g+x {} +
# ensure that the dynamic inventory dir can have content created
find ${WORK_DIR} -type d -exec chmod g+wx {} +

# no need for this script to remain in the image after running
rm $0