From 5e2d3617744a486f89a0d078d2b8e252b7f24cf0 Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Sun, 27 Mar 2016 15:02:02 -0400 Subject: [PATCH 1/6] Fix up azure-arm examples: make sure the variable names line up. --- examples/azure/centos.json | 12 ++++++------ examples/azure/debian.json | 12 ++++++------ examples/azure/opensuse.json | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/azure/centos.json b/examples/azure/centos.json index 8b30b065e..e0f31b081 100644 --- a/examples/azure/centos.json +++ b/examples/azure/centos.json @@ -12,12 +12,12 @@ "builders": [{ "type": "azure-arm", - "client_id": "{{user `cid`}}", - "client_secret": "{{user `cst`}}", - "subscription_id": "{{user `sid`}}", - "tenant_id": "{{user `tid`}}", - "resource_group_name": "{{user `rgn`}}", - "storage_account": "{{user `sa`}}", + "client_id": "{{user `client_id`}}", + "client_secret": "{{user `client_secret`}}", + "resource_group_name": "{{user `resource_group`}}", + "storage_account": "{{user `storage_account`}}", + "subscription_id": "{{user `subscription_id`}}", + "tenant_id": "{{user `tenant_id`}}", "capture_container_name": "images", "capture_name_prefix": "packer", diff --git a/examples/azure/debian.json b/examples/azure/debian.json index 5d4b7e1fe..f39c04326 100644 --- a/examples/azure/debian.json +++ b/examples/azure/debian.json @@ -12,12 +12,12 @@ "builders": [{ "type": "azure-arm", - "client_id": "{{user `cid`}}", - "client_secret": "{{user `cst`}}", - "subscription_id": "{{user `sid`}}", - "tenant_id": "{{user `tid`}}", - "resource_group_name": "{{user `rgn`}}", - "storage_account": "{{user `sa`}}", + "client_id": "{{user `client_id`}}", + "client_secret": "{{user `client_secret`}}", + "resource_group_name": "{{user `resource_group`}}", + "storage_account": "{{user `storage_account`}}", + "subscription_id": "{{user `subscription_id`}}", + "tenant_id": "{{user `tenant_id`}}", "capture_container_name": "images", "capture_name_prefix": "packer", diff --git a/examples/azure/opensuse.json b/examples/azure/opensuse.json index cd8d9f350..8a23ec626 100644 --- a/examples/azure/opensuse.json +++ b/examples/azure/opensuse.json @@ -12,12 +12,12 @@ "builders": [{ "type": "azure-arm", - "client_id": "{{user `cid`}}", - "client_secret": "{{user `cst`}}", - "subscription_id": "{{user `sid`}}", - "tenant_id": "{{user `tid`}}", - "resource_group_name": "{{user `rgn`}}", - "storage_account": "{{user `sa`}}", + "client_id": "{{user `client_id`}}", + "client_secret": "{{user `client_secret`}}", + "resource_group_name": "{{user `resource_group`}}", + "storage_account": "{{user `storage_account`}}", + "subscription_id": "{{user `subscription_id`}}", + "tenant_id": "{{user `tenant_id`}}", "capture_container_name": "images", "capture_name_prefix": "packer", From efa642fe04ad87d67bdd8e29aa5988517cba357c Mon Sep 17 00:00:00 2001 From: Shaun Haber Date: Fri, 1 Apr 2016 12:35:05 -0700 Subject: [PATCH 2/6] Add documentation for ssl_verify_mode --- website/source/docs/provisioners/chef-client.html.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/source/docs/provisioners/chef-client.html.md b/website/source/docs/provisioners/chef-client.html.md index 65d073093..47b68ca7b 100644 --- a/website/source/docs/provisioners/chef-client.html.md +++ b/website/source/docs/provisioners/chef-client.html.md @@ -95,6 +95,10 @@ configuration is actually required. - `skip_install` (boolean) - If true, Chef will not automatically be installed on the machine using the Chef omnibus installers. +- `ssl_verify_mode` (string) - Set to "verify\_none" to skip validation of + SSL certificates. If not set, this defaults to "verify\_peer" which validates + all SSL certifications. + - `staging_directory` (string) - This is the directory where all the configuration of Chef by Packer will be placed. By default this is "/tmp/packer-chef-client" when guest_os_type unix and From ad3d674919fd0ccb5e0b8d34110bda3e7af71f18 Mon Sep 17 00:00:00 2001 From: Christopher Boumenot Date: Tue, 5 Apr 2016 22:41:26 -0700 Subject: [PATCH 3/6] Do not use Fprintf, use Fprint. --- command/build.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/build.go b/command/build.go index 301ab9030..5d683d4b0 100644 --- a/command/build.go +++ b/command/build.go @@ -231,7 +231,7 @@ func (c BuildCommand) Run(args []string) int { fmt.Fprintf(&message, "--> %s: ", name) if artifact != nil { - fmt.Fprintf(&message, artifact.String()) + fmt.Fprint(&message, artifact.String()) } else { fmt.Fprint(&message, "") } From 2472e6bf06cacd84ede0c8fa188a715a886ffa6d Mon Sep 17 00:00:00 2001 From: Tyler Tidman Date: Wed, 6 Apr 2016 09:24:03 -0400 Subject: [PATCH 4/6] Put vmware-iso builder config options in 'packer fix' order and mention boolean defaults --- website/source/docs/builders/vmware-iso.html.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/website/source/docs/builders/vmware-iso.html.md b/website/source/docs/builders/vmware-iso.html.md index 314fc3b39..8500bd648 100644 --- a/website/source/docs/builders/vmware-iso.html.md +++ b/website/source/docs/builders/vmware-iso.html.md @@ -84,12 +84,6 @@ builder. ### Optional: -- `disk_additional_size` (array of integers) - The size(s) of any additional - hard disks for the VM in megabytes. If this is not specified then the VM - will only contain a primary hard disk. The builder uses expandable, not - fixed-size virtual hard disks, so the actual file representing the disk will - not use the full size unless it is full. - - `boot_command` (array of strings) - This is an array of commands to type when the virtual machine is first booted. The goal of these commands should be to type just enough to initialize the operating system installer. Special @@ -103,6 +97,12 @@ builder. five seconds and one minute 30 seconds, respectively. If this isn't specified, the default is 10 seconds. +- `disk_additional_size` (array of integers) - The size(s) of any additional + hard disks for the VM in megabytes. If this is not specified then the VM + will only contain a primary hard disk. The builder uses expandable, not + fixed-size virtual hard disks, so the actual file representing the disk will + not use the full size unless it is full. + - `disk_size` (integer) - The size of the hard disk for the VM in megabytes. The builder uses expandable, not fixed-size virtual hard disks, so the actual file representing the disk will not use the full size unless it @@ -219,12 +219,13 @@ builder. compacted at the end of the build process using `vmware-vdiskmanager`. In certain rare cases, this might actually end up making the resulting disks slightly larger. If you find this to be the case, you can disable compaction - using this configuration value. + using this configuration value. Defaults to `false`. - `keep_registered` (boolean) - Set this to `true` if you would like to keep the VM registered with the remote ESXi server. This is convenient if you use packer to provision VMs on ESXi and don't want to use ovftool to - deploy the resulting artifact (VMX or OVA or whatever you used as `format`) + deploy the resulting artifact (VMX or OVA or whatever you used as `format`). + Defaults to `false`. - `tools_upload_flavor` (string) - The flavor of the VMware Tools ISO to upload into the VM. Valid values are "darwin", "linux", and "windows". By From 0cea0e5c242ff50eddf8778e8259f5afea8f6351 Mon Sep 17 00:00:00 2001 From: Alex Brown Date: Wed, 6 Apr 2016 15:40:19 -0400 Subject: [PATCH 5/6] Swap width and height when allocating a pty RequestPty from crypto/ssh looks like this: func (s *Session) RequestPty(term string, h, w int, termmodes TerminalModes) error So arguments 2 and 3 are height and width, respectively. I'm not sure if the original was just a typo, or if there's an actual reason we want a 40 column terminal. Either way, having a terminal this narrow led me to a really "fun" bug[0], where `wget` in my shell provisioner scripts would segfault when trying to display the progress bar. [0] http://lists.gnu.org/archive/html/bug-wget/2016-02/msg00041.html --- communicator/ssh/communicator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index 223ea78b2..4427d45aa 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -94,7 +94,7 @@ func (c *comm) Start(cmd *packer.RemoteCmd) (err error) { ssh.TTY_OP_OSPEED: 14400, // output speed = 14.4kbaud } - if err = session.RequestPty("xterm", 80, 40, termModes); err != nil { + if err = session.RequestPty("xterm", 40, 80, termModes); err != nil { return } } From bcec4c4ffb092c7804231c9cdb05ebdfbe044056 Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Thu, 7 Apr 2016 10:39:08 -0500 Subject: [PATCH 6/6] website: force mime-types for some assets on deploy Should fix occassional issues with application/octet-stream mime type assets breaking JS/CSS on site. --- website/scripts/deploy.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/website/scripts/deploy.sh b/website/scripts/deploy.sh index 8f94d43fc..6916018c1 100755 --- a/website/scripts/deploy.sh +++ b/website/scripts/deploy.sh @@ -61,6 +61,18 @@ if [ -z "$NO_UPLOAD" ]; then --add-header="Cache-Control: max-age=31536000" \ --add-header="x-amz-meta-surrogate-key: site-$PROJECT" \ sync "$DIR/build/" "s3://hc-sites/$PROJECT/latest/" + + # The s3cmd guessed mime type for text files is often wrong. This is + # problematic for some assets, so force their mime types to be correct. + s3cmd \ + --mime-type="application/javascript" \ + modify "s3://hc-sites/$PROJECT/latest/**/*.js" + s3cmd \ + --mime-type="text/css" \ + modify "s3://hc-sites/$PROJECT/latest/**/*.css" + s3cmd \ + --mime-type="image/svg+xml" \ + modify "s3://hc-sites/$PROJECT/latest/**/*.svg" fi # Perform a soft-purge of the surrogate key.