Class: Fhcap::Tasks::Chef::ChefServerTask
- Inherits:
-
ChefTaskBase
- Object
- TaskBase
- ChefTaskBase
- Fhcap::Tasks::Chef::ChefServerTask
- Includes:
- KnifeHelper
- Defined in:
- lib/fhcap/tasks/chef/chef_server_task.rb
Direct Known Subclasses
Environments::Destroy, Provisioning::ChefProvisioningTaskBase, Server::Bootstrap, Server::Info, Server::Provision
Instance Attribute Summary collapse
-
#chef_repo ⇒ Object
readonly
Returns the value of attribute chef_repo.
-
#chef_server ⇒ Object
readonly
Returns the value of attribute chef_server.
-
#repos ⇒ Object
readonly
Returns the value of attribute repos.
Attributes inherited from TaskBase
#config, #options, #thor, #verbose
Instance Method Summary collapse
-
#initialize(options) ⇒ ChefServerTask
constructor
A new instance of ChefServerTask.
- #local_chef_server? ⇒ Boolean
- #with_chef_server(&block) ⇒ Object
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, #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
Constructor Details
#initialize(options) ⇒ ChefServerTask
Returns a new instance of ChefServerTask.
13 14 15 16 17 18 |
# File 'lib/fhcap/tasks/chef/chef_server_task.rb', line 13 def initialize() super @chef_server = [:'chef-server'] @chef_repo = [:'chef-repo'] @repos = [:repos] end |
Instance Attribute Details
#chef_repo ⇒ Object (readonly)
Returns the value of attribute chef_repo.
11 12 13 |
# File 'lib/fhcap/tasks/chef/chef_server_task.rb', line 11 def chef_repo @chef_repo end |
#chef_server ⇒ Object (readonly)
Returns the value of attribute chef_server.
11 12 13 |
# File 'lib/fhcap/tasks/chef/chef_server_task.rb', line 11 def chef_server @chef_server end |
#repos ⇒ Object (readonly)
Returns the value of attribute repos.
11 12 13 |
# File 'lib/fhcap/tasks/chef/chef_server_task.rb', line 11 def repos @repos end |
Instance Method Details
#local_chef_server? ⇒ Boolean
29 30 31 |
# File 'lib/fhcap/tasks/chef/chef_server_task.rb', line 29 def local_chef_server? chef_server && chef_server == 'local' end |
#with_chef_server(&block) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/fhcap/tasks/chef/chef_server_task.rb', line 20 def with_chef_server(&block) ::Chef::Config.solo = false if local_chef_server? with_local_chef_server(repo_dir(@chef_repo), &block) else block.call end end |