fix(salt-masterless): Compare retrieved variable values with defaults
This commit is contained in:
parent
996f845d4b
commit
1242e08473
|
@ -424,7 +424,7 @@ func validateFn(c *terraform.ResourceConfig) (ws []string, es []error) {
|
||||||
var remoteStateTree string
|
var remoteStateTree string
|
||||||
remoteStateTreeTmp, ok := c.Get("remote_state_tree")
|
remoteStateTreeTmp, ok := c.Get("remote_state_tree")
|
||||||
if !ok {
|
if !ok {
|
||||||
remoteStateTree = ""
|
remoteStateTree = DefaultStateTreeDir
|
||||||
} else {
|
} else {
|
||||||
remoteStateTree = remoteStateTreeTmp.(string)
|
remoteStateTree = remoteStateTreeTmp.(string)
|
||||||
}
|
}
|
||||||
|
@ -432,12 +432,12 @@ func validateFn(c *terraform.ResourceConfig) (ws []string, es []error) {
|
||||||
var remotePillarRoots string
|
var remotePillarRoots string
|
||||||
remotePillarRootsTmp, ok := c.Get("remote_pillar_roots")
|
remotePillarRootsTmp, ok := c.Get("remote_pillar_roots")
|
||||||
if !ok {
|
if !ok {
|
||||||
remotePillarRoots = ""
|
remotePillarRoots = DefaultPillarRootDir
|
||||||
} else {
|
} else {
|
||||||
remotePillarRoots = remotePillarRootsTmp.(string)
|
remotePillarRoots = remotePillarRootsTmp.(string)
|
||||||
}
|
}
|
||||||
|
|
||||||
if minionConfig != "" && (remoteStateTree != "" || remotePillarRoots != "") {
|
if minionConfig != "" && (remoteStateTree != DefaultStateTreeDir || remotePillarRoots != DefaultPillarRootDir) {
|
||||||
es = append(es,
|
es = append(es,
|
||||||
errors.New("remote_state_tree and remote_pillar_roots only apply when minion_config_file is not used"))
|
errors.New("remote_state_tree and remote_pillar_roots only apply when minion_config_file is not used"))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue