dev-lxc 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5587c9d2b0002b0c4da9024a5c84b64726dcaf3
4
- data.tar.gz: 6ff40230fdab7aeb5272a52a588abca27608bae5
3
+ metadata.gz: 864064b9723364e779abf93415aa8cbf64f9f743
4
+ data.tar.gz: 6d969f2f41568feda063c4baa2e1161fe797e4d7
5
5
  SHA512:
6
- metadata.gz: 568446f08b6d31503e0e6485de0fa57bd56ccf7e08dbbd27eb8b3e942b681e39ba82897e7a7ca46d629efac9ac7f944279160af9452d72667fefd579a4d401b3
7
- data.tar.gz: 26730281a47f8e35cc6b080a1bddacf28e962e6ea7b930e0e84f912873275b28d1d72d8d7a8eee0c80d0268ee287df9d23ec8f84ab559a435e509f93a0db070c
6
+ metadata.gz: b3eb932287776d238b13e33effdf81579382467b09bff068a3da56c48903be539cc5f02f80e6431d2de96ac3545add1f241c8c4b8d35349c1260e1d3351ac37a
7
+ data.tar.gz: f4569376b362d19c33ed84d177a644230c45556b0b76a95a517927cf710bf917213dbb101188c2e8242e56e428e83e3763f31b68825c68234a6d540227c0f15c
data/README.md CHANGED
@@ -317,28 +317,34 @@ dev-lxc init
317
317
  `dev-lxc init tier > dev-lxc.yml` creates a `dev-lxc.yml` file with the following content:
318
318
 
319
319
  ```
320
- ## Mount source directories must exist in the LXC host
320
+ ## platform_image can be one of the following:
321
+ ## p-centos-5, p-centos-6, p-ubuntu-1204 or p-ubuntu-1404
321
322
 
322
- ## Make sure package paths are correct
323
+ ## Make sure a mount's source directory exists in the LXC host
324
+
325
+ ## Make sure a package's path is correct
323
326
 
324
327
  ## All FQDNs and server names must end with the `.lxc` domain
325
328
 
326
329
  ## DHCP reserved (static) IPs must be selected from the IP range 10.0.3.150 - 254
327
330
 
331
+ ## topology can be one of the following:
332
+ ## standalone, tier or open-source (for the old open source 11 chef server)
333
+
328
334
  chef-server:
329
335
  platform_image: p-ubuntu-1404
330
336
  mounts:
331
337
  - /dev-shared dev-shared
332
338
  packages:
333
- server: /dev-shared/chef-packages/cs/chef-server-core_12.0.6-1_amd64.deb
339
+ server: /dev-shared/chef-packages/cs/chef-server-core_12.0.7-1_amd64.deb
334
340
  manage: /dev-shared/chef-packages/manage/opscode-manage_1.11.2-1_amd64.deb
335
341
  # reporting: /dev-shared/chef-packages/reporting/opscode-reporting_1.2.3-1_amd64.deb
336
342
  # push-jobs-server: /dev-shared/chef-packages/push-jobs-server/opscode-push-jobs-server_1.1.6-1_amd64.deb
337
-
338
- ## The chef-sync package would only be installed.
339
- ## It would NOT be configured since we don't know whether it should be a master or replica.
340
343
  # sync: /dev-shared/chef-packages/sync/chef-sync_1.0.0~rc.6-1_amd64.deb
341
344
 
345
+ ## The chef-sync package will only be installed.
346
+ ## chef-sync will NOT be configured since we don't know whether it should be a master or replica.
347
+
342
348
  api_fqdn: chef.lxc
343
349
  topology: tier
344
350
  servers:
@@ -21,11 +21,11 @@ chef-server:
21
21
  manage: /dev-shared/chef-packages/manage/opscode-manage_1.11.2-1_amd64.deb
22
22
  # reporting: /dev-shared/chef-packages/reporting/opscode-reporting_1.2.3-1_amd64.deb
23
23
  # push-jobs-server: /dev-shared/chef-packages/push-jobs-server/opscode-push-jobs-server_1.1.6-1_amd64.deb
24
-
25
- ## The chef-sync package would only be installed.
26
- ## It would NOT be configured since we don't know whether it should be a master or replica.
27
24
  # sync: /dev-shared/chef-packages/sync/chef-sync_1.0.0~rc.6-1_amd64.deb
28
25
 
26
+ ## The chef-sync package will only be installed.
27
+ ## chef-sync will NOT be configured since we don't know whether it should be a master or replica.
28
+
29
29
  api_fqdn: chef.lxc
30
30
  topology: standalone
31
31
  servers:
@@ -21,11 +21,11 @@ chef-server:
21
21
  manage: /dev-shared/chef-packages/manage/opscode-manage_1.11.2-1_amd64.deb
22
22
  # reporting: /dev-shared/chef-packages/reporting/opscode-reporting_1.2.3-1_amd64.deb
23
23
  # push-jobs-server: /dev-shared/chef-packages/push-jobs-server/opscode-push-jobs-server_1.1.6-1_amd64.deb
24
-
25
- ## The chef-sync package would only be installed.
26
- ## It would NOT be configured since we don't know whether it should be a master or replica.
27
24
  # sync: /dev-shared/chef-packages/sync/chef-sync_1.0.0~rc.6-1_amd64.deb
28
25
 
26
+ ## The chef-sync package will only be installed.
27
+ ## chef-sync will NOT be configured since we don't know whether it should be a master or replica.
28
+
29
29
  api_fqdn: chef.lxc
30
30
  topology: tier
31
31
  servers:
data/lib/dev-lxc/cli.rb CHANGED
@@ -11,7 +11,7 @@ module DevLXC::CLI
11
11
  config ||= "dev-lxc.yml"
12
12
  if ! File.exists?(config)
13
13
  puts "ERROR: Cluster config file `config` does not exist."
14
- puts " Create a `./dev-lxc.yml` file or specify the path using `-c`."
14
+ puts " Create a `./dev-lxc.yml` file or specify the path using `--config`."
15
15
  exit 1
16
16
  end
17
17
  ::DevLXC::Cluster.new(YAML.load(IO.read(config)))
@@ -82,7 +82,7 @@ module DevLXC::CLI
82
82
  end
83
83
 
84
84
  desc "list_images [SERVER_NAME_REGEX]", "List of each servers' images created during the build process"
85
- option :config, :aliases => "-c", :desc => "Specify a cluster's YAML config file. `./dev-lxc.yml` will be used by default"
85
+ option :config, :desc => "Specify a cluster's YAML config file. `./dev-lxc.yml` will be used by default"
86
86
  def list_images(server_name_regex=nil)
87
87
  images = Hash.new { |h,k| h[k] = Hash.new { |h,k| h[k] = Array.new } }
88
88
  match_server_name_regex(server_name_regex).each do |s|
@@ -7,45 +7,49 @@ module DevLXC
7
7
  def initialize(cluster_config)
8
8
  @cluster_config = cluster_config
9
9
 
10
- @chef_server_topology = @cluster_config["chef-server"]["topology"]
11
- @api_fqdn = @cluster_config["chef-server"]["api_fqdn"]
12
- @chef_server_servers = @cluster_config["chef-server"]["servers"]
13
- @chef_server_frontends = Array.new
14
- @chef_server_servers.each do |name, config|
15
- case @chef_server_topology
16
- when 'open-source', 'standalone'
17
- @chef_server_bootstrap_backend = name if config["role"].nil?
18
- when 'tier'
19
- @chef_server_bootstrap_backend = name if config["role"] == "backend" && config["bootstrap"] == true
20
- @chef_server_frontends << name if config["role"] == "frontend"
10
+ if @cluster_config["chef-server"]
11
+ @chef_server_topology = @cluster_config["chef-server"]["topology"]
12
+ @api_fqdn = @cluster_config["chef-server"]["api_fqdn"]
13
+ @chef_server_servers = @cluster_config["chef-server"]["servers"]
14
+ @chef_server_frontends = Array.new
15
+ @chef_server_servers.each do |name, config|
16
+ case @chef_server_topology
17
+ when 'open-source', 'standalone'
18
+ @chef_server_bootstrap_backend = name if config["role"].nil?
19
+ when 'tier'
20
+ @chef_server_bootstrap_backend = name if config["role"] == "backend" && config["bootstrap"] == true
21
+ @chef_server_frontends << name if config["role"] == "frontend"
22
+ end
21
23
  end
22
24
  end
23
25
 
24
- @analytics_topology = @cluster_config["analytics"]["topology"]
25
- @analytics_fqdn = @cluster_config["analytics"]["analytics_fqdn"]
26
- @analytics_servers = @cluster_config["analytics"]["servers"]
27
- @analytics_frontends = Array.new
28
- @analytics_servers.each do |name, config|
29
- case @analytics_topology
30
- when 'standalone'
31
- @analytics_bootstrap_backend = name if config["role"].nil?
32
- when 'tier'
33
- @analytics_bootstrap_backend = name if config["role"] == "backend" && config["bootstrap"] == true
34
- @analytics_frontends << name if config["role"] == "frontend"
26
+ if @cluster_config["analytics"]
27
+ @analytics_topology = @cluster_config["analytics"]["topology"]
28
+ @analytics_fqdn = @cluster_config["analytics"]["analytics_fqdn"]
29
+ @analytics_servers = @cluster_config["analytics"]["servers"]
30
+ @analytics_frontends = Array.new
31
+ @analytics_servers.each do |name, config|
32
+ case @analytics_topology
33
+ when 'standalone'
34
+ @analytics_bootstrap_backend = name if config["role"].nil?
35
+ when 'tier'
36
+ @analytics_bootstrap_backend = name if config["role"] == "backend" && config["bootstrap"] == true
37
+ @analytics_frontends << name if config["role"] == "frontend"
38
+ end
35
39
  end
36
40
  end
37
41
  end
38
42
 
39
43
  def servers
40
44
  chef_servers = Array.new
41
- chef_servers << Server.new(@chef_server_bootstrap_backend, 'chef-server', @cluster_config)
45
+ chef_servers << Server.new(@chef_server_bootstrap_backend, 'chef-server', @cluster_config) if @chef_server_bootstrap_backend
42
46
  if @chef_server_topology == "tier"
43
47
  @chef_server_frontends.each do |frontend_name|
44
48
  chef_servers << Server.new(frontend_name, 'chef-server', @cluster_config)
45
49
  end
46
50
  end
47
51
  analytics_servers = Array.new
48
- analytics_servers << Server.new(@analytics_bootstrap_backend, 'analytics', @cluster_config)
52
+ analytics_servers << Server.new(@analytics_bootstrap_backend, 'analytics', @cluster_config) if @analytics_bootstrap_backend
49
53
  if @analytics_topology == "tier"
50
54
  @analytics_frontends.each do |frontend_name|
51
55
  analytics_servers << Server.new(frontend_name, 'analytics', @cluster_config)
@@ -55,6 +59,10 @@ module DevLXC
55
59
  end
56
60
 
57
61
  def chef_repo
62
+ if @chef_server_bootstrap_backend.nil?
63
+ puts "A bootstrap backend Chef Server is not defined in the cluster's config. Please define it first."
64
+ exit 1
65
+ end
58
66
  chef_server = Server.new(@chef_server_bootstrap_backend, 'chef-server', @cluster_config)
59
67
  if ! chef_server.server.defined?
60
68
  puts "The '#{chef_server.server.name}' Chef Server does not exist. Please create it first."
@@ -1,3 +1,3 @@
1
1
  module DevLXC
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev-lxc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremiah Snapp