summaryrefslogtreecommitdiff
path: root/lib/chef/knife
Commit message (Collapse)AuthorAgeFilesLines
* Fix incorrect deprecation warningsmp/bootstrap-deprecation-fixesMarc A. Paradise2019-05-011-42/+36
| | | | | | | | | | | | | | Fixed incorrect option mapping where deprecated flags would have a 'long' taken from the replacement flag. Updated the behavior in case of conflicting flags (for example --ssh-user and --connection-user) to avoid surprising results by failing with an error instead of trying to resolve intent. Renamed things a bit for readability/consistency. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Fixed conditionVasu11052019-04-301-1/+1
| | | | Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Fixed bootstrap error while using --msi-url option with knife bootstrap winrmVasu11052019-04-301-1/+1
| | | | Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Merge pull request #8411 from chef/mp/license-acceptance-in-bootstrapTim Smith2019-04-292-1/+2
|\ | | | | Enable license acceptance during bootstrap
| * Ensure license is accepted on remote bootstrap targetMarc A. Paradise2019-04-292-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When performing the initial `chef-client` converge on a bootstrapped host, ensure that we set the license environment variable that indicates the license was accepted. This will allow the run to continue under Chef 15, which requires license acceptance. I used the environment variable instead of the CLI flag because older versions of Chef do not support the CLI flag. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* | Add tests, and make connector more testableMarc A. Paradise2019-04-291-28/+21
| | | | | | | | Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* | Move most bootstrap requires into deps()Marc A. Paradise2019-04-291-7/+6
| | | | | | | | Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* | Switch bootstrap to use TrainConnector.Marc A. Paradise2019-04-291-57/+38
| | | | | | | | | | | | This replaces TargetHost, and the associated renames/minor updates. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* | Implement Bootstrap::TrainConnectorMarc A. Paradise2019-04-291-0/+293
|/ | | | | | This is a drop-in replacement for TargetHost out of chef-core. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* chef-client => Chef::Dist::CLIENTMarc Chamberland2019-04-265-15/+18
| | | | Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
* RubocopMarc A. Paradise2019-04-241-6/+6
| | | | Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Apply suggestions from code reviewTim Smith2019-04-241-2/+2
| | | | | Co-Authored-By: marcparadise <marcparadise@users.noreply.github.com> Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Make deprecations more robustMarc A. Paradise2019-04-241-28/+50
| | | | | | | | | | | THis improves deprecation handling by not trying to infer old opts/long string, and correctly handles setting the boolean flag on deprecated options. This also fixes references to :password to be in line with the option name, :connection_password. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Remove fips version check from bootstrap client.rbMarc A. Paradise2019-04-242-15/+2
| | | | | | | | | The minimum available version of Chef Client for bootstrap is 12.20; FIPS support was added in 12.8. This change removes the minimum chef version check for fips in the client.rb generated by bootstrap. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Remove 5.2/2003r2 - we do not produce binaries for win 2003Marc A. Paradise2019-04-241-4/+0
| | | | Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* deprecate old version of changed CLI flags.Marc A. Paradise2019-04-241-8/+53
| | | | | | | | This adds a lightweight deprecation mechanism in order to warn the human that they're using deprecated flags, and to continue to allow Bootstrap to work even if that happens. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Drop Chef 11 support from WindowsBootstrapContextMarc A. Paradise2019-04-241-8/+1
| | | | Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Remove bootstrap includeMarc A. Paradise2019-04-242-2/+0
| | | | | | | | | | | This was unnecessary since this class does not refer to Bootstrap, and it was causing warning messages at runtime about Bootstrap constants being defined twice. This didn't happen previously because Bootstrap did not have any constants defined until after the conversion to Train. Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Remove prerelease support. Minimum version w/ fips now 12.20.Marc A. Paradise2019-04-242-45/+16
| | | | Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Move bootstrap CLI options back into BootstrapMarc A. Paradise2019-04-242-360/+308
| | | | Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Rubocop!Marc A. Paradise2019-04-244-214/+202
| | | | Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Add formatting for multi-line ui.log messages.Marc A. Paradise2019-04-241-1/+17
| | | | Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Bootstrap via chef_coreMarc A. Paradise2019-04-246-287/+1490
| | | | | | | | | | | | | | | | | | | | | | | | | Make bootstrap use train via chef_core/TargetHost This commit implements usage of TargetHost instead of knife_ssh. TargetHost is a platform-independent representation of a Train connection. It abstracts common operations (such as file upload/download, permissions, temp directories, command executation, etc) and connection error handling. Moving to TargetHost and train gives us the ability to execute commands on the bootstrap target; instead of running sh -c 'long-command-string-containing-secrets', we'll now upload the bootstrap script to a temporary directory on the bootstrap target and execute it there. Incorporating WinRM support directly (allowing core support for Windows bootstraps, without the knife-windows plugin) will follow. THis also improves unit test coverage of the bootstrap module, and clarifies functional versus behavior tests in that space Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* Replacing workmarks with distro constantsMarc Chamberland2019-04-191-2/+2
| | | | Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
* Merge pull request #8381 from chef/kill_highlineLamont Granquist2019-04-171-2/+7
|\ | | | | Replace highline with tty-screen in knife list
| * Replace highline with tty-screen in knife listkill_highlineTim Smith2019-04-161-2/+7
| | | | | | | | | | | | One step closer to killing off highline. We're just getting the terminal width here, which is super overkill for highline. We're still using it in quite a few other places, but this gets us one step closer to moving over to tty entirely. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Allowing encryption of an unencrypted data bagvijaymmali19902019-04-171-1/+1
|/ | | | Signed-off-by: vijaymmali1990 <vijay.mali@msystechnologies.com>
* Add misc YARD commentsyard3Tim Smith2019-03-111-0/+1
| | | | | | A pile of misc yard I added as I was reading things. Signed-off-by: Tim Smith <tsmith@chef.io>
* Update knife bootstrap template to use up to date omnitruck URLMark Harrison2019-01-291-1/+1
| | | | | | | | | | omnitruck-direct.chef.io is a legacy URL that now points to the same place as omnitruck.chef.io, and was originally in place to support clients with older SSL libraries. However, the backward compatible behavior of omnitruck-direct hasn't been the case for a while now. This change just corrects the URL in the bootstrap template also. Signed-off-by: Mark Harrison <mark@mivok.net>
* Merge pull request #8135 from f9n/clean_up_the_knife_cookbook_upload_commandTim Smith2019-01-281-17/+3
|\ | | | | [knife] Remove duplicate code blocks in the knife cookbook upload command
| * Remove unnessary code blocks in the knife cookbook upload commandf9n2019-01-181-17/+3
| | | | | | | | Signed-off-by: Fatih Sarhan <f9n@protonmail.com>
* | Merge pull request #8166 from chef/knife_depsTim Smith2019-01-282-11/+5
|\ \ | | | | | | Cleanup requires / includes in knife supermarket
| * | Cleanup requires / includes in knife supermarketknife_depsTim Smith2019-01-242-11/+5
| | | | | | | | | | | | | | | | | | | | | 1) Move everything into the deps blocks 2) don't require shell_out in install since we're not using it. We use mixlib_archive now Signed-off-by: Tim Smith <tsmith@chef.io>
* | | Misc YARD updates for knifeTim Smith2019-01-255-10/+16
|/ / | | | | | | | | | | Some YARD fixes as I was reading through knife bits. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Add a deprecation warning to knife cookbook sitedeprecate_knife_cookbook_siteTim Smith2019-01-227-7/+43
| | | | | | | | | | | | We'll want to backport this to Chef 14 as well. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Hide knife cookbook site & null by setting them to deprecated categoryTim Smith2019-01-228-7/+10
|/ | | | | | This keeps these commands out of the help text. Signed-off-by: Tim Smith <tsmith@chef.io>
* changes for rubocop engine upgrades.lcg/rubocop-upgradesLamont Granquist2019-01-1510-20/+20
| | | | | | | this is the result of changes to rules we already previously had enabled. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* change HTTPServerException to HTTPClientException for ruby 2.6Lamont Granquist2019-01-038-8/+8
| | | | | | includes backcompat for 2.5 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #7852 from chef/cookbook_createTim Smith2018-11-051-29/+0
|\ | | | | Fully remove knife cookbook create command
| * Fully remove knife cookbook create commandcookbook_createTim Smith2018-11-021-29/+0
| | | | | | | | | | | | We already removed all functionality and replaced it with an error message. This prevents the command from showing up in help. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Merge pull request #7869 from chef/knife_descriptionsTim Smith2018-11-0514-14/+14
|\ \ | | | | | | Make knife command banners consistent
| * | Make knife command banners consistentknife_descriptionsTim Smith2018-11-0414-14/+14
| | | | | | | | | | | | | | | | | | Add (options) everywhere you can pass in options. Signed-off-by: Tim Smith <tsmith@chef.io>
* | | Remove the remaining OSC 11 knife user commandsknife_osc_11Tim Smith2018-11-045-267/+0
|/ / | | | | | | | | | | | | | | The previous PR removed the argv rewrite, but didn't remove the actual commands it rewrote to. Now we remove the commands so they don't show up in help. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Remove knife user support for open source Chef Server < 12Tim Smith2018-11-048-344/+50
|/ | | | | | We shipped Chef 12 server on 2014-11-25. We've maintained backwards compatibility here by shipping double plugins, constantly checking for Chef 11 and then rewriting passed args. We deprecated it with Chef 14. This fully removes support. chef-client will continue to work on chef 11, but users cannot be managed with knife from a workstation running the latest version of Chef/ChefDK. Signed-off-by: Tim Smith <tsmith@chef.io>
* Remove knife cookbook test featureTim Smith2018-11-011-95/+0
| | | | | | We deprecated this during the Chef 13 cycle. It's time to fully remove it. Signed-off-by: Tim Smith <tsmith@chef.io>
* Remove deprecated knife status --hide-healthy flaghide_healthyTim Smith2018-10-291-13/+0
| | | | | | We've been telling people this was going away in Chef 15 Signed-off-by: Tim Smith <tsmith@chef.io>
* Remove cookbook merging/shadowing from the cookbooker loaderLamont Granquist2018-10-261-23/+2
| | | | | | This has been deprecated since forever. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #7489 from chef/bootstrap_identity_fileTim Smith2018-10-261-5/+1
|\ | | | | Remove the deprecated knife bootstrap --identity-file flag
| * Remove the deprecated knife bootstrap --identity-file flagbootstrap_identity_fileTim Smith2018-08-131-5/+1
| | | | | | | | | | | | Remove this deprecated flag Signed-off-by: Tim Smith <tsmith@chef.io>
* | better docs for Chef::Knife::Bootstrap#validate_options!Alexandre IGNJATOVIC2018-10-041-1/+7
| | | | | | | | Signed-off-by: Alexandre Ignjatovic <alexandre.ignjatovic@gmail.com>