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

Unable to use user variables in pausing_before #6903

Open
manikantakrishna opened this issue Oct 23, 2018 · 1 comment
Open

Unable to use user variables in pausing_before #6903

manikantakrishna opened this issue Oct 23, 2018 · 1 comment
Labels
core Core components of Packer stage/duplicate

Comments

@manikantakrishna
Copy link

{
"variables": {
    "FirstProvisionTime": "",
     "RestOfProvisionTime": ""
  },
  "provisioners": [
    {
      "type": "windows-restart",
      "pause_before": "{{ user `FirstProvisionTime` }}",
      "restart_timeout": "{{ user `FirstProvisionTime` }}"
    },
   {
      "type": "powershell",
      "pause_before": "{{ user `RestOfProvisionTime` }}",
      "script": "scripts/script.ps1",
      "elevated_user": "vagrant",
      "elevated_password": "vagrant"
    },
}

Error
ui error: Failed to parse template: 1 error(s) occurred:

  • provisioner 2: 1 error(s) decoding:

  • error decoding 'pause_before': time: invalid duration {{ user FirstProvisionTime }}

  • provisioner 1: 1 error(s) decoding:

  • error decoding 'pause_before': time: invalid duration {{ user RestOfProvisionTime }}

  • provisioner 2: 1 error(s) decoding:

I'm getting error for pause_before value.
restart_timeout value is passing successfully, Why I'm not able to pass user variables in pause_before.

@SwampDragons
Copy link
Contributor

Duplicate of #5115

@SwampDragons SwampDragons marked this as a duplicate of #5115 Oct 23, 2018
@SwampDragons SwampDragons added stage/duplicate core Core components of Packer labels Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core components of Packer stage/duplicate
Projects
None yet
Development

No branches or pull requests

2 participants