user_setup 572 B

12345678910111213141516171819
  1. #!/bin/sh
  2. set -x
  3. # ensure $HOME exists and is accessible by group 0 (we don't know what the runtime UID will be)
  4. mkdir -p ${HOME}
  5. chown ${USER_UID}:0 ${HOME}
  6. chmod ug+rwx ${HOME}
  7. # runtime user will need to be able to self-insert in /etc/passwd
  8. chmod g+rw /etc/passwd
  9. # ensure that the ansible content is accessible
  10. chmod -R g+r ${WORK_DIR}
  11. find ${WORK_DIR} -type d -exec chmod g+x {} +
  12. # ensure that the dynamic inventory dir can have content created
  13. find ${WORK_DIR} -type d -exec chmod g+wx {} +
  14. # no need for this script to remain in the image after running
  15. rm $0