Class: Bosh::Bootstrap::Microbosh
- Inherits:
-
Object
- Object
- Bosh::Bootstrap::Microbosh
- Includes:
- Cli::Helpers::Bundle, FileUtils
- Defined in:
- lib/bosh-bootstrap/microbosh.rb
Overview
Configures and deploys (or re-deploys) a micro bosh. A “micro bosh” is a single VM containing all necessary parts of bosh and is deployed from the terminal; rather than from another bosh.
Usage:
microbosh = Bosh::Bootstrap::Microbosh.new(project_path)
settings = ReadWriteSettings.new({
"provider" => {"name" => "aws", "credentials" => {...}},
"address" => {"ip" => "1.2.3.4"},
"bosh" => {
"name" => "test-bosh",
"stemcell" => "ami-123456",
"salted_password" => "452435hjg2345hjg2435ghk3452"
}
})
microbosh.deploy("aws", settings)
Instance Attribute Summary collapse
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
-
#bosh_name ⇒ Object
readonly
Returns the value of attribute bosh_name.
-
#deployments_dir ⇒ Object
readonly
Returns the value of attribute deployments_dir.
-
#manifest_yml ⇒ Object
readonly
Returns the value of attribute manifest_yml.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
Instance Method Summary collapse
- #deploy(settings) ⇒ Object
-
#initialize(base_path, provider) ⇒ Microbosh
constructor
A new instance of Microbosh.
Methods included from Cli::Helpers::Bundle
Constructor Details
#initialize(base_path, provider) ⇒ Microbosh
Returns a new instance of Microbosh.
30 31 32 33 |
# File 'lib/bosh-bootstrap/microbosh.rb', line 30 def initialize(base_path, provider) @base_path = base_path @provider = provider end |
Instance Attribute Details
#base_path ⇒ Object (readonly)
Returns the value of attribute base_path.
24 25 26 |
# File 'lib/bosh-bootstrap/microbosh.rb', line 24 def base_path @base_path end |
#bosh_name ⇒ Object (readonly)
Returns the value of attribute bosh_name.
26 27 28 |
# File 'lib/bosh-bootstrap/microbosh.rb', line 26 def bosh_name @bosh_name end |
#deployments_dir ⇒ Object (readonly)
Returns the value of attribute deployments_dir.
27 28 29 |
# File 'lib/bosh-bootstrap/microbosh.rb', line 27 def deployments_dir @deployments_dir end |
#manifest_yml ⇒ Object (readonly)
Returns the value of attribute manifest_yml.
28 29 30 |
# File 'lib/bosh-bootstrap/microbosh.rb', line 28 def manifest_yml @manifest_yml end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
25 26 27 |
# File 'lib/bosh-bootstrap/microbosh.rb', line 25 def provider @provider end |
Instance Method Details
#deploy(settings) ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/bosh-bootstrap/microbosh.rb', line 35 def deploy(settings) @bosh_name = settings.bosh.name @deployments_dir = File.join(base_path, "deployments") @manifest_yml = File.join(deployments_dir, bosh_name, "micro_bosh.yml") mkdir_p(File.dirname(manifest_yml)) chdir(base_path) do create_microbosh_yml(settings) deploy_or_update(settings.bosh.name, settings.bosh.stemcell_path) end end |