From 20891096e0c068dfde1a5a998d40b4112c07917a Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Wed, 18 Feb 2015 16:11:32 -0800 Subject: [PATCH] Respect NODEPOOL_SSH_KEY in prepare-node for dib We dont respect this parameter when building dib images. Change-Id: I403b59f150d11bfa01875a89de777023c15d2e71 --- nodepool/elements/puppet/bin/prepare-node | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/nodepool/elements/puppet/bin/prepare-node b/nodepool/elements/puppet/bin/prepare-node index 5518721ec8..9e6ab297ca 100644 --- a/nodepool/elements/puppet/bin/prepare-node +++ b/nodepool/elements/puppet/bin/prepare-node @@ -21,6 +21,13 @@ SUDO=${SUDO:-true} THIN=${THIN:-true} ALL_MYSQL_PRIVS=${ALL_MYSQL_PRIVS:-false} +if [ -n "$NODEPOOL_SSH_KEY" ] ; then + puppet_install_users="install_users => false, +ssh_key => '$NODEPOOL_SSH_KEY'," +else + puppet_install_users="" +fi + export FACTER_in_chroot=true cat >/tmp/local.pp < $SUDO, thin => $THIN, all_mysql_privs => $ALL_MYSQL_PRIVS, - install_resolv_conf => false + install_resolv_conf => false, + $puppet_install_users } EOF + # Puppet doesn't return nonzero if some things fail by default. # Use detailed exit codes to get that info and determine whether # the return code indicates failure.