Class: Fhcap::Tasks::Chef::Server::Info

Inherits:
ChefServerTask show all
Defined in:
lib/fhcap/tasks/chef/server/info.rb

Instance Attribute Summary collapse

Attributes inherited from ChefServerTask

#chef_repo, #chef_server, #repos

Attributes inherited from TaskBase

#config, #options, #thor, #verbose

Instance Method Summary collapse

Methods inherited from ChefServerTask

#local_chef_server?, #with_chef_server

Methods included from KnifeHelper

#chef_server_config_for, #chef_server_config_hash_for, #chef_server_names, #delete_chef_object, #knife_config, #knife_config_dir, #knife_config_file_for, #knife_data_bag_delete, #knife_download, #knife_environment_delete, #knife_upload, #local_chef_server?, #with_chef_server, #with_local_chef_server

Methods inherited from ChefTaskBase

#knife_config_dir, #knife_config_file_for, #run_chef_client_cmd, #run_knife_cmd, #run_knife_ssh_cmd

Methods inherited from TaskBase

#ask_config, #color_pad, #exit_with_error, #set_color, #suppress_stdout, #table_header, #table_row, #with_progress

Methods included from ProvidersHelper

#provider_availability_zones, #provider_config, #provider_credentials, #provider_for, #provider_names, #provider_names_for, #provider_regions, #provider_type, #providers_config

Methods included from ReposHelper

#find_cluster, #find_cluster_pwds, #find_cluster_pwds_with_repo, #find_cluster_with_repo, #find_data_bag, #find_data_bag_item, #find_environment, #find_repo_item, #find_role, #get_cookbook_deps, #get_cookbook_meta, #get_cookbook_versions, #get_cookbooks, #get_dirty_cookbooks, #get_entry_dependencies, #get_modified_cookbooks, #git_diff, #is_dirty?, #modified?, #repo_cfg, #repo_clusters_dir, #repo_cookbook_paths, #repo_dir, #repo_names, #repo_paths, #repos_config, #repos_dir, #run_inside_repo_dir

Methods included from FhcapHelper

#cluster_template_names

Constructor Details

#initialize(options) ⇒ Info

Returns a new instance of Info.



11
12
13
14
15
16
17
18
# File 'lib/fhcap/tasks/chef/server/info.rb', line 11

def initialize(options)
  super
  @environments = options[:environments]
  @node_names = options[:nodes]
  @roles = options[:roles]
  @urls = {}
  @cluster_data = {}
end

Instance Attribute Details

#cluster_dataObject (readonly)

Returns the value of attribute cluster_data.



9
10
11
# File 'lib/fhcap/tasks/chef/server/info.rb', line 9

def cluster_data
  @cluster_data
end

#environmentsObject (readonly)

Returns the value of attribute environments.



9
10
11
# File 'lib/fhcap/tasks/chef/server/info.rb', line 9

def environments
  @environments
end

#node_namesObject (readonly)

Returns the value of attribute node_names.



9
10
11
# File 'lib/fhcap/tasks/chef/server/info.rb', line 9

def node_names
  @node_names
end

#rolesObject (readonly)

Returns the value of attribute roles.



9
10
11
# File 'lib/fhcap/tasks/chef/server/info.rb', line 9

def roles
  @roles
end

#urlsObject (readonly)

Returns the value of attribute urls.



9
10
11
# File 'lib/fhcap/tasks/chef/server/info.rb', line 9

def urls
  @urls
end

Instance Method Details

#runObject



20
21
22
23
24
25
26
27
28
# File 'lib/fhcap/tasks/chef/server/info.rb', line 20

def run
  thor.say "Chef::Server::Info: environments = #{environments}", :yellow
  with_chef_server do
    environments.each do |env|
      ip_addresses(env) unless options[:only] && options[:only] != 'ips'
      management_dashboards(env) unless options[:only] && options[:only] != 'urls'
    end
  end
end