mayn / packerlicious

use python to make hashicorp packer templates
Apache License 2.0
102 stars 51 forks source link

Support multiple named parallel builds of the same type #171

Closed canstudios-simonm closed 5 years ago

canstudios-simonm commented 5 years ago

packerlicious version

1.4.0

Expected behavior

Used packerlicious to build a template and then used packer.py to run it. Expected to run multiple parallel AmazonEbs builds, differentiated by their name (not type)

Actual behavior

Traceback (most recent call last): File "./updates.py", line 33, in "BuildTime": current_date File "/usr/local/lib/python3.4/dist-packages/packerlicious/builder.py", line 81, in init super(PackerBuilder, self).init(title, kwargs) File "/usr/local/lib/python3.4/dist-packages/packerlicious/builder.py", line 75, in init super(PackerCommunicator, self).init(title, kwargs) File "/usr/local/lib/python3.4/dist-packages/thirdparty/troposphere/init.py", line 97, in init self.setattr(k, v) File "/usr/local/lib/python3.4/dist-packages/thirdparty/troposphere/init.py", line 186, in setattr (type_name, name)) AttributeError: amazon-ebs object does not support attribute name

Steps to reproduce

Add a name property in the AmazonEbs builder template. e.g, template.add_builder( builder.AmazonEbs( name="MyBuilder1", etc... template.add_builder( builder.AmazonEbs( name="MyBuilder2", etc...

See above.

Add a new prop value for 'name' in packerlicious/builder.py in class AmazonEbs(PackerBuilder): e.g, props = { 'name' : (str, False), etc...
canstudios-simonm commented 5 years ago

Looks like it took it off the end but I tried the following and it worked:

edit: packerlicious/builder.py class AmazonEbs(PackerBuilder)

add in a new prop for name e.g, props = { 'name': (str, False), etc...

mayn commented 5 years ago

reference: named builds https://www.packer.io/docs/templates/builders.html#named-builds

mayn commented 5 years ago

thanks for reporting @canstudios-simonm , v1.4.1 was released with a fix.

canstudios-simonm commented 5 years ago

Just ran a couple of tests and can confirm that this has fixed the problem. Thanks :)