610 Commits

Author SHA1 Message Date
Megan Marsh
1f79b430ee
Merge pull request #6610 from hashicorp/filter_logs
Filter logs
2018-08-23 13:30:21 -07:00
Megan Marsh
31d4f8af45 use a time.Duration instead of a hardcoded ms 2018-08-23 13:16:01 -07:00
Megan Marsh
918db58604 added new template variables to replace PACKER_KEY_INTERVAL with tunable key and keygroup intervals depending on driver used 2018-08-22 11:37:56 -07:00
Adrien Delorme
41f6e0334d refactor all copy pasted sshConfig with into communicator.Config.SSHConfigFunc
* still need to append the auth methods into an array for gracefullness
2018-08-22 17:02:23 +02:00
Ali Rizvi-Santiago
cf9bbe3ecf Incorporated the hack demonstrated by @SwampDragons in order to deal with packer.rpc.Ui not exporting any information about what it's doing to anybody. 2018-08-20 21:55:18 -05:00
Ali Rizvi-Santiago
5726927cba Moved the progress bar out of packer.Ui and unlinked it out of all the packer.Ui implementations. Split up the terminal-related functions into a separate terminal.go and calculate the progress bar width by traversing through packer.Ui to avoid the issue with github.com/ugorji/go/codec serializing private members (or unsafe pointers) of structs. Shuffled some arguments around in getConsoleScreenBufferInfo in common/terminal_windows.go so that the interface forces the user to correctly declare a _CONSOLE_SCREEN_BUFFER_INFO type. 2018-08-20 21:55:18 -05:00
Ali Rizvi-Santiago
0f10032b3d Moved the progress bar from common to the packer.UI interface and refactored it so that the terminal width is calculated based on each interface which returns a custom progressbar specific to its ui. 2018-08-20 21:55:18 -05:00
Ali Rizvi-Santiago
fd2fef8738 Added support for the progress bar to automatically determine its width using the minimum length from a packer.UI and the terminal dimensions via kernel32.GetConsoleScreenBufferInfo or an ioctl (TIOCGWINSZ) to "/dev/tty". 2018-08-20 21:55:18 -05:00
Ali Rizvi-Santiago
16ecb3ad9a Reverted removal of progress-bar that was done by commit 5d97b105a8b6baf2cf3004e3765f5df66113a1a1 and added some missing arguments that were missed during the rebase. Modified the default progress bar's width to 80 as a result of the conversation on PR #5851. 2018-08-20 21:55:18 -05:00
Megan Marsh
ff6a039d5b replace scrubconfig with packer.LogSecretFilter.Set
filter winrm password from logs
Add new root-level packer template option, sensitive-variables, to tell us what user variables to mark sensitive.
2018-08-20 15:35:55 -07:00
Adrien Delorme
a5587e30ec log wether the file was transfered or is just being inplace referenced 2018-08-20 11:45:57 +02:00
Adrien Delorme
6b3844a64f
Revert "allow to use ISO images in-place v.s. copying them" 2018-08-20 10:48:06 +02:00
Adrien Delorme
c744e8b2bb make download messages less redudant and more simple 2018-08-17 09:29:39 +02:00
Adrien Delorme
d7d4aed51c be even more precise 2018-08-16 18:56:28 +02:00
Adrien Delorme
2b3ea29970 show more precise error download/copy/referencing messages 2018-08-16 18:41:44 +02:00
Adrien Delorme
fae3db4e58 test inplace linking 2018-08-15 17:09:39 +02:00
Adrien Delorme
17f2949e36 remove stuttering; ISOConfig.InplaceISO -> Inplace 2018-08-15 15:51:25 +02:00
Adrien Delorme
863222b1e2 Also use the terminology Inplace in DownloadConfig for clarity/consistency
* swapped boolean checks
* swapped in tests too
2018-08-15 15:26:31 +02:00
Adrien Delorme
82e480a285 allow to use ISO images inplace v.s. copying them 2018-08-15 14:37:38 +02:00
Ali Rizvi-Santiago
71e43d0b7f Updated common/download.go to handle when a connection error happens (response is nil), and reformatted the error that's returned when an HTTP error occurs. 2018-07-28 19:09:29 -05:00
Megan Marsh
5ef8b55559 need log import 2018-07-23 10:34:05 -07:00
Megan Marsh
a2f5fbadf6 don't fail if you can't find abs or relative path. 2018-07-23 09:54:25 -07:00
DanHam
da21c25791
Convert incorrect 'vmxc' -> 'vmcx' in codebase, docs and template opts
grep -rli --exclude-dir={vendor,bin\*,\*vmware\*,\*pkg\*} vmxc . | \
xargs sed -i 's/\(vm\)\(x\)\(c\)/\1\3\2/ig'
2018-07-20 02:12:47 +01:00
DanHam
674bad0ab4
Break very long lines for readability 2018-07-20 02:12:47 +01:00
DanHam
d2390f464d
Actually implement the function for the driver 2018-07-20 02:12:45 +01:00
DanHam
c2437ba592
Remove the option to place the VHD files in a separate directory
The export process now exports the VM directly from the build directory
into the output directory. There are no intermediate steps or copying of
files involved. This means that there is no longer any benefit in having
a separate directory to house the VHD files - see #5206 for the
reasoning behind the introduction of this feature.

If a user wishes to house the build files on a separate disk from the
output directory (perhaps for performance reasons or due to disk space
limitations) they can still do so through the use of `temp_path`.
2018-07-20 02:12:43 +01:00
DanHam
c6b9d9ce90
Add checks/error reporting to compaction process
* Report compaction results
* Failure to find any disks under the supplied path is treated as a
  'soft' error and a warning message will be printed in place of the
  compaction result. Any other failure will cause the build to fail.
2018-07-20 02:12:42 +01:00
DanHam
534fc4a473
Ensure the export directory structure matches that of previous versions
Commit 3fc2defb6 altered the directory structure associated with an
exported VM. The changes mean that the export process now stores the
exported machine files and folders under a folder with name 'vm_name' in
the output directory.
This commit restores the previous behaviour whereby the exported machine
files and folders were stored directly in the output directory. This
allows us to keep the efficiency improvements introduced with 3fc2defb6
while maintaining backward compatibility.

By default the Export-VM command creates three folders in the specified
export directory - 'Virtual Hard Disks', 'Virtual Machines' and
'Snapshots'. When a machine with no associated snapshots is exported the
'Snapshots' directory is empty.
Prior to 3fc2defb6 the Snapshots folder was not copied/incorporated into
the output directory at all. This was a bug.
This commit preserves the legacy behaviour by not including an empty
Snapshots directory in the export. However, if there *are* Snapshots
associated with the VM, they are now moved into the output directory
along with the usual directories containing disks and VM metadata. This
prevents warnings/errors on import due to missing snapshots.
2018-07-20 02:09:57 +01:00
DanHam
dc46848f89
Remove now redundant function to copy exported VM files 2018-07-20 02:09:57 +01:00
DanHam
3fc2defb6d
Refactor the export step for Hyper-V ISO and VMCX builders
* Fixes a bug that caused the build to error if users did not
  explicitly set `skip_compaction:true` when setting `skip_export:
  true`. See #6392.
* Improves the efficiency of the compaction and export process by
  reordering the compaction and export steps.
* Further improves the efficiency of the compacting step through
  compacting the vmd* file directly rather than creating and then
  operating on a copy.
* The changes mean the export process now stores the exported machine
  files and folders under a folder with name 'vm_name' in the output
  directory. Previously the exported machine files and folders were
  stored directly in the output directory.
2018-07-20 02:09:54 +01:00
Mathieu Tarral
edcc0b3853 shell-local: expose PACKER_HTTP_ADDR env var 2018-07-17 18:49:36 +03:00
Megan Marsh
0df33cd032 fix relative pathing versus iso checksum dir to work even if user has provided a relative path for the iso_url which is relative to the directory where Packer is run. 2018-07-13 09:21:04 -07:00
Megan Marsh
d0f0da6626 allow absolute paths to isos in checksum files 2018-07-13 09:14:59 -07:00
M. Marsh
e5a63a674e
Merge pull request #6422 from DanHam/fix-gh-vmsecureboot
Hyper-V: Use Get-Command over Get-Help to check for SecureBootTemplate parameter
2018-06-25 16:48:16 -07:00
M. Marsh
baaca808e8
Merge pull request #6412 from hashicorp/fix_config_validation_bug_windows_shell_local
found a config validation bug where packer crashes instead of throwin…
2018-06-25 16:47:23 -07:00
DanHam
297f6b85ec
Use Get-Command over Get-Help to check for SecureBootTemplate parameter 2018-06-25 23:52:01 +01:00
Simon Hulme
475e79a251 Fixed SecureBootTemplate not being passed through to PS cmdlet
Added check for SecureBootTemplate parameter for Server 2012 and below
Corrected enableSecureBootString usage
2018-06-25 14:13:43 +01:00
Megan Marsh
4a7953f93a found a config validation bug where packer crashes instead of throwing a validation error if a windows-style path is provided to a provisioner on linux 2018-06-22 13:49:39 -07:00
Jordan Borean
efa9021974
Check if hyper-v addresses is an array before slicing it 2018-06-18 14:45:33 +10:00
Giovanni Tirloni
28095cf027 Do not return error on initial HEAD request 2018-06-13 20:30:19 -03:00
Giovanni Tirloni
b7ea0b44fc HTTPDownloader - Fix invalid error handling 2018-06-13 17:42:27 -03:00
M. Marsh
a012f70e71
Merge pull request #6251 from hashicorp/do_winrm_shell_local
access automatically generated winrm password from shell-local
2018-05-29 12:09:40 -07:00
Megan Marsh
3afca6905b remove duplicate assignmnet 2018-05-29 11:47:27 -07:00
Matthew Hooker
6a769f08d8
regenerate boot command code 2018-05-29 11:17:51 -07:00
Matthew Hooker
788418cff2
Add unit test to show that we handle tars safely 2018-05-25 12:13:59 -07:00
Megan Marsh
846f94c964 implement template variable for accessing WinRM password in either environemnt variables or directly in execute_command or inline commands. 2018-05-23 16:00:43 -07:00
M. Marsh
62e1323577
Merge pull request #5956 from hashicorp/dedupe_shell_local
Deduplicate the code for the shell-local post-processor and shell-local provisioner
2018-05-23 15:54:27 -07:00
Megan Marsh
d1e31c0f23 use if/else to clarify code 2018-05-21 15:19:27 -07:00
Megan Marsh
969201a2d4 handle minor shell-local PR suggestions and corrections 2018-05-21 14:56:44 -07:00
Megan Marsh
1fdf763d0f fancier logging 2018-05-21 11:25:51 -07:00