summaryrefslogtreecommitdiff
path: root/lib/chef/knife
Commit message (Collapse)AuthorAgeFilesLines
* Match reason :bad_sudo_password for wrong attemptVSingh/fix-sudo-password-errorVivek Singh2020-04-111-2/+2
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Fixes for sudo passwordVivek Singh2020-04-091-2/+12
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Fix typoVivek Singh2020-04-067-8/+8
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Fix missing dist constants in bootstrap logicMarc Chamberland2020-04-032-5/+5
| | | | Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com>
* revert dist constant to hardcoded in default_bootstrap_templateMarc Chamberland2020-04-031-1/+1
| | | | | | | It actually broke third party distros, template name is internal to chef and shouldn't change based on distro. Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com>
* Output to a file instead of stdoutbtm/knife-yamlBryan McLellan2020-03-252-20/+52
| | | | | | | Refactor and direct output to a file with some magic to make up a good output filename. Signed-off-by: Bryan McLellan <btm@loftninjas.org>
* Add a `knife yaml convert` toolBryan McLellan2020-03-251-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Very basic interface, reads in a YAML recipe, ruby recipe goes to stdout. ``` --- resources: - type: "bash" name: "new chef user" code: " touch /tmp/jmc/something ; echo something >> /tmp/jmc/something ; rm -f /tmp/jmc/bash ; " something: - other: "dont use this" ``` gets converted to: ``` bash "new chef user" do code " touch /tmp/jmc/something ; echo something >> /tmp/jmc/something ; rm -f /tmp/jmc/bash ; " end ``` Signed-off-by: Bryan McLellan <btm@loftninjas.org>
* Make sure the ipv4 field is actually thereTim Smith2020-03-062-2/+2
| | | | | | It's should be there, but we might as well Signed-off-by: Tim Smith <tsmith@chef.io>
* Use Ohai's cloud attributes in knife node / status presentersTim Smith2020-03-062-5/+5
| | | | | | | | | | | | | | | | Right now we have a specific case for EC2. This extends the same logic to all clouds by using the node['cloud'] data. This really only changes things if you run knife status with the --long flag. The output doesn't change for EC2 nodes: bundle exec knife status --long 36666 hours ago, smith-0, smith-0, 172.16.1.13, ubuntu 14.04. 7411 hours ago, myhost, ec2-13-59-123-123.us-east-2.compute.amazonaws.com, 13.59.123.123, ubuntu 18.04. 7298 hours ago, tim_test, ec2-34-123-123-2.us-west-2.compute.amazonaws.com, 34.221.123.123, ubuntu 16.04. 7298 hours ago, tim_test2, ec2-52-88-123-123.us-west-2.compute.amazonaws.com, 52.88.123.123, redhat 7.6. Signed-off-by: Tim Smith <tsmith@chef.io>
* Update all our links to use the new docs site formatTim Smith2020-03-043-4/+4
| | | | | | When we migrated to hugo the URLs changed a bit. Nothing ends in .html and we moved all the resources into their own dir. Signed-off-by: Tim Smith <tsmith@chef.io>
* Replace highline.color with pastel.decorateBryan McLellan2020-03-021-1/+9
| | | | | | | | | | Contributes to the removal of the 'heavy' highline dependency (#9359) by switching from highline.color to pastel.decorate, which is a drop-in replacement. Pastel is part of the tty[1] family of libraries. [1] https://github.com/piotrmurach/tty#3-components Signed-off-by: Bryan McLellan <btm@loftninjas.org>
* Merge pull request #9156 from MsysTechnologiesllc/ash/Fix_no_runlist_issueTim Smith2020-02-241-2/+1
|\ | | | | When bootstrapping don't send an empty run_list if we are using policyfiles instead
| * Optimize by using Mash as per review commentsNAshwini2020-02-121-3/+2
| | | | | | | | Signed-off-by: NAshwini <ashwini.nehate@msystechnologies.com>
| * Don't send empty runlist if do not pass it.NAshwini2020-02-121-1/+1
| | | | | | | | Signed-off-by: NAshwini <ashwini.nehate@msystechnologies.com>
* | Merge pull request #9371 from cinc-project/dist_bootstrapTim Smith2020-02-243-19/+19
|\ \ | | | | | | Add distro constants to the bootstrap templates to support non-Chef distros
| * | remove useless interpolation in commentsMarc Chamberland2020-02-041-2/+2
| | | | | | | | | | | | Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com>
| * | Pass distro and platform specific paths into bootstrap templatesMarc Chamberland2020-02-042-17/+17
| | | | | | | | | | | | Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com>
* | | Chefstyle fixes identified with Rubocop 0.80Tim Smith2020-02-181-2/+2
| | | | | | | | | | | | | | | | | | The new Rubocop detects more unnecessary returns. This fixes these ahead of time so we can roll out the new Rubocop engine without breaking builds later. Signed-off-by: Tim Smith <tsmith@chef.io>
* | | Reflecting file_cache_path and file_backup_path value in_client.rbKapil chouhan2020-02-121-0/+8
| |/ |/| | | | | Signed-off-by: Kapil chouhan <kapil.chouhan@msystechnologies.com>
* | Expand the path in knife cookbook upload errorsTim Smith2020-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | WARNING: Could not find any cookbooks in your cookbook path: '/Users/tsmith/dev/work/chef'. Use --cookbook-path to specify the desired path. instead of: WARNING: Could not find any cookbooks in your cookbook path: .. Use --cookbook-path to specify the desired path. Signed-off-by: Tim Smith <tsmith@chef.io>
* | Lazy load as many knife deps as possibleTim Smith2020-02-0623-30/+67
|/ | | | | | | This gets us a small speedup on my mac, and probably a larger speedup on Windows where the loading hurts more. Signed-off-by: Tim Smith <tsmith@chef.io>
* Move knife-acl gem commands into chef in their own namespacesknife_aclTim Smith2020-01-2916-0/+1006
| | | | | | Ship these knife commands so we can kill off knife-acl, but move them under their own namespaces. Signed-off-by: Tim Smith <tsmith@chef.io>
* Update knife status --long to use cloud attributes not ec2 specific attributesstatus_done_rightTim Smith2020-01-282-5/+5
| | | | | | This way we get the public IP / hostname on Azure, GCE, DigitalOcean, Softlayer, etc. Signed-off-by: Tim Smith <tsmith@chef.io>
* Remove the deprecated knife cookbook site commands (#9288)Lamont Granquist2020-01-277-282/+0
|\ | | | | Remove the deprecated knife cookbook site commands
| * Remove the deprecated knife cookbook site commandsTim Smith2020-01-277-282/+0
| | | | | | | | | | | | These have been replaced with knife supermarket commands Signed-off-by: Tim Smith <tsmith@chef.io>
* | [chef-16] Remove the data bag secret short optionVivek Singh2020-01-241-11/+3
|/ | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Deprecated the load method in cookbook_version_loader and added deprecation ↵Vasu11052020-01-221-2/+1
| | | | | | warning for it. Updated code to raise error if cookbook repo has cookbook directory without cookbook files, this is to make sure user should fix their cookbook repo and remove any garbage from cookbook repository and then do bulk upload. Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* MSYS-1142 Fixed nil class error and added check to not call upload for the ↵Vasu11052020-01-221-1/+0
| | | | | | blank cookbooks. Fixes #9010 Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* Merge pull request #9073 from ↵Tim Smith2020-01-161-44/+76
|\ | | | | | | | | MsysTechnologiesllc/vasundhara/generate_metadata_json_while_cookbook_upload Generate metadata.json from metadata.rb if not exist before knife cookbook upload or knife upload or berkshelf upload
| * Added client side validation to validate presence of metadata files and ↵Vasu11052019-12-201-1/+8
| | | | | | | | | | | | validate name field Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
| * Updated code to make sure temporary directory gets deleted after the uploadVasu11052019-12-181-51/+61
| | | | | | | | Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
| * Updated knife cookbook upload and knife upload code to create temporary ↵Vasu11052019-12-161-51/+32
| | | | | | | | | | | | directory and copies all cookbooks into it and then generate metadata.json if it does not exist and load it to upload on Chef server Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
| * Fixed chefstyleVasu11052019-12-161-1/+0
| | | | | | | | Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
| * Genrates metadata.json if not present and uploads it to chef server and ↵Vasu11052019-12-161-8/+43
| | | | | | | | | | | | deletes the local copy of it from chef repo Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
* | Windows Path on Bootstrap (#8669)Xorima2020-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Windows Path on Bootstrap As a windows user when I bootstrap a node I expect the path to not have items removed as my cookbooks may depend on executables not stored on common system paths, such as sqlcmd which will break and cause the initial chef run to fail Signed-off-by: Jason Field <jason@avon-lea.co.uk> * Update windows_bootstrap_context.rb Updated path as per feedback * PATH on windows Fixes for bad copy paste Signed-off-by: Jason Field <jason.field@calastone.com>
* | Use /etc/chef for bootstrapping instead of CONF_DIR (#9226)Lamont Granquist2020-01-162-15/+15
|\ \ | | | | | | Use /etc/chef for bootstrapping instead of CONF_DIR
| * | Use /etc/chef for bootstrapping instead of CONF_DIRmp/CHEF-9224Marc A. Paradise2020-01-162-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONF_DIR is resolved based on the host system running chef-client/knife. When we use it in bootstrap template/context, we need a value based on the target system that is being bootstrapped so that the paths are correct (so that we don't try to create C:\chef on a linux system). Fixes #9224 Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
* | | Use the right class in knife supermarket installlsupermarket_fixTim Smith2020-01-141-1/+1
|/ / | | | | | | | | | | A user on discourse is seeing errors related to this old class. I'm not able to reproduce that failure, but we shouldn't be calling the deprecated class here. Changing this avoids a bogus deprecation warning that tells the user to stop using the legacy command, when they're actually using the new command. Signed-off-by: Tim Smith <tsmith@chef.io>
* | /bootstrap_project/bootstrap_product/sawanoboly2019-12-112-5/+4
| | | | | | | | Signed-off-by: sawanoboly <sawanoboriyu@higanworks.com>
* | use @config to picks up default.sawanoboly2019-12-101-1/+1
| | | | | | | | Signed-off-by: sawanoboly <sawanoboriyu@higanworks.com>
* | add bootstrap_project for install cincsawanoboly2019-11-212-1/+7
|/ | | | | | | | | | | | Signed-off-by: sawanoboly <sawanoboriyu@higanworks.com> Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. Signed-off-by: sawanoboly <sawanoboriyu@higanworks.com> resolv indent Signed-off-by: sawanoboly <sawanoboriyu@higanworks.com>
* Revert "Validate name argument for knife list"Tim Smith2019-11-121-7/+2
| | | | This reverts commit c29b8da2b0353bb5d6e499b5d7cc79c0fadab9b3.
* Validate name argument for knife listVivek Singh2019-11-051-2/+7
| | | | | | |  - Add required specs.  - Raise an error if no argument provided. Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Updates for Chefstyle with Rubocop 0.75.1Tim Smith2019-11-042-2/+2
| | | | | | This update found a few things that should have been triggering before. Signed-off-by: Tim Smith <tsmith@chef.io>
* Fix TypeError: no implicit conversion of nil into StringVivek Singh2019-11-031-1/+2
| | | | | |  - Now showing relevant logs for config.d configuration files. Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Fix knife cookbook metadata from file name argsVivek Singh2019-10-291-0/+6
| | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Merge pull request #9028 from MsysTechnologiesllc/VSingh/fix-knife-ssh-name-argsTim Smith2019-10-271-0/+6
|\ | | | | Fix Exception: NoMethodError: undefined method join for nil:NilClass
| * Fix Exception: NoMethodError: undefined method join for nil:NilClassVivek Singh2019-10-271-0/+6
| | | | | | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* | Fix node show non-existent attributesVivek Singh2019-10-271-1/+1
|/ | | | Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
* Merge pull request #8909 from ↵Tim Smith2019-10-151-4/+11
|\ | | | | | | | | MsysTechnologiesllc/VSingh/remove-secret-short-option [knife] Deprecate data bag secret (-s) short option due to conflict with --server-url option