<commit_before># Author:: <NAME> (<<EMAIL>>)
# Author:: <NAME> (<<EMAIL>>)
#
# Copyright:: Copyright (c) 2013 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'chef/knife/winrm_base'
require 'chef/knife/core/bootstrap_context'
require 'net/ssh/multi'

class Chef
  class Knife
    class Cloud
      # Ideally chef/knife/bootstap should expose this as module.
      module BootstrapOptions

        def self.included(includer)
          includer.class_eval do

            deps do
              require 'chef/json_compat'
              require 'tempfile'
              require 'highline'
              require 'net/ssh'
              require 'chef/knife/ssh'
              Chef::Knife::Ssh.load_deps
            end

            include Chef::Knife::WinrmBase

            option :ssh_user,
              :short => "-x USERNAME",
              :long => "--ssh-user USERNAME",
              :description => "The ssh username",
              :default => "root"

            option :ssh_password,
              :short => "-P PASSWORD",
              :long => "--ssh-password PASSWORD",
              :description => "The ssh password"

            option :ssh_port,
              :short => "-p PORT",
              :long => "--ssh-port PORT",
              :description => "The ssh port",
              :proc => Proc.new { |key| Chef::Config[:knife][:ssh_port] = key },
              :default => "22"

            option :ssh_gateway,
              :long => "--ssh-gateway GATEWAY",
              :description => "The ssh gateway server. Any proxies configured in your ssh config are automatically used by default.",
              :proc => Proc.new { |key| Chef::Config[:knife][:ssh_gateway] = key }

            option :ssh_gateway_identity,
              :long => "--ssh-gateway-identity IDENTITY_FILE",
              :description => "The private key for ssh gateway server",
              :proc => Proc.new { |key| Chef::Config[:knife][:ssh_gateway_identity] = key }

            option :forward_agent,
              :long => "--forward-agent",
              :description => "Enable SSH agent forwarding",
              :boolean => true

            option :identity_file,
              :short => "-i IDENTITY_FILE",
              :long => "--identity-file IDENTITY_FILE",
              :description => "The SSH identity file used for authentication"

            option :chef_node_name,
              :short => "-N NAME",
              :long => "--node-name NAME",
              :description => "The Chef node name for your new node"

            option :prerelease,
              :long => "--prerelease",
              :description => "Install the pre-release chef gems"

            option :bootstrap_version,
              :long => "--bootstrap-version VERSION",
              :description => "The version of Chef to install",
              :proc => lambda { |v| Chef::Config[:knife][:bootstrap_version] = v }

            option :bootstrap_proxy,
              :long => "--bootstrap-proxy PROXY_URL",
              :description => "The proxy server for the node being bootstrapped",
              :proc => Proc.new { |p| Chef::Config[:knife][:bootstrap_proxy] = p }

            option :bootstrap_no_proxy,
              :long => "--bootstrap-no-proxy [NO_PROXY_URL|NO_PROXY_IP]",
              :description => "Do not proxy locations for the node being bootstrapped; this option is used internally by Opscode",
              :proc => Proc.new { |np| Chef::Config[:knife][:bootstrap_no_proxy] = np }

            option :distro,
              :short => "-d DISTRO",
              :long => "--distro DISTRO",
              :description => "Bootstrap a distro using a template"

            option :use_sudo,
              :long => "--sudo",
              :description => "Execute the bootstrap via sudo",
              :boolean => true

            option :use_sudo_password,
              :long => "--use-sudo-password",
              :description => "Execute the bootstrap via sudo with password",
              :boolean => false

            option :template_file,
              :long => "--template-file TEMPLATE",
              :description => "Full path to location of template to use",
              :proc => Proc.new { |t| Chef::Config[:knife][:template_file] = t },
              :default => false

            option :run_list,
              :short => "-r RUN_LIST",
              :long => "--run-list RUN_LIST",
              :description => "Comma separated list of roles/recipes to apply",<commit_msg>Added deprication warning for distro and template_file options<commit_after># Author:: <NAME> (<<EMAIL>>)
# Author:: <NAME> (<<EMAIL>>)
#
# Copyright:: Copyright (c) 2013 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'chef/knife/winrm_base'
require 'chef/knife/core/bootstrap_context'
require 'net/ssh/multi'

class Chef
  class Knife
    class Cloud
      # Ideally chef/knife/bootstap should expose this as module.
      module BootstrapOptions

        def self.included(includer)
          includer.class_eval do

            deps do
              require 'chef/json_compat'
              require 'tempfile'
              require 'highline'
              require 'net/ssh'
              require 'chef/knife/ssh'
              Chef::Knife::Ssh.load_deps
            end

            include Chef::Knife::WinrmBase

            option :ssh_user,
              :short => "-x USERNAME",
              :long => "--ssh-user USERNAME",
              :description => "The ssh username",
              :default => "root"

            option :ssh_password,
              :short => "-P PASSWORD",
              :long => "--ssh-password PASSWORD",
              :description => "The ssh password"

            option :ssh_port,
              :short => "-p PORT",
              :long => "--ssh-port PORT",
              :description => "The ssh port",
              :proc => Proc.new { |key| Chef::Config[:knife][:ssh_port] = key },
              :default => "22"

            option :ssh_gateway,
              :long => "--ssh-gateway GATEWAY",
              :description => "The ssh gateway server. Any proxies configured in your ssh config are automatically used by default.",
              :proc => Proc.new { |key| Chef::Config[:knife][:ssh_gateway] = key }

            option :ssh_gateway_identity,
              :long => "--ssh-gateway-identity IDENTITY_FILE",
              :description => "The private key for ssh gateway server",
              :proc => Proc.new { |key| Chef::Config[:knife][:ssh_gateway_identity] = key }

            option :forward_agent,
              :long => "--forward-agent",
              :description => "Enable SSH agent forwarding",
              :boolean => true

            option :identity_file,
              :short => "-i IDENTITY_FILE",
              :long => "--identity-file IDENTITY_FILE",
              :description => "The SSH identity file used for authentication"

            option :chef_node_name,
              :short => "-N NAME",
              :long => "--node-name NAME",
              :description => "The Chef node name for your new node"

            option :prerelease,
              :long => "--prerelease",
              :description => "Install the pre-release chef gems"

            option :bootstrap_version,
              :long => "--bootstrap-version VERSION",
              :description => "The version of Chef to install",
              :proc => lambda { |v| Chef::Config[:knife][:bootstrap_version] = v }

            option :bootstrap_proxy,
              :long => "--bootstrap-proxy PROXY_URL",
              :description => "The proxy server for the node being bootstrapped",
              :proc => Proc.new { |p| Chef::Config[:knife][:bootstrap_proxy] = p }

            option :bootstrap_no_proxy,
              :long => "--bootstrap-no-proxy [NO_PROXY_URL|NO_PROXY_IP]",
              :description => "Do not proxy locations for the node being bootstrapped; this option is used internally by Opscode",
              :proc => Proc.new { |np| Chef::Config[:knife][:bootstrap_no_proxy] = np }

            option :distro,
              :short => "-d DISTRO",
              :long => "--distro DISTRO",
              :description => "Bootstrap a distro using a template. [DEPRECATED] Use -t / --template option instead.",
              :proc => Proc.new { |t|
                Chef::Log.warn("[DEPRECATED] -d / --distro option is deprecated. Use -t / --template option instead.")
                Chef::Config[:knife][:bootstrap_template] = t
              }

            option :bootstrap_template,
              :short => "-t TEMPLATE",
              :long => "--bootstrap-template TEMPLATE",
              :description => "Bootstrap Chef using a built-in or custom template. Set to the full path of an erb template or use one of the built-in templates."

            option :use_sudo,
              :long => "--sudo",
              :description => "Execute the bootstrap via sudo",
              :boolean => true

            option :use_sudo_password,
              :long => "--use-sudo-password",
              :description => "Execute the bootstrap via sudo with password",
              :boolean => false

            option :template_file,
              :long => "--template-file TEMPLATE",
              :description => "Full path to location of template to use. [DEPRECATED] Use -t / --bootstrap-template option instead.",
              :proc        => Proc.new { |v|
                Chef::Log.warn("[DEPRECATED] --template-file option is deprecated. Use -t / --bootstrap-template option instead.")
                v
              }

            option :run_list,
              :short => "-r RUN_LIST",
              :long => "--run-list RUN_LIST",
              :description => "Comma separated list of roles/recipes to apply",
{'fraction_non_alphanumeric': 0.11781372817841149, 'fraction_numerical': 0.0021935837674801205, 'mean_word_length': 1.887071240105541, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 126, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '252441', 'n_tokens_mistral': 2991, 'n_tokens_neox': 2802, 'n_words': 918}