1
0
mirror of https://github.com/rancher/os.git synced 2025-09-16 23:21:19 +00:00

lay foundation for rewriting cloud-init

This commit is contained in:
sidharthamani
2015-02-21 16:07:29 -08:00
parent 6800fdfb67
commit d08163b5c5
32 changed files with 81 additions and 2597 deletions

View File

@@ -1,5 +1,6 @@
FROM base
COPY scripts/dockerimages/scripts/console.sh /usr/sbin/
COPY scripts/dockerimages/scripts/update-ssh-keys /usr/bin/
RUN echo 'set bell-style none' > /etc/inputrc && \
adduser -g rancher -G sudo -D -h /home/rancher -s /bin/bash rancher && \
sed -i 's/\(docker.*\)/\1rancher/g' /etc/group && \

View File

@@ -2,6 +2,4 @@
set -x -e
CLOUD_CONFIG_FLAGS=$(rancherctl config get cloud_config)
cloud-init --preinit "$CLOUD_CONFIG_FLAGS"
cloud-init

View File

@@ -0,0 +1,13 @@
#!/bin/bash
USERNAME=$1
HOME_DIR=$(grep ^$USERNAME /etc/passwd | cut -f6 -d:)
if [ ! -d $HOME_DIR/.ssh ]; then
mkdir -p $HOME_DIR/.ssh
fi
if [ ! grep -q $HOME_DIR/.ssh/authorized_keys ]; then
echo "$2" >> $HOME_DIR/.ssh/authorized_keys
fi