diff --git a/vm/Dockerfile b/vm/Dockerfile index af62023..fead2d5 100644 --- a/vm/Dockerfile +++ b/vm/Dockerfile @@ -16,7 +16,6 @@ RUN apt install -y software-properties-common && add-apt-repository --yes --upda # do not copy "private" folder COPY ansible/*.yaml ansible/*.yml ansible/05-sage /ansible/ -COPY entrypoint.sh . WORKDIR /ansible ENV LC_ALL=C.UTF-8 @@ -51,5 +50,6 @@ RUN ansible-playbook -i localhost, -c local ./waggle_config.yml \ -e copy_k8s_resource_files=no #-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no +COPY entrypoint.sh /entrypoint.sh CMD /entrypoint.sh #CMD /bin/sleep infinity diff --git a/vm/entrypoint.sh b/vm/entrypoint.sh index 1044b8c..08f79dd 100755 --- a/vm/entrypoint.sh +++ b/vm/entrypoint.sh @@ -6,12 +6,20 @@ set -x set -e +# override node id, if defined +if [[ "${WAGGLE_NODE_ID}" ]]; then + echo "${WAGGLE_NODE_ID}" > /etc/waggle/node-id +fi + +# override node vsn, if defined +if [[ "${WAGGLE_NODE_VSN}" ]]; then + echo "${WAGGLE_NODE_VSN}" > /etc/waggle/vsn +fi # create fake kubectl for debugging echo -e '#!/bin/bash\necho "(this is a dummy) created"' > /usr/local/bin/kubectl chmod +x /usr/local/bin/kubectl - cd /etc/waggle # copy files in place so they can be deleted afterwards @@ -37,4 +45,4 @@ mkdir -p /var/run/sshd waggle-bk-registration.py # reverse ssh tunnel (usually via systemd) -waggle-bk-reverse-tunnel.sh \ No newline at end of file +waggle-bk-reverse-tunnel.sh