packer-community / packer-windows-plugins

A suite of Packer plugins for provisioning Windows machines
112 stars 20 forks source link

Floppy files doesn't allow for the same URI format as iso_url #47

Closed colinbowern closed 9 years ago

colinbowern commented 9 years ago

The template has different rules for file paths which makes it difficult to manage. When referring to files the same rules should apply to floppy_files collection as it does to the iso_url field. Trying the file:/// format results in the following errors:

Build 'vmware-windows-iso' errored: Error adding file to floppy: GetFileAttributesEx file:///C:/Users/colinb/Projects/BaseBoxes/Keys/CertificateAuthority.crt: The filename, directory name, or volume label syntax is incorrect.

Please use consistent path parsing across all of packer and its plugins.

dylanmei commented 9 years ago

This behavior comes from Packer. From the documentation on packer.io:

floppy_files (array of strings) - A list of files to place onto a floppy
disk that is attached when the VM is booted. ... All files listed in this
setting get placed into the root directory of the floppy and the floppy
is attached as the first floppy device. ... Wildcard characters(*, ?,
and []) are allowed. Directory names are also allowed, which will add
all the files found in the directory to the floppy.

It would be odd to try to support paths with wildcards and URLs.

mefellows commented 9 years ago

Yeah it's a bit of a strange one. The best we could offer would be to simplify the floppy files behaviour which would make us divergent from upstream Packer. As we have a goal to some day merge this into upstream Packer I'm not sure this is a good idea I'm afraid to say.

dylanmei commented 9 years ago

@colinbowern please address this as an issue at mitchellh/packer and we'll gladly follow along. Until then, we're not going to diverge our behavior here.