diff --git a/src/nassella.scm b/src/nassella.scm index 57e7101..d540be1 100644 --- a/src/nassella.scm +++ b/src/nassella.scm @@ -821,9 +821,19 @@ h1, h2, h3, h4, h5, h6 { (volume-destroy . ,(search "volume_attachment.machine: Destruction complete" "volume_attachment.machine: Destroying..." "XXX - nothing")))) (define (write-config-entry name value) + (display name) + (display "='") + (display (if value + (string-translate* (->string value) '(("'" . "\\'"))) ;; escape any single quotes + ""))+ + (print "'")) + +(define (write-terraform-config-entry name value) (display name) (display "=\"") - (display value) + (display (if value + (string-translate* (->string value) '(("\"" . "\\\""))) ;; escape any double quotes + ""))+ (print "\"")) (define (progress-status->text status) @@ -1632,7 +1642,7 @@ chmod -R 777 /opt/keys"))) (with-output-to-file (string-append dir "/config/production.tfvars") (lambda () (map (lambda (e) - (write-config-entry (car e) (cdr e))) + (write-terraform-config-entry (car e) (cdr e))) `(("server_type" . ,(alist-ref 'digitalocean-size service-config)) ("do_token" . ,(alist-ref 'digitalocean-api-token service-config)) ("digitalocean_volume_size" . ,(alist-ref 'digitalocean-volume-size service-config))