Commit Graph

95 Commits

Author SHA1 Message Date
Megan Marsh 266a48a73a minor fixes for shell provisioner docs and logging 2018-08-30 14:36:14 -07:00
Megan Marsh ab13c73277 make varfile name unique and make sure to remove it from guest system if cleanup is true. 2018-08-30 11:02:56 -07:00
Megan Marsh 2c9a205f11 update shell provisioner tests 2018-08-29 11:10:49 -07:00
Megan Marsh cce13e3877 shell provisioner: add option to source env vars from a file 2018-08-29 11:10:49 -07:00
Megan Marsh fbbcbd772b remove file stat 2018-05-03 11:08:41 -07:00
Matthew Hooker 732a532d0e
pass file info during shell file upload 2018-03-20 16:32:55 -07:00
Matthew Hooker ecad3348b3
rephrase log message. 2017-10-26 10:41:49 -07:00
Ohad Basan 33b85b0130 Add suggestion for "expected_disconnect" option if disconnection occurs 2017-10-26 19:53:48 +03:00
Matthew Hooker 75111e49e9
remove convoluted pointer logic 2017-10-11 23:35:24 -07:00
Megan Marsh 401c718a59 set default for ExpectDisconnect to false 2017-08-24 14:46:52 -07:00
Matthew Hooker 56979a1974
Revert "Universally provide POSIX semantics for the `shell` provisioner."
This reverts commit 1ba7f9cc20.
2017-06-21 16:11:47 -07:00
Sean Chittenden 1ba7f9cc20
Universally provide POSIX semantics for the `shell` provisioner.
All platforms everywhere have `env(1)` available, leverage it
accordingly.

Improves on: #2343
2017-05-20 09:28:02 -07:00
Matthew Hooker 81522dced0
move packer to hashicorp 2017-04-04 13:39:01 -07:00
Matthew Hooker 0149f679de
Print instead of Printf with no dynamic first variable. 2017-03-28 20:36:20 -07:00
DanHam e350739ecb
post-processor/shell-local: expand tests to align with shell provisioner 2017-01-23 22:25:39 +00:00
DanHam 4514b1b10f provisioner/shell: expand tests to align with powershell/win-shell 2017-01-23 12:10:46 +00:00
DanHam 0cbb4ff30c provisioner/shell: Align gen of flattened env vars with powershell/win-shell
* Move code to generate quoted flattened env vars to separate function
* Fix: generate flattened env vars once per provisioner not once per script
2017-01-23 12:10:46 +00:00
Matthew Hooker 4e6a44f5f1
append will resize 2017-01-17 17:21:14 -08:00
Matthew Hooker 480398c3d2
only set PACKER_HTTP_ADDR if a server is listening 2017-01-17 17:17:36 -08:00
Matthew Hooker d2e59e4e92
set PACKER_HTTP_ADDR env var when available.
If using a builder that has an http server set up for file transfer,
expose the connection info to the shell provisioner through the environment
variable PACKER_HTTP_ADDR.

Closes #2869
2017-01-16 23:19:52 -08:00
Matthew Hooker 12176b6afc
provisioner/shell: treat disconnects as retryable. 2016-11-22 15:59:40 -08:00
Matthew Hooker 892d5e82c9 expect_disconnect option
provisioner/shell: Adds option to fail if the remote server disconnects
us.
2016-10-21 11:39:03 -07:00
Matthew Hooker a8e57d83d2 gofmt project.
noticed many unrelated changes being added to patches because of gofmt.

ran `find . -not -path "./vendor/*" -name "*.go" -exec gofmt -w {} \;`
2016-09-29 14:13:06 -07:00
Ian Duffy 7e653370b7 Seperate remote_path into remote_folder and remote_script. (#3462)
Commonly /tmp is set as noexec, as a result packer scripts
fail to run. In order to get around this one can set a
remote_path, whoever, remote path requires full filename
and path.

By making remote_path a combination of
remote_folder/remote_script we can change remote_folder
and keep the default script_nnn.sh

Signed-off-by: Ian Duffy <ian@ianduffy.ie>
2016-04-26 16:04:29 -07:00
Chris Bednarski 1f6749096a Restore missing interpolation after merging ansible remote; fixes #3138 2016-02-01 13:28:49 -08:00
Chris Bednarski 15f99a4aee Merge branch 'ansible-provisioner' of https://github.com/bhcleek/packer into f-ansible 2016-01-28 15:16:54 -08:00
David Zanetti 2668747c71 Rename noclean shell option to skip_clean, per pull feedback 2015-11-19 16:02:45 +13:00
David Zanetti 3d23655f2f Add "noclean" boolean to shell provisioner. This stops the provisioner from
attempting to remove helper scripts it creates. As noted on #2803 this can
be useful when deleting the build user from an AMI or other template.
2015-11-16 16:37:09 +13:00
Billie H. Cleek cc8ca3098e add ansible provisioner 2015-10-31 10:39:33 -07:00
Mitchell Hashimoto 7c8e86c9c5 provisioner/*: fix interpolation context 2015-06-22 12:26:54 -07:00
Mitchell Hashimoto 6ec428cc38 provisioner/shell: retry file delete [GH-2286] 2015-06-21 19:53:43 -07:00
Mitchell Hashimoto 4463083a60 provisioner/shell: randomize default script name 2015-06-18 10:38:23 +02:00
Mitchell Hashimoto 6c80228661 provisioner/shell: missing error arg 2015-06-15 15:11:08 -07:00
Mitchell Hashimoto a235419c7d provisioner/shell: remove file after exec [GH-1536] 2015-06-15 15:02:59 -07:00
Mitchell Hashimoto c549fce85e provisioner/shell: escape single quotes [GH-2067] 2015-06-13 14:11:20 -04:00
Mitchell Hashimoto 7830d78d06 provisioner/shell: fix tests 2015-06-11 17:24:02 -04:00
Mitchell Hashimoto b28f946be9 Merge pull request #2210 from mitchellh/b-set-e
provisioner/shell: set -e for inline [GH-2069]
2015-06-11 17:19:43 -04:00
Mitchell Hashimoto 3ed73852be provisioner/shell: set -e on the shebang itself 2015-06-11 17:19:23 -04:00
Mitchell Hashimoto a995df352e provisioner/shell: uploaded script should be 0755 [GH-1708] 2015-06-10 21:18:46 -07:00
Mitchell Hashimoto 952077ccb0 provisioner/shell: set -e for inline [GH-2069] 2015-06-10 21:02:22 -07:00
Mitchell Hashimoto 2b4df93f2f provisioner/*: interpolation 2015-05-27 14:50:20 -07:00
Mitchell Hashimoto 3eda0f33a0 provisioner/shell: quote PACKER env vars [GH-1565] 2014-10-28 08:23:18 -07:00
Josh Frye 5835ca42b4 Move quoting to else block only for valid vars. Add test case. 2014-10-14 14:20:36 -07:00
Josh Frye a667282e00 Single quote env var values. 2014-10-14 13:03:14 -07:00
Ross Smith II d92179847d provisioner/file: set file/directory permissions
fixes #1064
2014-05-09 21:03:35 -07:00
Mitchell Hashimoto 9365b879c0 provisioner/shell: chmod uploaded file to 0777 [GH-994] 2014-04-26 20:20:47 -07:00
Mitchell Hashimoto ec41edf558 provisioner/shell: Split on first equal for env vars [GH-1045] 2014-04-26 14:51:56 -07:00
Mitchell Hashimoto 528ae09c37 provisioner/shell: comment on why we return right away if advance == 0
/cc @mwhooker
2013-10-15 09:48:12 -10:00
Mitchell Hashimoto f673ca52ba provisoiner/shell: append only needs to add a byte for UnixReader 2013-10-15 09:40:47 -10:00
Matthew Hooker 104f5049a7 provisioner/shell: fix EOF detection
Fixes #507

The scanUnixLine function was erroneously returning empty lines when EOF
was reached.
This commit adds a test for the problem and changes the scanUnixLine
function to elide the trailing \n if no content was read.
2013-10-15 05:56:10 -07:00