Skip to main content

packerlicious - a python wrapper for packer templates.

Project description

https://travis-ci.org/mayn/packerlicious.svg?branch=master https://coveralls.io/repos/github/mayn/packerlicious/badge.svg?branch=master

About

packerlicious - a python library to create packer templates.

Project follows semantic versioning , v0.x.x API should be considered unstable, API will change frequently, please plan accordingly.

This project leverages the logic engine of troposphere.

Installation

packerlicious can be installed via pip:

$ pip install packerlicious

Examples

Below is the packerlicious equivalent of packer’s example template

>>> from packerlicious import builder, provisioner, Template
>>> template = Template()
>>> template.add_builder(
...     builder.AmazonEbs(
...         access_key="...",
...         secret_key="...",
...         region = "us-east-1",
...         source_ami="ami-fce3c696",
...         instance_type="t2.micro",
...         ssh_username="ubuntu",
...         ami_name="packer {{timestamp}}"
...     )
... )
<packerlicious.builder.AmazonEbs object at 0x104e87ad0>
>>> template.add_provisioner(
...     provisioner.Shell(
...         script="setup_things.sh"
...     )
... )
<packerlicious.provisioner.Shell object at 0x1048c08d0>
>>> print(template.to_json())
{
  "builders": [
    {
      "access_key": "...",
      "ami_name": "packer {{timestamp}}",
      "instance_type": "t2.micro",
      "region": "us-east-1",
      "secret_key": "...",
      "source_ami": "ami-fce3c696",
      "ssh_username": "ubuntu",
      "type": "amazon-ebs"
    }
  ],
  "provisioners": [
    {
      "script": "setup_things.sh",
      "type": "shell"
    }
  ]
}

Currently supported Packer resources

Builders:

  • amazon-ebs
  • docker
  • file

Post Processors:

  • alicloud-import
  • amazon-import
  • artifice
  • atlas
  • checksum
  • compress
  • docker-import
  • docker-push
  • docker-save
  • docker-tag
  • googlecompute-export
  • manifest
  • shell-local
  • vagrant
  • vagrant-cloud
  • vsphere

Provisioners:

  • ansible-local
  • ansible
  • file
  • salt-masterless
  • shell
  • shell-local

Licensing

packerlicious is licensed under the Apache license 2.0. See LICENSE for the full license text.

Project details


Release history Release notifications

History Node

0.7.0

History Node

0.6.1

History Node

0.6.0

History Node

0.5.0

History Node

0.4.0

History Node

0.3.0

History Node

0.2.2

This version
History Node

0.2.1

History Node

0.2.0

History Node

0.1.0.dev0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
packerlicious-0.2.1.tar.gz (16.0 kB) Copy SHA256 hash SHA256 Source None Aug 13, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page