642 Commits

Author SHA1 Message Date
DanHam
5949bc91c4
Extend upload and subsequent 'dot sourcing' of env vars to std PS command
* Wrap funcs to flatten and upload env vars with new func prepareEnvVars.
  While the wrapped funcs could be combined, keeping them separate
  simplifies testing.
* Configure/refactor std and elevated PS to use new funcs to prepare,
  upload and dot source env vars.
* Dot sourcing the env vars in this way avoids the need to embed them
  directly in the command string. This avoids the need to escape the env
  vars to ensure the command string is correctly parsed.
* Characters within the env vars that are special to PS (such as $'s
  and backticks) will still need to be escaped to allow them to be
  correctly interpreted by PS.
* The std and elevated PS commands now inject env vars into the remote
  env via the same mechanism. This ensures consistent behaviour across the
  two command types.

Fixes #5471
2017-10-30 21:08:13 +00: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
Matthew Hooker
bafcf7dfb1
test, document, cleanup puppet guest codde 2017-10-03 11:39:33 -07:00
Matthew Hooker
7523cc76de Merge pull request #5340 from c22/issue_5339
Fix regression bug reported in #5339
2017-10-03 10:44:41 -07:00
Matthew Hooker
d26e28a028 Merge pull request #5341 from c22/issue_5338
Fix facterVar separator bug reported in #5338
2017-09-29 09:49:22 -07:00
DanHam
fa5fd602aa Fix tests post changes 2017-09-26 11:07:26 +01:00
DanHam
8214a12a2a Move append of portion of command used to send elevated PS output to file 2017-09-26 11:07:26 +01:00
DanHam
2a060adbf8 Don't use -EncodedCommand with PS as progress stream always leaks to stderr
* Setting $ProgressPreference to SilentlyContinue makes no difference
  when -EncodedCommand is used - any output to the progress stream
  still appears on stderr.
* Delete file containing encode/decode functions since we no longer
  need them.
* Fixes leak of output on progress streams for both normal and elevated
  commands.
* Since we no longer base64 encode, ensure any characters special to XML
  are correctly escaped in the elevated command. This ensures correct
  parsing once the command is wrapped within the elevatedTemplates XML
  based Task Scheduler definition.

Fixes #4322
2017-09-26 11:07:11 +01:00
Matthew Hooker
2297cfaee2 Merge pull request #5357 from lochnesh/fix-windows-chef-solo-version
use flag -version instead of -v to install chef-solo on Windows
2017-09-25 18:18:16 -05:00
DanHam
5374c6e367
Use system context env var to set path for elevated PS env vars file 2017-09-21 12:08:29 +01:00
Skyler Nesheim
52d3137b08 use flag -version instead of -v to install chef-solo on Windows 2017-09-18 09:43:02 -05:00
Matthew Hooker
70e493a2c2
fix directory permissions when using sudo 2017-09-15 10:48:50 -07:00
Matthew Hooker
af1187d5e1
simplify a bit 2017-09-15 10:06:54 -07:00
Megan Marsh
b05c673a14 Update powershell provisioner test with new default 2017-09-15 08:17:17 -07:00
Megan Marsh
cbe1d7d854 simplify file upload for elevated powershell wrapper 2017-09-14 17:01:48 -07:00
Megan Marsh
92e70757bb Move env vars into a file that we dot-source instead of trying to write them all to the command line 2017-09-14 17:00:57 -07:00
Megan Marsh
d458628529 exclude elevated_executed_command from config interpolation so it can be used correctly later 2017-09-14 10:50:32 -07:00
c22
948f955758 Fix regression bug reported in #5339 2017-09-14 11:44:14 +10:00
c22
cb12cd6668 Fix facterVar separator bug reported in #5338 2017-09-14 11:35:54 +10:00
Megan Marsh
c6889ad009 clarify logging by changing 'shell' to 'powershell' inside of the powershell provisioner 2017-09-06 11:59:25 -07:00
Megan Marsh
959db1ac16 add echo test to winrm connection. 2017-09-01 15:26:41 -07:00
Matthew Hooker
54920422ea Merge pull request #5252 from c22/packer_4391_rework
#4391 rework (see #4426)
2017-08-31 13:46:48 -07:00
Megan Marsh
f15304aa59 Merge pull request #5272 from hashicorp/fix_5064
Fix post-restart powershell failure
2017-08-28 11:41:37 -07:00
Megan Marsh
401c718a59 set default for ExpectDisconnect to false 2017-08-24 14:46:52 -07:00
Megan Marsh
b1001264ed fix windows-restart tests 2017-08-24 14:30:15 -07:00
Megan Marsh
b2923b4da6 check stdout to make sure echo command actually goes through before counting computer as fully restarted 2017-08-24 12:10:27 -07:00
Megan Marsh
89b058604d update tests for pull 5272 2017-08-22 14:20:40 -07:00
Megan Marsh
5214851463 make every script name unique 2017-08-22 14:03:28 -07:00
c22
42f1aa7a95 Refactor puppet-masterless based on puppet-server 2017-08-22 14:10:37 +10:00
c22
bc2e3de06d Resolve merge conflicts and update documentation. 2017-08-22 14:10:37 +10:00
c22
80ba99c04f Update documentation + small fixes
Updated the puppet-masterless documentation
Removed extraneous ConfigTemplate code
2017-08-22 14:10:37 +10:00
c22
fbac46af91 Linting + formatting 2017-08-22 14:10:37 +10:00
Sam Kerr
bcd30ad2f2 Update puppet-masterless commands to be OS specific
Previous implementation hardcoded "mkdir -p" which is fine for Unix, but
fails on Windows. This change draws on the example in the chef-solo
provisioner on how to detect the OS in use and use an appropriate mkdir
command.

In addition to updating the mkdir command, the actual executeCommand
needs to be OS specific, since Windows doesn't have sudo and Unix
doesn't require 'SET' when trying to change the value of a variable.

Modify the actual Windows command used to run Puppet.

Since the Facter vars on Windows are set with 'SET <varname>=<value>', a
'&&' is needed between the SET commands and the actual Puppet
invocation.
2017-08-22 14:10:37 +10:00
c22
1c592f291e Better Windows support in puppet-server
Reworking the puppet-server provisioner based on chef-client.
2017-08-22 14:10:37 +10:00
Brett Russ
7192c46e46 sudo prefix the command which cleans up /srv/{salt,pillar} as these are created with sudo in the packer driven salt bootstrapper 2017-08-11 21:26:16 -04:00
Luke Farnell
d9a5b69403 clean up ineffectual assignments 2017-08-07 13:20:01 -04:00
Matthew Hooker
b1f06bbebb
fix wording 2017-06-26 12:56:55 -07:00
Matthew Hooker
56979a1974
Revert "Universally provide POSIX semantics for the shell provisioner."
This reverts commit 1ba7f9cc20d5947c7c562f799cebcf3b5601fcce.
2017-06-21 16:11:47 -07:00
Matthew Hooker
67e29e1eff
disambiguates windows-restart messages. 2017-06-21 10:51:23 -07:00
Matthew Hooker
11379dea70 Merge pull request #5009 from sjlamerton/salt_bin_dir
Add support for salt_bin_dir
2017-06-13 10:21:53 -07:00
Matthew Hooker
8f685b3bcd
ansible: add skip_version_check flag 2017-06-07 13:31:56 -07:00
Matthew Hooker
70b3d05fb3 Merge pull request #4760 from fajpunk/ansible-inventory-dir
inventory_directory option for ansible provisioner
2017-06-07 11:22:23 -07:00
Steven Lamerton
e953898890 Add support for salt_bin_dir
Allows specifying the path to salt-call, useful if it isn't on the
path.
2017-06-07 08:16:23 +01:00
Matthew Hooker
bc16c13b50 Merge pull request #4961 from magicalbob/grains
Grains
2017-06-06 12:37:18 -07:00
Matthew Hooker
74bf0b636b Merge pull request #4791 from optix2000/master
Add version selection for chef-solo provisioner
2017-06-05 15:30:48 -07:00
Ian Ellis
31f66b6fe9 Cloned GrainsFile test from MinionConfig test 2017-06-04 13:03:50 +01:00
Ian Ellis
912fc9c2af Added grains_file config item to copy file to /etc/salt/grains 2017-06-04 08:31:30 +01: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