dev-lxc 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +12 -6
- data/files/configs/standalone.yml +3 -3
- data/files/configs/tier.yml +3 -3
- data/lib/dev-lxc/cli.rb +2 -2
- data/lib/dev-lxc/cluster.rb +32 -24
- data/lib/dev-lxc/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 864064b9723364e779abf93415aa8cbf64f9f743
|
4
|
+
data.tar.gz: 6d969f2f41568feda063c4baa2e1161fe797e4d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
##
|
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
|
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.
|
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:
|
data/files/configs/tier.yml
CHANGED
@@ -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
|
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, :
|
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|
|
data/lib/dev-lxc/cluster.rb
CHANGED
@@ -7,45 +7,49 @@ module DevLXC
|
|
7
7
|
def initialize(cluster_config)
|
8
8
|
@cluster_config = cluster_config
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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."
|
data/lib/dev-lxc/version.rb
CHANGED