]> gitweb.fluxo.info Git - hydra.git/commitdiff
Provision: openssh-server installation should be optional and disabled for TPC profile
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 14 Oct 2016 14:02:17 +0000 (11:02 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 14 Oct 2016 14:02:17 +0000 (11:02 -0300)
doc/todo.rst
share/config/provision/tpc.conf
share/hydractl/provision

index 62256b433bf798c89f8c2d0c7acb731391385bea..0f14d45f38dec1a1b12d62f058ec899e17708943 100644 (file)
@@ -4,4 +4,3 @@ TODO
 * import-keys: do not use ssh if host is localhost.
 * import-certs: concat.pem; cert.pem and cert.crt symlinks; restart services.
 * compile: automatic definitions for per-node backup::users.
-* provision: openssh-server installation should be optional and disabled for TPC profile.
index 5b9b932ee6ed7fef41ec4ca4c33e19501beeb87e..5c209a0f45ff1e7eb8cf6857c13f34b8c997d465 100644 (file)
@@ -16,3 +16,4 @@ arch="amd64"                            # System arch
 version="jessie"                        # Distro version
 grub="y"                                # Setup GRUB?
 mirror="http://http.debian.net/debian/" # Debian mirror
+ssh="n"                                 # Install openssh-server?
index 415c0c09b726ea3cae03e94c7a04e23b2d5ca6fb..7ed066afdbfa08b1f9de6b7ff6d32b448878da56 100755 (executable)
@@ -109,6 +109,7 @@ function hydra_provision_config {
   hydra_user_config   vg                $hostname                        "Install vg"
   hydra_user_config   grub              y                                "Setup GRUB? (y/n)"
   hydra_user_config   mirror            http://http.debian.net/debian/   "Debian mirror"
+  hydra_user_config   ssh               y                                "Install openssh-server? (y/n)"
 
   # Check arch
   if [ "$arch" == "armel" ] || [ "$arch" == "armhf" ]; then
@@ -477,9 +478,11 @@ $APT_INSTALL screen cron lsb-release openssl -y
 hydra_provision_networking
 
 # SSH.
-echo "Installing OpenSSH daemon..."
-$APT_INSTALL openssh-server -y
-hydra_sudo_run chroot $WORK/ service ssh stop
+if [ "$ssh" == "y" ]; then
+  echo "Installing OpenSSH daemon..."
+  $APT_INSTALL openssh-server -y
+  hydra_sudo_run chroot $WORK/ service ssh stop
+fi
 
 # Sudo.
 echo "Installing sudo..."
@@ -491,7 +494,9 @@ echo "Choose a root password."
 hydra_sudo_run chroot $WORK passwd root
 
 # Fingerprints
-hydra_provision_fingerprints
+if [ "$ssh" == "y" ]; then
+  hydra_provision_fingerprints
+fi
 
 echo "Umounting installation device..."
 hydra_sudo_run umount $WORK/sys $WORK/proc $WORK/dev $WORK