diff --git a/provisioner/salt-masterless/provisioner.go b/provisioner/salt-masterless/provisioner.go index 93aad6b40..6c64795ba 100644 --- a/provisioner/salt-masterless/provisioner.go +++ b/provisioner/salt-masterless/provisioner.go @@ -448,7 +448,7 @@ func validateFileConfig(path string, name string, required bool) error { } func hasValidFormulaURLs(s []string) bool { - re := regexp.MustCompile(`^(.*).git\/\/[a-zA-Z0-9-_]+$`) + re := regexp.MustCompile(`^(.*).git\/\/[a-zA-Z0-9-_]+(\?.*)?$`) for _, u := range s { if !re.MatchString(u) { diff --git a/provisioner/salt-masterless/provisioner_test.go b/provisioner/salt-masterless/provisioner_test.go index 42dc7f686..f8f2fb7a9 100644 --- a/provisioner/salt-masterless/provisioner_test.go +++ b/provisioner/salt-masterless/provisioner_test.go @@ -348,6 +348,7 @@ func TestProvisionerPrepare_ValidFormulaURLs(t *testing.T) { config["formulas"] = []string{ "git::https://github.com/org/some-formula.git//example", "git@github.com:org/some-formula.git//example", + "git::https://github.com/org/some-formula.git//example?ref=example", } err := p.Prepare(config) diff --git a/website/pages/docs/provisioners/salt-masterless.mdx b/website/pages/docs/provisioners/salt-masterless.mdx index 535a35963..7cb92fc6e 100644 --- a/website/pages/docs/provisioners/salt-masterless.mdx +++ b/website/pages/docs/provisioners/salt-masterless.mdx @@ -100,4 +100,9 @@ Optional: - `guest_os_type` (string) - The target guest OS type, either "unix" or "windows". +- `formulas` (array of strings) - An array of git source formulas to be downloaded to the local + state tree prior to moving to the remote state tree. Note: `//directory` must be included in + the URL to download the appropriate formula directory. Example: + `git::https://github.com/saltstack-formulas/vault-formula.git//vault?ref=v1.2.3` + @include 'provisioners/common-config.mdx'