Skip to content

Shell scripts to build Debian-like Virtualbox images using Packer

License

Notifications You must be signed in to change notification settings

Oefenweb/shell-packer-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

packer-template

Build Status

Shell scripts to build Debian-like Virtualbox images using Packer.

Variables

  • PYTHON_VERSION: [required]: Python version to use for bootstrapping (e.g. 3)
  • ANSIBLE_VERSION: [required]: Ansible version to use for bootstrapping (e.g. latest, 2.9.10)

Example

{
  "provisioners": [
    {
      "environment_vars": [
        "ANSIBLE_VERSION={{ user `ansible_version` }}",
        "PYTHON_VERSION={{ user `python_version` }}"
      ],
      "execute_command": "echo 'vagrant' | {{ .Vars }} sudo -S -E sh -eux '{{ .Path }}'",
      "scripts": "provisioners/shell/packer-template/bootstrap.sh",
      "type": "shell"
    },
    {
      "command": "/venv/ansible-run",
      "extra_arguments": [
        "--extra-vars 'packer_template_metadata_build_timestamp={{ user `build_timestamp` }}'",
        "--extra-vars 'packer_template_metadata_build_revision={{ user `build_revision` }}'",
        "--extra-vars 'packer_template_metadata_build_version={{ user `build_version` }}'",
        "-vvvv"
      ],
      "playbook_dir": "provisioners/ansible",
      "playbook_file": "provisioners/ansible/pre.yml",
      "type": "ansible-local"
    }
  ]
}

License

MIT

Author Information

Mischa ter Smitten (based on work from chef/bento)

Feedback, bug-reports, requests, ...

Are welcome!