plus3it / spel

STIG-Partitioned Enterprise Linux (spel)
Other
91 stars 61 forks source link

Add EL9-specific Logic for Releasing the Boot-Disk #660

Closed ferricoxide closed 5 months ago

ferricoxide commented 5 months ago

Fixes #658

ferricoxide commented 5 months ago

@lorengordon: not sure why the Travis-based test is throwing an "unformatted" HCL error? When I run packer validate, locally, It comes up green. That said, I'm doing:

/usr/local/bin/packer validate \
  -only amazon-ebs.minimal-rhel-7-hvm,amazon-ebs.minimal-centos-7-hvm,amazon-ebs.minimal-rhel-8-hvm,amazon-ebs.minimal-centos-8stream-hvm,amazon-ebs.minimal-ol-8-hvm \
  -var "spel_identifier=spel-test" \
  -var "spel_version=2024.01.1-issue_658-01" \
  ./minimal-linux.pkr.hcl

Which results in:

The configuration is valid.

To validate.

lorengordon commented 5 months ago

@lorengordon: not sure why the Travis-based test is throwing an "unformatted" HCL error? When I run packer validate, locally, It comes up green. That said, I'm doing:

validate is not the same as "format". Try packer fmt -recursive and commit the change.

ferricoxide commented 5 months ago

@lorengordon: not sure why the Travis-based test is throwing an "unformatted" HCL error? When I run packer validate, locally, It comes up green. That said, I'm doing:

validate is not the same as "format". Try packer fmt -recursive and commit the change.

$ /usr/local/bin/packer fmt -recursive spel
$ echo $?
0

$ /usr/local/bin/packer --version
1.8.7
lorengordon commented 5 months ago

Try make -f Makefile.tardigrade-ci hcl/format. That'll actually use terraform under the covers to format any hcl file, same as the way hcl/lint works. Terraform fmt must be a little more fascist than packer fmt.

$ /usr/local/bin/packer fmt -recursive spel
$ echo $?
0

$ /usr/local/bin/packer --version
1.8.7
ferricoxide commented 5 months ago

Ah. Ok. Apparently, there was extra whitespace it didn't like. After running the make:

$ git diff
diff --git a/spel/minimal-linux.pkr.hcl b/spel/minimal-linux.pkr.hcl
index a511582..60aee4c 100644
--- a/spel/minimal-linux.pkr.hcl
+++ b/spel/minimal-linux.pkr.hcl
@@ -931,7 +931,7 @@ build {
   }

   provisioner "shell" {
-    execute_command   = "{{ .Vars }} sudo -E /bin/sh '{{ .Path }}'"
+    execute_command = "{{ .Vars }} sudo -E /bin/sh '{{ .Path }}'"
     scripts = [
       "${path.root}/scripts/free-root.sh",
     ]
lorengordon commented 5 months ago

go codebuild go