| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
| |
|
|
| |
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Force subclasses to use the `config` hash directly.
This should not affect any knife plugins shipping in chef-workstation
since the calls to config_value have already been removed from all of
those plugins. The multiple-argument version of config_value was not
actually used anywhere in those plugins and the single value version
was removed and replaced with accessing the config hash. Since that
was introduced sometime in 15.x when the bootstrap changes went in,
it is not expected that many external knife plugins have picked up
the usage of config_value.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We should highly encourage users to move to validatorless bootstrapping
1) It's more secure
2) It requires less admin work since there no validation key to pass
around or rotate
This also provides an improved message helping the user to move off the
old keys and fixes some bad formatting where the 2nd line was indented
about 40 columns.
Signed-off-by: Tim Smith <tsmith@chef.io>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have issue that are caused by old code before merging of hash values
were done correctly.
The `config` hash correctly merges all options and should always be
used.
Knife plugins should never touch Chef::Config[:knife] values (either
reading or writing from them).
The `knife_config` should be converted to the `config` hash since it
directly accesses Chef::Config[:knife] values.
The `config_value()` helper should no longer be used. Very clearly most
people started to use that when they should just use the config hash
directly. That was intended to be used only when a knife cli option
was being renamed and the former configuration value needed to be
used as well. It has been cargo culted around as the way to access
config values, and that should really stop.
The DataBagSecretOption mixin has been cleaned up so that the cli
options read+write only to the config[:cl_secret] and
config[:cl_secret_file] values. The config file values go into
config[:secret] and config[:secret_file]. The fact that those are
the merged values in the `config` hash doesn't matter since only
the cli should be writing to the first two and only the config
file should be writing to the latter two. I don't know why it was
made so complicated to begin with, but if there's some hidden
chef-11.early backcompat there, then chef-16 deliberately breaks that.
The use of `locate_config_value` helpers in all knife plugins is also
discouraged (but they all implement those themselves), just use the
config hash, which has the correct hash merge ordering. All of those
need to be deleted.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
| |
|
|
|
|
|
|
| |
Legally incredibly dubious, particularly since we don't follow it
strictly as policy, and we have git history instead, which does it right.
This is just a waste of time and a cargo cult.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
| |
|
|
| |
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
| |
|
|
| |
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
| |\
| |
| | |
Fix Bootstrap password prompt
|
| | |
| |
| |
| | |
Signed-off-by: Amol Shinde <amol.shinde@msystechnologies.com>
|
| | |
| |
| |
| |
| |
| | |
- Fix test-case for password prompt.
Signed-off-by: Amol Shinde <amol.shinde@msystechnologies.com>
|
| | |
| |
| |
| | |
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
| | |
| |
| |
| | |
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
| |/
|
|
|
|
|
| |
- rescue the exception and retry with pty: true if host configured with `requiretty`.
- Remove the default pty: true for all node that causes the error in the window and other hosts while detecting the system.
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Layout/MultilineMethodCallBraceLayout
- Layout/ClosingParenthesisIndentation
- Layout/IndentFirstArgument
EnforcedStyle: consistent
- Layout/BlockEndNewline
the first of these autocorrected to horrible looking code which exposed
that we really needed the other three as well, which also cleaned up a
bunch of other terrible looking code.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
| |
|
|
|
|
|
| |
given how many regexps we have with /'s in the match this seems like
a very good one.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
this is using:
Layout/AlignArguments:
Enabled: true
EnforcedStyle: with_fixed_indentation
the default style can use really excessive whitespace. on starting
lines which are already long, it fully indents across to where the
arguments start and then begins the line there.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
|
| |
|
|
|
|
|
|
| |
Deprecation logic is now available in `mixlib-cli`
via `deprecated_option`. Let's use that instead
of keeping our custom deprecation behavior.
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
- Handles "-x" that was used to set "winrm-user" and is now Deprecated.
- Using symmetrical "USERNAME" and "PASSWORD" verbiages while displaying deprecated warnings.
- Added test cases
- Ensured Chefstyle
- Fixes MSYS-1046
Signed-off-by: Nimesh-Msys <nimesh.patni@msystechnologies.com>
|
| |
|
| |
Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
|
| |
|
| |
Signed-off-by: dheerajd-msys <dheeraj.dubey@msystechnologies.com>
|
| |
|
|
|
|
|
|
|
| |
We should only set bootstrap_context.client_pem if we're a validatorless
bootstrap.
Fixes #8534
Signed-off-by: Bryan McLellan <btm@loftninjas.org>
|
| |
|
|
|
|
|
|
| |
This will allow bootstrap to work with systems
that have `requiretty` configured, and is consistent
with the behavior of Chef 14 bootstrap
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This includes a few fixes:
1. properly handle the default value for session_timeout in cases where
merge_config is not called (plugins) to populate defaults.
2. verify that we're using the ssh protoocl before referencing ssh
constants.
3. capture and compare the higher-level Train::Error for the check
to see if we've gotten a missing fingerprint error, instead of using
Train::Transports::SSHFailed which may not be loaded when exception
is being evaluated.
4. Add tests for missing fingerprint behavior
5. do not save session_timeout to Chef::Config[:knife], it was not
referenced as knife config in any location and we're trying to move away
from pushing CLI values into knife config.
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
| |\
| |
| |
| |
| | |
MsysTechnologiesllc/VSingh/bootstrap-session-timeout
Chef 15: Add --session-timeout bootstrap option for both ssh & winrm
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We converted --winrm-session-timeout MINUTES
to --session-timeout SECONDS
If someone is providing a short session timeout, it's possible
that they're doing so based on the flag accepting minutes. We'll warn
them and suggest an alternative so that if things go wrong,
they'll know where to start looking.
We can remove this once we remove the deprecation for
winrm-session-timeout
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
| | |
| |
| |
| |
| |
| |
| | |
We added default value for session-timeout, but the tests
weren't aware of that because config was mocked.
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
| | |
| |
| |
| | |
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
- Add bootstrap option --session-timeout.
- Add wirnrm-session to deprecations.
- Default --session-timeout value is 60 secs(same was added for --winrm-session-timeout).
- Modify existing specs related to old winrm session timeout key and add specs for session timeout.
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
|
| | |
| |
| |
| | |
Signed-off-by: Bryan McLellan <btm@loftninjas.org>
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #8482 by prompting to continue if the host key is not recognized.
This attempts to tell Net:SSH to accept and write the key but it is only
temporarily accepting.
This changes the parameters of --ssh-verify-host-key (which is new) to
take the Net::SSH values, which get passed through by train. This allows
the user more options than only verifying or not.
Signed-off-by: Bryan McLellan <btm@loftninjas.org>
|
| |
|
|
|
|
|
|
|
| |
The bootstrap script is explicitly using /bin/sh.
On some solaris servers the version of /bin/sh exporting environment variables
using "export id=value" fails. The form "id=value export id" does work.
Bootstrap fails when the wrong form is used.
Signed-off-by: markgibbons <mark.gibbons@nordstrom.com>
|
| |
|
|
|
|
|
|
| |
Also updating the transmission of the license acceptance through the
config.rb because that brings it in line with existing patterns
(Test Kitchen).
Signed-off-by: tyler-ball <tball@chef.io>
|
| |
|
|
| |
Signed-off-by: tyler-ball <tball@chef.io>
|
| |\
| |
| | |
Add logic to require acceptannce of the Chef license to run the client
|
| | |
| |
| |
| |
| |
| | |
unstable -> current
Signed-off-by: tyler-ball <tball@chef.io>
|
| | |
| |
| |
| | |
Signed-off-by: tyler-ball <tball@chef.io>
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Because in order to run `chef-client` on the bootstrapped node the user
needs to have accepted the licenses locally. Right now we have commented
out this code because we will enforce it in a different PR.
Signed-off-by: tyler-ball <tball@chef.io>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Updates BootstrapContext and WindowsBootstrapContext to
expect a 'channel' config value instead of a 'prelease' value.
This removes the old behavior of inferring pre-release (current) from
the presence of a fourth version number in the version string (eg
1.2.3.pre) - that was specific to gem installs, and gem installs are not
used in bootstrap.
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
This adds support for deprecating a boolean flag
into a non-boolean value, and uses it to make `--prerelease`
deprecated in favor of `--channel current`. By default,
`channel` is `stable`.
Separately, all deprecated options are now configured
to display at the end of the options list, instead of mixed into
the non-deprecated list.
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
This also updates bootstrap to provide `non_interactive` as an option
to TrainConnector, instead of TrainConnector setting it behind the
scenes. Bootstrap uses non-interactive to ensure that we don't
get net/ssh prompts for password in case of password failure.
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
This replaces TargetHost, and the associated renames/minor updates.
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
When no certs are available, test with an actual empty certs dir.
This works around a problem with the mock where on the Windows
platform, a buried call to Dir.glob is returning the actual certificates
directory content instead of the empty list required for the test.
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
| |
|
|
| |
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
| |
|
|
|
|
|
|
| |
Because we expand the path to the validation key,
the exact match of "/blah" under Windows was failing,
because it expanded to "C:/blah"
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
| |
|
|
| |
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
|