Packer shell Provisioner: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 22: Line 22:
</syntaxhighlight>
</syntaxhighlight>
==script==
==script==
<syntaxhighlight lang='json'>
{
  ...
  "provisioners": [
    {
      "type": "shell",
      "only": [
        "my-builder"
      ],
      "environment_vars": [
        "SOMETHING={{ user `something` }}"
      ],
      "execute_command": "echo '' | {{ .Vars }} sudo -S -E -u root '{{ .Path }}'",
      "script": "config/something.sh"
    },
  ...
}
</syntaxhighlight>
==scripts==
==scripts==

Revision as of 17:23, 15 November 2019

External

Internal

Overview

shell Provisioner Types

inline

{
  ...
  "provisioners": [
    {
      "type": "shell",
      "inline": ["sudo yum install ansible"]
    },
  ... 
}

script

{
  ...
  "provisioners": [
    {
      "type": "shell",
      "only": [
        "my-builder"
      ],
      "environment_vars": [
        "SOMETHING={{ user `something` }}"
      ],
      "execute_command": "echo '' | {{ .Vars }} sudo -S -E -u root '{{ .Path }}'",
      "script": "config/something.sh"
    },
  ... 
}

scripts