From 984ac3187b60f776ac7338c22892e0ca4d978150 Mon Sep 17 00:00:00 2001 From: James Deathe Date: Sun, 25 Dec 2016 00:22:10 +0000 Subject: [PATCH 1/5] ISSUE 23: Adds fix for variable name change since Packer 0.10.1. --- CentOS-7-Minimal-Cloud-Init-virtualbox.json | 6 +++--- CentOS-7-Minimal-virtualbox.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CentOS-7-Minimal-Cloud-Init-virtualbox.json b/CentOS-7-Minimal-Cloud-Init-virtualbox.json index 59eff84..9aa85e3 100644 --- a/CentOS-7-Minimal-Cloud-Init-virtualbox.json +++ b/CentOS-7-Minimal-Cloud-Init-virtualbox.json @@ -123,7 +123,7 @@ }, { "type": "shell-local", - "execute_command": "chmod +x {{.Path}}; {{.Vars}} /bin/bash {{.Path}}", + "execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\"", "inline_shebang": "/bin/bash -e", "inline": [ "if [[ ! -d output-tmp ]]; then", @@ -153,7 +153,7 @@ }, { "type": "shell-local", - "execute_command": "chmod +x {{.Path}}; {{.Vars}} /bin/bash {{.Path}}", + "execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\"", "inline_shebang": "/bin/bash -e", "inline": [ "if [[ -n ${1} ]] && [[ -f ${1} ]]; then", @@ -169,7 +169,7 @@ "provisioners": [ { "type": "shell", - "execute_command": "chmod +x {{.Path}}; env {{.Vars}} /bin/bash {{.Path}}", + "execute_command": "chmod +x \"{{.Path}}\"; env {{.Vars}} /bin/bash \"{{.Path}}\"", "remote_folder": "/var/tmp", "skip_clean": false, "environment_vars": [ diff --git a/CentOS-7-Minimal-virtualbox.json b/CentOS-7-Minimal-virtualbox.json index df081c7..df6d83e 100644 --- a/CentOS-7-Minimal-virtualbox.json +++ b/CentOS-7-Minimal-virtualbox.json @@ -123,7 +123,7 @@ }, { "type": "shell-local", - "execute_command": "chmod +x {{.Path}}; {{.Vars}} /bin/bash {{.Path}}", + "execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\"", "inline_shebang": "/bin/bash -e", "inline": [ "if [[ ! -d output-tmp ]]; then", @@ -153,7 +153,7 @@ }, { "type": "shell-local", - "execute_command": "chmod +x {{.Path}}; {{.Vars}} /bin/bash {{.Path}}", + "execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\"", "inline_shebang": "/bin/bash -e", "inline": [ "if [[ -n ${1} ]] && [[ -f ${1} ]]; then", @@ -169,7 +169,7 @@ "provisioners": [ { "type": "shell", - "execute_command": "chmod +x {{.Path}}; env {{.Vars}} /bin/bash {{.Path}}", + "execute_command": "chmod +x \"{{.Path}}\"; env {{.Vars}} /bin/bash \"{{.Path}}\"", "remote_folder": "/var/tmp", "skip_clean": false, "environment_vars": [ From da6432e4595353ae55f101e02127c0a59f92fb25 Mon Sep 17 00:00:00 2001 From: James Deathe Date: Sun, 25 Dec 2016 00:23:55 +0000 Subject: [PATCH 2/5] ISSUE 23: Adds Packer version update to 0.12.1. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eb73a45..ff47b1d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ To build the box file you will need the following installed: - [VirtualBox](https://www.virtualbox.org) (5.0.26) - [Vagrant](https://www.vagrantup.com) (1.8.4) -- [Packer](https://www.packer.io) (0.10.1) +- [Packer](https://www.packer.io) (0.12.1) ### Build From fe7645caea5387ae708a064ccfd928c468323564 Mon Sep 17 00:00:00 2001 From: James Deathe Date: Mon, 26 Dec 2016 00:43:54 +0000 Subject: [PATCH 3/5] ISSUE 23: Adds version numbers of working Vagrant/VirtualBox combination. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ff47b1d..01e5927 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ The build environment required is Mac OSX or GNU Linux. To build the box file you will need the following installed: -- [VirtualBox](https://www.virtualbox.org) (5.0.26) -- [Vagrant](https://www.vagrantup.com) (1.8.4) +- [VirtualBox](https://www.virtualbox.org) (5.0.30) +- [Vagrant](https://www.vagrantup.com) (1.9.1) - [Packer](https://www.packer.io) (0.12.1) ### Build From 7bf2ef2e8930bd9773be8e0ea496a1fd1d40d252 Mon Sep 17 00:00:00 2001 From: James Deathe Date: Tue, 8 Aug 2017 21:41:36 +0100 Subject: [PATCH 4/5] ISSUE 25: Adds user variable for vagrantfile_template. --- CentOS-7-Minimal-Cloud-Init-virtualbox.json | 5 +++-- CentOS-7-Minimal-virtualbox.json | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CentOS-7-Minimal-Cloud-Init-virtualbox.json b/CentOS-7-Minimal-Cloud-Init-virtualbox.json index 9aa85e3..ec60503 100644 --- a/CentOS-7-Minimal-Cloud-Init-virtualbox.json +++ b/CentOS-7-Minimal-Cloud-Init-virtualbox.json @@ -32,7 +32,8 @@ "ssh_user_home": "/home/centos", "ssh_user_password": "centos", "ssh_user_shell": "/bin/bash", - "ssh_user_sudo": "ALL=(ALL) NOPASSWD:ALL" + "ssh_user_sudo": "ALL=(ALL) NOPASSWD:ALL", + "vagrantfile_template": "CentOS-7.Vagrantfile" }, "builders": [ { @@ -139,7 +140,7 @@ ], { "type": "vagrant", - "vagrantfile_template": "CentOS-7.Vagrantfile", + "vagrantfile_template": "{{user `vagrantfile_template`}}", "output": "{{user `build_output_directory`}}/{{.BuildName}}-{{.Provider}}.box", "compression_level": 9, "keep_input_artifact": true diff --git a/CentOS-7-Minimal-virtualbox.json b/CentOS-7-Minimal-virtualbox.json index df6d83e..861e361 100644 --- a/CentOS-7-Minimal-virtualbox.json +++ b/CentOS-7-Minimal-virtualbox.json @@ -32,7 +32,8 @@ "ssh_user_home": "/home/vagrant", "ssh_user_password": "vagrant", "ssh_user_shell": "/bin/bash", - "ssh_user_sudo": "ALL=(ALL) NOPASSWD:ALL" + "ssh_user_sudo": "ALL=(ALL) NOPASSWD:ALL", + "vagrantfile_template": "CentOS-7.Vagrantfile" }, "builders": [ { @@ -139,7 +140,7 @@ ], { "type": "vagrant", - "vagrantfile_template": "CentOS-7.Vagrantfile", + "vagrantfile_template": "{{user `vagrantfile_template`}}", "output": "{{user `build_output_directory`}}/{{.BuildName}}-{{.Provider}}.box", "compression_level": 9, "keep_input_artifact": true From ef17274f7e96d93a07665e2ec409461fc0fc68ff Mon Sep 17 00:00:00 2001 From: James Deathe Date: Tue, 8 Aug 2017 23:48:38 +0100 Subject: [PATCH 5/5] ISSUE 25: Adds support for Packer 1.0.0. --- CentOS-7-Minimal-Cloud-Init-virtualbox.json | 72 ++++++++------------- CentOS-7-Minimal-virtualbox.json | 72 ++++++++------------- README.md | 6 +- 3 files changed, 59 insertions(+), 91 deletions(-) diff --git a/CentOS-7-Minimal-Cloud-Init-virtualbox.json b/CentOS-7-Minimal-Cloud-Init-virtualbox.json index ec60503..851caf1 100644 --- a/CentOS-7-Minimal-Cloud-Init-virtualbox.json +++ b/CentOS-7-Minimal-Cloud-Init-virtualbox.json @@ -115,29 +115,21 @@ "compression_level": 9, "keep_input_artifact": true }, - [ - { - "type": "artifice", - "files": [ - "CentOS-7.Vagrantfile" - ] - }, - { - "type": "shell-local", - "execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\"", - "inline_shebang": "/bin/bash -e", - "inline": [ - "if [[ ! -d output-tmp ]]; then", - " mkdir output-tmp", - "fi", - "if [[ -n ${1} ]] && [[ -f ${1} ]]; then", - " echo '--> Generating Vagrantfile template.'", - " cp -pf ${1} output-tmp/${1}", - " sed -e 's~[{][{]user `ssh_user`[}][}]~{{user `ssh_user`}}~g' output-tmp/${1} > ${1}", - "fi" - ] - } - ], + { + "type": "shell-local", + "execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\" {{user `vagrantfile_template`}}", + "inline_shebang": "/bin/bash -e", + "inline": [ + "if [[ ! -d output-tmp ]]; then", + " mkdir output-tmp", + "fi", + "if [[ -n ${1} ]] && [[ -f ${1} ]]; then", + " echo '--> Generating Vagrantfile template.'", + " cp -pf ${1} output-tmp/${1}", + " sed -e 's~[{][{]user `ssh_user`[}][}]~{{user `ssh_user`}}~g' output-tmp/${1} > ${1}", + "fi" + ] + }, { "type": "vagrant", "vagrantfile_template": "{{user `vagrantfile_template`}}", @@ -145,27 +137,19 @@ "compression_level": 9, "keep_input_artifact": true }, - [ - { - "type": "artifice", - "files": [ - "output-tmp/CentOS-7.Vagrantfile" - ] - }, - { - "type": "shell-local", - "execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\"", - "inline_shebang": "/bin/bash -e", - "inline": [ - "if [[ -n ${1} ]] && [[ -f ${1} ]]; then", - " echo '--> Restoring Vagrantfile template.'", - " mv -f ${1} .", - "fi", - "echo '--> Cleanup output directories.'", - "find . -mindepth 1 -maxdepth 1 -type d -name \"output-*\" -exec rm -rf '{}' +" - ] - } - ] + { + "type": "shell-local", + "execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\" {{user `vagrantfile_template`}}", + "inline_shebang": "/bin/bash -e", + "inline": [ + "if [[ -n ${1} ]] && [[ -f ${1} ]]; then", + " echo '--> Restoring Vagrantfile template.'", + " mv -f ${1} .", + "fi", + "echo '--> Cleanup output directories.'", + "find . -mindepth 1 -maxdepth 1 -type d -name \"output-*\" -exec rm -rf '{}' +" + ] + } ], "provisioners": [ { diff --git a/CentOS-7-Minimal-virtualbox.json b/CentOS-7-Minimal-virtualbox.json index 861e361..a3cb502 100644 --- a/CentOS-7-Minimal-virtualbox.json +++ b/CentOS-7-Minimal-virtualbox.json @@ -115,29 +115,21 @@ "compression_level": 9, "keep_input_artifact": true }, - [ - { - "type": "artifice", - "files": [ - "CentOS-7.Vagrantfile" - ] - }, - { - "type": "shell-local", - "execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\"", - "inline_shebang": "/bin/bash -e", - "inline": [ - "if [[ ! -d output-tmp ]]; then", - " mkdir output-tmp", - "fi", - "if [[ -n ${1} ]] && [[ -f ${1} ]]; then", - " echo '--> Generating Vagrantfile template.'", - " cp -pf ${1} output-tmp/${1}", - " sed -e 's~[{][{]user `ssh_user`[}][}]~{{user `ssh_user`}}~g' output-tmp/${1} > ${1}", - "fi" - ] - } - ], + { + "type": "shell-local", + "execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\" {{user `vagrantfile_template`}}", + "inline_shebang": "/bin/bash -e", + "inline": [ + "if [[ ! -d output-tmp ]]; then", + " mkdir output-tmp", + "fi", + "if [[ -n ${1} ]] && [[ -f ${1} ]]; then", + " echo '--> Generating Vagrantfile template.'", + " cp -pf ${1} output-tmp/${1}", + " sed -e 's~[{][{]user `ssh_user`[}][}]~{{user `ssh_user`}}~g' output-tmp/${1} > ${1}", + "fi" + ] + }, { "type": "vagrant", "vagrantfile_template": "{{user `vagrantfile_template`}}", @@ -145,27 +137,19 @@ "compression_level": 9, "keep_input_artifact": true }, - [ - { - "type": "artifice", - "files": [ - "output-tmp/CentOS-7.Vagrantfile" - ] - }, - { - "type": "shell-local", - "execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\"", - "inline_shebang": "/bin/bash -e", - "inline": [ - "if [[ -n ${1} ]] && [[ -f ${1} ]]; then", - " echo '--> Restoring Vagrantfile template.'", - " mv -f ${1} .", - "fi", - "echo '--> Cleanup output directories.'", - "find . -mindepth 1 -maxdepth 1 -type d -name \"output-*\" -exec rm -rf '{}' +" - ] - } - ] + { + "type": "shell-local", + "execute_command": "chmod +x \"{{.Script}}\"; {{.Vars}} /bin/bash \"{{.Script}}\" {{user `vagrantfile_template`}}", + "inline_shebang": "/bin/bash -e", + "inline": [ + "if [[ -n ${1} ]] && [[ -f ${1} ]]; then", + " echo '--> Restoring Vagrantfile template.'", + " mv -f ${1} .", + "fi", + "echo '--> Cleanup output directories.'", + "find . -mindepth 1 -maxdepth 1 -type d -name \"output-*\" -exec rm -rf '{}' +" + ] + } ], "provisioners": [ { diff --git a/README.md b/README.md index 01e5927..19293cf 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ The build environment required is Mac OSX or GNU Linux. To build the box file you will need the following installed: -- [VirtualBox](https://www.virtualbox.org) (5.0.30) -- [Vagrant](https://www.vagrantup.com) (1.9.1) -- [Packer](https://www.packer.io) (0.12.1) +- [VirtualBox](https://www.virtualbox.org) (5.1.22) +- [Vagrant](https://www.vagrantup.com) (1.9.5) +- [Packer](https://www.packer.io) (1.0.0) ### Build