Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

salt-masterless not recognizing ~ as a valid path #19929

Closed
isaachui opened this issue Jan 7, 2019 · 3 comments
Closed

salt-masterless not recognizing ~ as a valid path #19929

isaachui opened this issue Jan 7, 2019 · 3 comments

Comments

@isaachui
Copy link

isaachui commented Jan 7, 2019

Terraform Version

Terraform v0.11.11

Terraform Configuration Files

resource "null_resource" "saltmasterless" {
  provisioner "salt-masterless" {
    "local_state_tree"   = "~/saltstack/salt/states/"
    "remote_pillar_roots" = "/srv/salt/pillar"
    "local_pillar_roots" = "~/saltstack/salt/pillars/"
    "custom_state"       = "state.apply services.salt.master"
  }
}

Expected Behavior

Expected that the local path of ~ would be recognized and terraform would proceed normally. However with local_state_tree and local_pillar_roots this isn't working out as expected. Does not seem to be expected behavior since the documentation does not mention this.

Actual Behavior

Error: null_resource.saltmasterless: local_pillar_roots: path '~/saltstack/salt/pillars/' is invalid: stat ~/saltstack/salt/pillars/: no such file or directory

Error: null_resource.saltmasterless: local_state_tree: path '~/saltstack/salt/states/' is invalid: stat ~/saltstack/salt/states/: no such file or directory

Steps to Reproduce

  1. terraform init
  2. terraform plan

Errors out on plan. If I change the path to an absolute paths or relative paths, it works fine:

resource "null_resource" "saltmasterless" {
  provisioner "salt-masterless" {
    "local_state_tree"   = "/Users/me/saltstack/salt/states/"
    "remote_pillar_roots" = "/srv/salt/pillar"
    "local_pillar_roots" = "/Users/me/saltstack/salt/pillars/"
    "custom_state"       = "state.apply services.salt.master"
  }
}

only using ~ errors out.

Additional Context

Terraform is running in a python wrapper using subprocess.call, but otherwise nothing extravagant.

References

May be similar to #17150

@jbardin
Copy link
Member

jbardin commented Jan 7, 2019

Hi @isaachui,

Sorry this was a problem for you. The ~ character expanding to the current user's home directory is a feature of a POSIX shell. Passing the ~ character within an argument string to most programs will be only be interpreted as a literal ~ character. This is not a limitation with the provisioner, or Terraform in particular.

@jbardin jbardin closed this as completed Jan 7, 2019
@isaachui
Copy link
Author

isaachui commented Jan 8, 2019

@jbardin Thanks for the quick response!

@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants