Class: Central::Cli::Stacks::CloudConfigCommand
- Inherits:
-
Clamp::Command
- Object
- Clamp::Command
- Central::Cli::Stacks::CloudConfigCommand
- Defined in:
- lib/central/cli/stacks/cloud_config_command.rb
Instance Method Summary collapse
Methods included from Common
#calculate_filesystem_stats, #calculate_loads, #calculate_mem_used, #find_stack_by_name, #print_stack, #stacks, #to_gigabytes
Methods included from Common
#access_token=, #add_master, #api_url, #api_url=, #clear_current_stack, #client, #current_master, #current_master=, #current_master_index, #current_stack, #current_stack=, #ensure_custom_ssl_ca, #require_api_url, #require_current_stack, #require_token, #reset_client, #save_settings, #settings, #settings_filename
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/central/cli/stacks/cloud_config_command.rb', line 14 def execute require_api_url token = require_token stack = find_stack_by_name(name) abort('Stack not found'.colorize(:red)) unless stack default_dns = docker_bip.split('/')[0] dns_servers = if dns_list.size > 0 [default_dns] + dns_list else [default_dns, '8.8.8.8', '8.8.4.4'] end require 'central/machine/cloud_config/node_generator' generator = Central::Machine::CloudConfig::NodeGenerator.new config = generator.generate( master_uri: api_url, stack_token: stack['token'], peer_interface: peer_interface, dns_servers: dns_servers, docker_bip: docker_bip, version: version ) puts config end |