1
0
mirror of https://github.com/rancher/os.git synced 2025-09-17 07:30:42 +00:00

Merge branch 'cloudinit' of github.com:sidharthamani/os into sidharthamani-cloudinit

Conflicts:
	scripts/dockerimages/06-console
This commit is contained in:
Darren Shepherd
2015-02-22 21:17:36 -07:00
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 sed -i 's/rancher.*/rancher:rixbL64o6zGmY:16486:0:99999:7:::/g' /etc/shadow && \
echo '## allow password less for rancher user' >> /etc/sudoers && \
echo 'rancher ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

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