Fix installation if TLS verification is skipped

The installation failed, if TLS verification was disabled and no CA
certificate was given in the configuration. This happened because the
installation script always expected the CA certificate.

The installation now only expects the certificate, if TLS verification
is enabled.

Change-Id: I5429fc1ee0d230c74cc0689607cf2736d6520030
diff --git a/subcommands/install.py b/subcommands/install.py
index 4dc46ac..9803bce 100644
--- a/subcommands/install.py
+++ b/subcommands/install.py
@@ -96,8 +96,14 @@
 
     os.remove(os.path.join(output_dir, "promtail.yaml"))
 
-    with open(os.path.join(output_dir, "promtail", "promtail.ca.crt"), "w") as f:
-        f.write(config["tls"]["caCert"])
+    if not config["tls"]["skipVerify"]:
+        try:
+            with open(
+                os.path.join(output_dir, "promtail", "promtail.ca.crt"), "w"
+            ) as f:
+                f.write(config["tls"]["caCert"])
+        except TypeError:
+            print("CA certificate for TLS verification has to be given.")
 
 
 def _download_promtail(output_dir):