dev-lxc 3.2.0 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitattributes +1 -0
- data/.gitignore +17 -17
- data/CHANGELOG.md +352 -342
- data/Gemfile +4 -4
- data/LICENSE +201 -201
- data/README.md +235 -233
- data/Rakefile +1 -1
- data/bin/dl +9 -9
- data/dev-lxc.gemspec +26 -26
- data/docs/adhoc_clusters.md +17 -20
- data/docs/base_containers.md +44 -44
- data/docs/byobu_keybindings.md +22 -22
- data/docs/configuration.md +277 -235
- data/docs/dev-lxc_version_2.md +10 -10
- data/docs/manage_multiple_clusters.md +30 -30
- data/docs/mitmproxy.md +7 -7
- data/docs/usage.md +213 -213
- data/example-clusters/README.md +165 -35
- data/example-clusters/automate_dev-lxc.yml +98 -98
- data/example-clusters/chef-backend_dev-lxc.yml +81 -81
- data/example-clusters/conf-files/chef-server/elasticsearch-partial.rb +38 -0
- data/example-clusters/conf-files/chef-server/ldap-partial.rb +10 -0
- data/example-clusters/conf-files/chef-server/postgres-partial.rb +14 -0
- data/example-clusters/external_dev-lxc.yml +60 -0
- data/example-clusters/tier_dev-lxc.yml +88 -88
- data/lib/dev-lxc/cli.rb +542 -537
- data/lib/dev-lxc/cluster.rb +1310 -1215
- data/lib/dev-lxc/container.rb +128 -123
- data/lib/dev-lxc/server.rb +197 -197
- data/lib/dev-lxc/version.rb +3 -3
- data/lib/dev-lxc.rb +118 -118
- metadata +7 -2
data/docs/base_containers.md
CHANGED
@@ -1,44 +1,44 @@
|
|
1
|
-
### Base Containers
|
2
|
-
|
3
|
-
The container that is used as the base container for a cluster's containers must exist before
|
4
|
-
the cluster can be built. The cluster's containers are cloned from the base container using
|
5
|
-
the btrfs filesystem to very quickly provide a lightweight duplicate of the container.
|
6
|
-
|
7
|
-
This container provides the chosen OS platform and version (e.g. b-ubuntu-1404).
|
8
|
-
|
9
|
-
A typical LXC container has minimal packages installed so `dev-lxc` makes sure that the
|
10
|
-
same packages used in Chef's [bento boxes](https://github.com/opscode/bento) are
|
11
|
-
installed to provide a more typical server environment.
|
12
|
-
A few additional packages are also installed.
|
13
|
-
|
14
|
-
Base containers have openssh-server installed and running with unique SSH Host Keys.
|
15
|
-
|
16
|
-
Base containers have a "dev-lxc" user with "dev-lxc" password and passwordless sudo.
|
17
|
-
|
18
|
-
*Once this base container is created there is rarely a need to delete it.*
|
19
|
-
|
20
|
-
### Create a dev-lxc Base Container
|
21
|
-
|
22
|
-
dev-lxc is able to create base containers that have openssh-server installed and running with unique SSH Host Keys.
|
23
|
-
|
24
|
-
dev-lxc base containers have a "dev-lxc" user with "dev-lxc" password and passwordless sudo.
|
25
|
-
|
26
|
-
You can see a menu of base containers that `dev-lxc` can create by using the following command.
|
27
|
-
|
28
|
-
```
|
29
|
-
dl create-base-container
|
30
|
-
```
|
31
|
-
|
32
|
-
The initial creation of base containers can take awhile so let's go ahead and start creating
|
33
|
-
an Ubuntu 14.04 container now.
|
34
|
-
|
35
|
-
```
|
36
|
-
dl create-base-container b-ubuntu-1404
|
37
|
-
```
|
38
|
-
|
39
|
-
Note: It is possible to pass additional arguments to the underlying LXC create command.
|
40
|
-
For example:
|
41
|
-
|
42
|
-
```
|
43
|
-
dl create-base-container b-ubuntu-1404 -o -- '--no-validate --keyserver http://my.key.server.com'
|
44
|
-
```
|
1
|
+
### Base Containers
|
2
|
+
|
3
|
+
The container that is used as the base container for a cluster's containers must exist before
|
4
|
+
the cluster can be built. The cluster's containers are cloned from the base container using
|
5
|
+
the btrfs filesystem to very quickly provide a lightweight duplicate of the container.
|
6
|
+
|
7
|
+
This container provides the chosen OS platform and version (e.g. b-ubuntu-1404).
|
8
|
+
|
9
|
+
A typical LXC container has minimal packages installed so `dev-lxc` makes sure that the
|
10
|
+
same packages used in Chef's [bento boxes](https://github.com/opscode/bento) are
|
11
|
+
installed to provide a more typical server environment.
|
12
|
+
A few additional packages are also installed.
|
13
|
+
|
14
|
+
Base containers have openssh-server installed and running with unique SSH Host Keys.
|
15
|
+
|
16
|
+
Base containers have a "dev-lxc" user with "dev-lxc" password and passwordless sudo.
|
17
|
+
|
18
|
+
*Once this base container is created there is rarely a need to delete it.*
|
19
|
+
|
20
|
+
### Create a dev-lxc Base Container
|
21
|
+
|
22
|
+
dev-lxc is able to create base containers that have openssh-server installed and running with unique SSH Host Keys.
|
23
|
+
|
24
|
+
dev-lxc base containers have a "dev-lxc" user with "dev-lxc" password and passwordless sudo.
|
25
|
+
|
26
|
+
You can see a menu of base containers that `dev-lxc` can create by using the following command.
|
27
|
+
|
28
|
+
```
|
29
|
+
dl create-base-container
|
30
|
+
```
|
31
|
+
|
32
|
+
The initial creation of base containers can take awhile so let's go ahead and start creating
|
33
|
+
an Ubuntu 14.04 container now.
|
34
|
+
|
35
|
+
```
|
36
|
+
dl create-base-container b-ubuntu-1404
|
37
|
+
```
|
38
|
+
|
39
|
+
Note: It is possible to pass additional arguments to the underlying LXC create command.
|
40
|
+
For example:
|
41
|
+
|
42
|
+
```
|
43
|
+
dl create-base-container b-ubuntu-1404 -o -- '--no-validate --keyserver http://my.key.server.com'
|
44
|
+
```
|
data/docs/byobu_keybindings.md
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
## byobu keybindings
|
2
|
-
|
3
|
-
byobu makes it easy to manage multiple terminal windows and panes. You can press `F1` to get help which includes a [list of keybindings](http://manpages.ubuntu.com/manpages/wily/en/man1/byobu.1.html#contenttoc8).
|
4
|
-
|
5
|
-
`C-` refers to the keyboard's `Control` key.
|
6
|
-
`M-` refers to the keyboard's `Meta` key which is the `Alt` key on a PC keyboard and the `Option` key on an Apple keyboard.
|
7
|
-
|
8
|
-
The prefix key is set to `C-o`
|
9
|
-
|
10
|
-
Some of the keyboard shortcuts that will be most useful to you are:
|
11
|
-
|
12
|
-
* `M-Up`, `M-Down` - switch between byobu sessions
|
13
|
-
* `M-Left`, `M-Right` - switch between windows in a session
|
14
|
-
* `shift-Left`, `shift-Right`, `shift-Up`, `shift-Down` - switch between panes in a window
|
15
|
-
* Windows users using Conemu must first disable "Start selection with Shift+Arrow" in "Mark/Copy" under the "Keys & Macro" settings
|
16
|
-
* `C-o C-s` - synchronize panes
|
17
|
-
* `C-o z` - zoom into and out of a pane
|
18
|
-
* `C-o M-1` - evenly split panes horizontally
|
19
|
-
* `C-o M-2` - evenly split panes vertically
|
20
|
-
* `M-pageup`, `M-pagedown` - page up/down in scrollback
|
21
|
-
|
22
|
-
Note: `Shift-F2` does not create horizontal splits for Windows users. Use the `C-o |` key binding instead.
|
1
|
+
## byobu keybindings
|
2
|
+
|
3
|
+
byobu makes it easy to manage multiple terminal windows and panes. You can press `F1` to get help which includes a [list of keybindings](http://manpages.ubuntu.com/manpages/wily/en/man1/byobu.1.html#contenttoc8).
|
4
|
+
|
5
|
+
`C-` refers to the keyboard's `Control` key.
|
6
|
+
`M-` refers to the keyboard's `Meta` key which is the `Alt` key on a PC keyboard and the `Option` key on an Apple keyboard.
|
7
|
+
|
8
|
+
The prefix key is set to `C-o`
|
9
|
+
|
10
|
+
Some of the keyboard shortcuts that will be most useful to you are:
|
11
|
+
|
12
|
+
* `M-Up`, `M-Down` - switch between byobu sessions
|
13
|
+
* `M-Left`, `M-Right` - switch between windows in a session
|
14
|
+
* `shift-Left`, `shift-Right`, `shift-Up`, `shift-Down` - switch between panes in a window
|
15
|
+
* Windows users using Conemu must first disable "Start selection with Shift+Arrow" in "Mark/Copy" under the "Keys & Macro" settings
|
16
|
+
* `C-o C-s` - synchronize panes
|
17
|
+
* `C-o z` - zoom into and out of a pane
|
18
|
+
* `C-o M-1` - evenly split panes horizontally
|
19
|
+
* `C-o M-2` - evenly split panes vertically
|
20
|
+
* `M-pageup`, `M-pagedown` - page up/down in scrollback
|
21
|
+
|
22
|
+
Note: `Shift-F2` does not create horizontal splits for Windows users. Use the `C-o |` key binding instead.
|
data/docs/configuration.md
CHANGED
@@ -1,235 +1,277 @@
|
|
1
|
-
### dev-lxc.yml Config Files
|
2
|
-
|
3
|
-
dev-lxc uses a YAML configuration file named `dev-lxc.yml` to define a cluster.
|
4
|
-
|
5
|
-
The `init` command generates sample config files for various server types. You can run `dl help init` to see the many types of server configurations that can be generated.
|
6
|
-
|
7
|
-
The `--base-container` option can be used to set the type of base container you want used in the generated configuration.
|
8
|
-
|
9
|
-
The `--product-versions` option can be used to set the package channel and version to use for multiple products. If a version is not specified then it will default to `latest`. If `none` is used then that product will be removed from the generated configuration.
|
10
|
-
|
11
|
-
For example, the following command will generate a configuration for a standalone Chef Server that uses the `b-centos-7` base container and install chef-server 12.13.0 from the `stable` channel, the latest version of manage from the `current` channel and remove the reporting product.
|
12
|
-
|
13
|
-
```
|
14
|
-
dl init --chef --base-container b-centos-7 --product-versions chef-server:stable:12.13.0 manage:current reporting:none
|
15
|
-
```
|
16
|
-
|
17
|
-
Let's generate a config for a cluster with a standalone Chef Server, Supermarket server,
|
18
|
-
Compliance server, Chef Automate server and a Job Dispatch Runner and remove the "reporting" product from the generated configuration.
|
19
|
-
|
20
|
-
```
|
21
|
-
dl init --chef --compliance --supermarket --automate --runners --product-versions reporting:none > dev-lxc.yml
|
22
|
-
```
|
23
|
-
|
24
|
-
We can easily append additional configurations to this file. For example, the following command appends an infrastructure node.
|
25
|
-
|
26
|
-
```
|
27
|
-
dl init --nodes -a >> /root/work/clusters/automate/dev-lxc.yml
|
28
|
-
```
|
29
|
-
|
30
|
-
The contents of `dev-lxc.yml` should look like this.
|
31
|
-
|
32
|
-
```
|
33
|
-
# enable_build_snapshots automatically makes container snapshots at key times during the build process
|
34
|
-
# default value is `true`
|
35
|
-
#enable_build_snapshots: true
|
36
|
-
|
37
|
-
# base_container must be the name of an existing container
|
38
|
-
base_container: b-ubuntu-1404
|
39
|
-
|
40
|
-
# memory_per_server sets the maximum amount of user memory (including file cache) for each server.
|
41
|
-
# dev-lxc will set the `memory.limit_in_bytes` cgroup for each server to apply this limit.
|
42
|
-
# If no units are specified, the value is interpreted as bytes.
|
43
|
-
# You can use suffixes to represent larger units - k or K for kilobytes, m or M for megabytes, and g or G for gigabytes.
|
44
|
-
# The default behavior is that no limit is set.
|
45
|
-
#memory_per_server: 4G
|
46
|
-
|
47
|
-
# list any host directories you want mounted into the servers
|
48
|
-
#mounts:
|
49
|
-
# - /root/clusters root/clusters
|
50
|
-
|
51
|
-
# list any SSH public keys you want added to /home/dev-lxc/.ssh/authorized_keys
|
52
|
-
#ssh-keys:
|
53
|
-
# - /root/clusters/id_rsa.pub
|
54
|
-
|
55
|
-
# DHCP reserved (static) IPs must be selected from the IP range 10.0.3.150 - 254
|
56
|
-
|
57
|
-
chef-server:
|
58
|
-
users: # a user's password will be the same as its username
|
59
|
-
- mary-admin
|
60
|
-
- joe-user
|
61
|
-
orgs:
|
62
|
-
demo:
|
63
|
-
admins:
|
64
|
-
- mary-admin
|
65
|
-
non-admins:
|
66
|
-
- joe-user
|
67
|
-
servers:
|
68
|
-
chef.lxc:
|
69
|
-
ipaddress: 10.0.3.203
|
70
|
-
products:
|
71
|
-
chef-server:
|
72
|
-
channel: stable
|
73
|
-
version: latest
|
74
|
-
manage:
|
75
|
-
channel: stable
|
76
|
-
version: latest
|
77
|
-
push-jobs-server:
|
78
|
-
channel: stable
|
79
|
-
version: latest
|
80
|
-
|
81
|
-
compliance:
|
82
|
-
admin_user: admin # the password will be the same as the username
|
83
|
-
servers:
|
84
|
-
compliance.lxc:
|
85
|
-
ipaddress: 10.0.3.205
|
86
|
-
products:
|
87
|
-
compliance:
|
88
|
-
channel: stable
|
89
|
-
version: latest
|
90
|
-
|
91
|
-
supermarket:
|
92
|
-
servers:
|
93
|
-
supermarket.lxc:
|
94
|
-
ipaddress: 10.0.3.206
|
95
|
-
products:
|
96
|
-
supermarket:
|
97
|
-
channel: stable
|
98
|
-
version: latest
|
99
|
-
|
100
|
-
automate:
|
101
|
-
servers:
|
102
|
-
automate.lxc:
|
103
|
-
ipaddress: 10.0.3.200
|
104
|
-
products:
|
105
|
-
automate:
|
106
|
-
channel: stable
|
107
|
-
version: latest
|
108
|
-
license_path: ../delivery.license
|
109
|
-
chef_org: delivery
|
110
|
-
enterprise_name: demo-ent
|
111
|
-
|
112
|
-
runners:
|
113
|
-
servers:
|
114
|
-
runner-1.lxc:
|
115
|
-
products:
|
116
|
-
chefdk: # downloaded only
|
117
|
-
channel: stable
|
118
|
-
version: latest
|
119
|
-
|
120
|
-
nodes:
|
121
|
-
chef_server_url: https://chef.lxc/organizations/demo
|
122
|
-
validation_client_name: demo-validator
|
123
|
-
# comment out or remove the validation_key path to use chef-server keys generated by dev-lxc
|
124
|
-
validation_key: # /path/for/ORG-validator.pem
|
125
|
-
servers:
|
126
|
-
node-1.lxc:
|
127
|
-
products:
|
128
|
-
chef:
|
129
|
-
channel: stable
|
130
|
-
version: latest
|
131
|
-
|
132
|
-
```
|
133
|
-
|
134
|
-
The dev-lxc.yml config file is very customizable. You can add or remove mounts, products or servers,
|
135
|
-
change ip addresses, server names, the base_container and more.
|
136
|
-
|
137
|
-
As you can see there are six server types represented by six servers.
|
138
|
-
|
139
|
-
1. chef-server - chef.lxc
|
140
|
-
2. compliance - compliance.lxc
|
141
|
-
3. supermarket - supermarket.lxc
|
142
|
-
4. automate - automate.lxc
|
143
|
-
5. runners - runner-1.lxc
|
144
|
-
6. nodes - node-1.lxc
|
145
|
-
|
146
|
-
#### Global Settings
|
147
|
-
|
148
|
-
The global settings used by each of the server types are `enable_build_snapshots`, the `base_container`, `memory_per_server`, a list of `mounts` and a list of `ssh-keys`. These settings are described in the config comments.
|
149
|
-
|
150
|
-
Be sure to set `base_container` in the `dev-lxc.yml` to an existing container's name.
|
151
|
-
This container will be cloned to create each container in the cluster.
|
152
|
-
If you don't already have a container to use as a `base_container` then you can follow the instructions in the
|
153
|
-
[Create a dev-lxc Base Container section](https://github.com/jeremiahsnapp/dev-lxc#create-a-dev-lxc-base-container) to create one.
|
154
|
-
|
155
|
-
#### Server Specific Settings
|
156
|
-
|
157
|
-
It is possible to define different values for `enable_build_snapshots`, `base_container`, `memory_per_server`, `mounts` or `ssh-keys` for a particular server type or even for a particular server as you can see in the following snippet.
|
158
|
-
|
159
|
-
```
|
160
|
-
nodes:
|
161
|
-
base_container: b-ubuntu-1404
|
162
|
-
servers:
|
163
|
-
node-1.lxc:
|
164
|
-
base_container: b-centos-6
|
165
|
-
node-2.lxc:
|
166
|
-
```
|
167
|
-
|
168
|
-
IP addresses from the range 10.0.3.150 - 254 can be assigned to the servers. If an IP address
|
169
|
-
is not specified then a dynamic IP address is assigned when the server starts.
|
170
|
-
|
171
|
-
#### mixlib-install Library Automatically Manages a Cache of Product Packages
|
172
|
-
|
173
|
-
dev-lxc uses the [mixlib-install](https://github.com/chef/mixlib-install) library to download Chef products
|
174
|
-
to a cache in `/var/dev-lxc` in the host instance. This cache is automatically mounted into each server when it starts.
|
175
|
-
|
176
|
-
A list of Chef products to be installed can be defined for each server
|
177
|
-
using [product names that mixlib-install understands](https://github.com/chef/mixlib-install/blob/master/PRODUCT_MATRIX.md).
|
178
|
-
|
179
|
-
The channel and version of the product can be defined also.
|
180
|
-
|
181
|
-
Channel can be `current`, `stable` or `unstable` with `stable` as the default.
|
182
|
-
Version can be `latest` or a version number with `latest` as the default.
|
183
|
-
|
184
|
-
For example, the following specifies the `current` channel and version `0.16.1` of the `chefdk` product.
|
185
|
-
|
186
|
-
```
|
187
|
-
nodes:
|
188
|
-
servers:
|
189
|
-
node-1.lxc:
|
190
|
-
products:
|
191
|
-
chefdk:
|
192
|
-
channel: current
|
193
|
-
version: 0.16.1
|
194
|
-
```
|
195
|
-
|
196
|
-
The `package_source` setting can be used to specify a package file on disk.
|
197
|
-
|
198
|
-
```
|
199
|
-
nodes:
|
200
|
-
servers:
|
201
|
-
node-1.lxc:
|
202
|
-
products:
|
203
|
-
chefdk:
|
204
|
-
package_source: /root/chefdk_0.16.1-1_amd64.deb
|
205
|
-
```
|
206
|
-
|
207
|
-
#### Chef Server Orgs/Users
|
208
|
-
|
209
|
-
When defining a Chef Server you can include organizations and users that will be automatically created and associated accordingly.
|
210
|
-
|
211
|
-
####
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
1
|
+
### dev-lxc.yml Config Files
|
2
|
+
|
3
|
+
dev-lxc uses a YAML configuration file named `dev-lxc.yml` to define a cluster.
|
4
|
+
|
5
|
+
The `init` command generates sample config files for various server types. You can run `dl help init` to see the many types of server configurations that can be generated.
|
6
|
+
|
7
|
+
The `--base-container` option can be used to set the type of base container you want used in the generated configuration.
|
8
|
+
|
9
|
+
The `--product-versions` option can be used to set the package channel and version to use for multiple products. If a version is not specified then it will default to `latest`. If `none` is used then that product will be removed from the generated configuration.
|
10
|
+
|
11
|
+
For example, the following command will generate a configuration for a standalone Chef Server that uses the `b-centos-7` base container and install chef-server 12.13.0 from the `stable` channel, the latest version of manage from the `current` channel and remove the reporting product.
|
12
|
+
|
13
|
+
```
|
14
|
+
dl init --chef --base-container b-centos-7 --product-versions chef-server:stable:12.13.0 manage:current reporting:none
|
15
|
+
```
|
16
|
+
|
17
|
+
Let's generate a config for a cluster with a standalone Chef Server, Supermarket server,
|
18
|
+
Compliance server, Chef Automate server and a Job Dispatch Runner and remove the "reporting" product from the generated configuration.
|
19
|
+
|
20
|
+
```
|
21
|
+
dl init --chef --compliance --supermarket --automate --runners --product-versions reporting:none > dev-lxc.yml
|
22
|
+
```
|
23
|
+
|
24
|
+
We can easily append additional configurations to this file. For example, the following command appends an infrastructure node.
|
25
|
+
|
26
|
+
```
|
27
|
+
dl init --nodes -a >> /root/work/clusters/automate/dev-lxc.yml
|
28
|
+
```
|
29
|
+
|
30
|
+
The contents of `dev-lxc.yml` should look like this.
|
31
|
+
|
32
|
+
```
|
33
|
+
# enable_build_snapshots automatically makes container snapshots at key times during the build process
|
34
|
+
# default value is `true`
|
35
|
+
#enable_build_snapshots: true
|
36
|
+
|
37
|
+
# base_container must be the name of an existing container
|
38
|
+
base_container: b-ubuntu-1404
|
39
|
+
|
40
|
+
# memory_per_server sets the maximum amount of user memory (including file cache) for each server.
|
41
|
+
# dev-lxc will set the `memory.limit_in_bytes` cgroup for each server to apply this limit.
|
42
|
+
# If no units are specified, the value is interpreted as bytes.
|
43
|
+
# You can use suffixes to represent larger units - k or K for kilobytes, m or M for megabytes, and g or G for gigabytes.
|
44
|
+
# The default behavior is that no limit is set.
|
45
|
+
#memory_per_server: 4G
|
46
|
+
|
47
|
+
# list any host directories you want mounted into the servers
|
48
|
+
#mounts:
|
49
|
+
# - /root/clusters root/clusters
|
50
|
+
|
51
|
+
# list any SSH public keys you want added to /home/dev-lxc/.ssh/authorized_keys
|
52
|
+
#ssh-keys:
|
53
|
+
# - /root/clusters/id_rsa.pub
|
54
|
+
|
55
|
+
# DHCP reserved (static) IPs must be selected from the IP range 10.0.3.150 - 254
|
56
|
+
|
57
|
+
chef-server:
|
58
|
+
users: # a user's password will be the same as its username
|
59
|
+
- mary-admin
|
60
|
+
- joe-user
|
61
|
+
orgs:
|
62
|
+
demo:
|
63
|
+
admins:
|
64
|
+
- mary-admin
|
65
|
+
non-admins:
|
66
|
+
- joe-user
|
67
|
+
servers:
|
68
|
+
chef.lxc:
|
69
|
+
ipaddress: 10.0.3.203
|
70
|
+
products:
|
71
|
+
chef-server:
|
72
|
+
channel: stable
|
73
|
+
version: latest
|
74
|
+
manage:
|
75
|
+
channel: stable
|
76
|
+
version: latest
|
77
|
+
push-jobs-server:
|
78
|
+
channel: stable
|
79
|
+
version: latest
|
80
|
+
|
81
|
+
compliance:
|
82
|
+
admin_user: admin # the password will be the same as the username
|
83
|
+
servers:
|
84
|
+
compliance.lxc:
|
85
|
+
ipaddress: 10.0.3.205
|
86
|
+
products:
|
87
|
+
compliance:
|
88
|
+
channel: stable
|
89
|
+
version: latest
|
90
|
+
|
91
|
+
supermarket:
|
92
|
+
servers:
|
93
|
+
supermarket.lxc:
|
94
|
+
ipaddress: 10.0.3.206
|
95
|
+
products:
|
96
|
+
supermarket:
|
97
|
+
channel: stable
|
98
|
+
version: latest
|
99
|
+
|
100
|
+
automate:
|
101
|
+
servers:
|
102
|
+
automate.lxc:
|
103
|
+
ipaddress: 10.0.3.200
|
104
|
+
products:
|
105
|
+
automate:
|
106
|
+
channel: stable
|
107
|
+
version: latest
|
108
|
+
license_path: ../delivery.license
|
109
|
+
chef_org: delivery
|
110
|
+
enterprise_name: demo-ent
|
111
|
+
|
112
|
+
runners:
|
113
|
+
servers:
|
114
|
+
runner-1.lxc:
|
115
|
+
products:
|
116
|
+
chefdk: # downloaded only
|
117
|
+
channel: stable
|
118
|
+
version: latest
|
119
|
+
|
120
|
+
nodes:
|
121
|
+
chef_server_url: https://chef.lxc/organizations/demo
|
122
|
+
validation_client_name: demo-validator
|
123
|
+
# comment out or remove the validation_key path to use chef-server keys generated by dev-lxc
|
124
|
+
validation_key: # /path/for/ORG-validator.pem
|
125
|
+
servers:
|
126
|
+
node-1.lxc:
|
127
|
+
products:
|
128
|
+
chef:
|
129
|
+
channel: stable
|
130
|
+
version: latest
|
131
|
+
|
132
|
+
```
|
133
|
+
|
134
|
+
The dev-lxc.yml config file is very customizable. You can add or remove mounts, products or servers,
|
135
|
+
change ip addresses, server names, the base_container and more.
|
136
|
+
|
137
|
+
As you can see there are six server types represented by six servers.
|
138
|
+
|
139
|
+
1. chef-server - chef.lxc
|
140
|
+
2. compliance - compliance.lxc
|
141
|
+
3. supermarket - supermarket.lxc
|
142
|
+
4. automate - automate.lxc
|
143
|
+
5. runners - runner-1.lxc
|
144
|
+
6. nodes - node-1.lxc
|
145
|
+
|
146
|
+
#### Global Settings
|
147
|
+
|
148
|
+
The global settings used by each of the server types are `enable_build_snapshots`, the `base_container`, `memory_per_server`, a list of `mounts` and a list of `ssh-keys`. These settings are described in the config comments.
|
149
|
+
|
150
|
+
Be sure to set `base_container` in the `dev-lxc.yml` to an existing container's name.
|
151
|
+
This container will be cloned to create each container in the cluster.
|
152
|
+
If you don't already have a container to use as a `base_container` then you can follow the instructions in the
|
153
|
+
[Create a dev-lxc Base Container section](https://github.com/jeremiahsnapp/dev-lxc#create-a-dev-lxc-base-container) to create one.
|
154
|
+
|
155
|
+
#### Server Specific Settings
|
156
|
+
|
157
|
+
It is possible to define different values for `enable_build_snapshots`, `base_container`, `memory_per_server`, `mounts` or `ssh-keys` for a particular server type or even for a particular server as you can see in the following snippet.
|
158
|
+
|
159
|
+
```
|
160
|
+
nodes:
|
161
|
+
base_container: b-ubuntu-1404
|
162
|
+
servers:
|
163
|
+
node-1.lxc:
|
164
|
+
base_container: b-centos-6
|
165
|
+
node-2.lxc:
|
166
|
+
```
|
167
|
+
|
168
|
+
IP addresses from the range 10.0.3.150 - 254 can be assigned to the servers. If an IP address
|
169
|
+
is not specified then a dynamic IP address is assigned when the server starts.
|
170
|
+
|
171
|
+
#### mixlib-install Library Automatically Manages a Cache of Product Packages
|
172
|
+
|
173
|
+
dev-lxc uses the [mixlib-install](https://github.com/chef/mixlib-install) library to download Chef products
|
174
|
+
to a cache in `/var/dev-lxc` in the host instance. This cache is automatically mounted into each server when it starts.
|
175
|
+
|
176
|
+
A list of Chef products to be installed can be defined for each server
|
177
|
+
using [product names that mixlib-install understands](https://github.com/chef/mixlib-install/blob/master/PRODUCT_MATRIX.md).
|
178
|
+
|
179
|
+
The channel and version of the product can be defined also.
|
180
|
+
|
181
|
+
Channel can be `current`, `stable` or `unstable` with `stable` as the default.
|
182
|
+
Version can be `latest` or a version number with `latest` as the default.
|
183
|
+
|
184
|
+
For example, the following specifies the `current` channel and version `0.16.1` of the `chefdk` product.
|
185
|
+
|
186
|
+
```
|
187
|
+
nodes:
|
188
|
+
servers:
|
189
|
+
node-1.lxc:
|
190
|
+
products:
|
191
|
+
chefdk:
|
192
|
+
channel: current
|
193
|
+
version: 0.16.1
|
194
|
+
```
|
195
|
+
|
196
|
+
The `package_source` setting can be used to specify a package file on disk.
|
197
|
+
|
198
|
+
```
|
199
|
+
nodes:
|
200
|
+
servers:
|
201
|
+
node-1.lxc:
|
202
|
+
products:
|
203
|
+
chefdk:
|
204
|
+
package_source: /root/chefdk_0.16.1-1_amd64.deb
|
205
|
+
```
|
206
|
+
|
207
|
+
#### Chef Server Orgs/Users
|
208
|
+
|
209
|
+
When defining a Chef Server you can include organizations and users that will be automatically created and associated accordingly.
|
210
|
+
|
211
|
+
#### Specify Chef Server Predefined Full and Partial Configurations
|
212
|
+
|
213
|
+
The following options work for a standalone Chef Server, the backend and frontends of a tier Chef Server cluster and the frontends of a chef-backend HA Chef Server cluster.
|
214
|
+
|
215
|
+
The `chef-server.rb` option can be used to fill a Chef server's chef-server.rb with predefined content from a file.
|
216
|
+
|
217
|
+
The `chef-server.rb_partials` option can be used to append predefined content from multiple files to a Chef server's chef-server.rb file.
|
218
|
+
|
219
|
+
```
|
220
|
+
servers:
|
221
|
+
chef.lxc:
|
222
|
+
chef-server.rb: /path/to/a/full/configuration/file
|
223
|
+
chef-server.rb_partials:
|
224
|
+
- /path/to/a/partial/configuration/file
|
225
|
+
- /path/to/another/partial/configuration/file
|
226
|
+
ipaddress: 10.0.3.203
|
227
|
+
products:
|
228
|
+
chef-server:
|
229
|
+
channel: stable
|
230
|
+
version: latest
|
231
|
+
```
|
232
|
+
|
233
|
+
#### Specify Automate Server Predefined Full and Partial Configurations
|
234
|
+
|
235
|
+
The `delivery.rb` option can be used to fill an Automate server's delivery.rb with predefined content from a file.
|
236
|
+
|
237
|
+
The `delivery.rb_partials` option can be used to append predefined content from multiple files to an Automate server's delivery.rb file.
|
238
|
+
|
239
|
+
```
|
240
|
+
servers:
|
241
|
+
automate.lxc:
|
242
|
+
delivery.rb: /path/to/a/full/configuration/file
|
243
|
+
delivery.rb_partials:
|
244
|
+
- /path/to/a/partial/configuration/file
|
245
|
+
- /path/to/another/partial/configuration/file
|
246
|
+
ipaddress: 10.0.3.200
|
247
|
+
products:
|
248
|
+
automate:
|
249
|
+
channel: stable
|
250
|
+
version: latest
|
251
|
+
```
|
252
|
+
|
253
|
+
#### Automatic Integration Between Servers
|
254
|
+
|
255
|
+
dev-lxc knows how to automatically configure Chef Server standalone, Chef Server tier topology,
|
256
|
+
Chef Server HA 2.0 as well as Chef Automate, Chef Client, Analytics, Compliance and Supermarket.
|
257
|
+
|
258
|
+
If a Chef Automate server, Compliance server, Analytics server or Supermarket server is defined in the same config file as
|
259
|
+
a Chef Server then each server will automatically be integrated with that Chef Server.
|
260
|
+
|
261
|
+
If a node server with Chef Client or Chef DK installed is defined in the same config file as
|
262
|
+
a Chef Server then the Chef Client will automatically be configured to use that Chef Server.
|
263
|
+
|
264
|
+
Alternatively, values for `chef_server_url`, `validation_client_name` and `validation_key` can
|
265
|
+
be set in the config file either for all nodes or for each individual node.
|
266
|
+
|
267
|
+
```
|
268
|
+
nodes:
|
269
|
+
chef_server_url: https://chef.lxc/organizations/demo
|
270
|
+
validation_client_name: demo-validator
|
271
|
+
# comment out or remove the validation_key path to use chef-server keys generated by dev-lxc
|
272
|
+
validation_key: # /path/to/org/validation/key
|
273
|
+
servers:
|
274
|
+
node-1.lxc:
|
275
|
+
products:
|
276
|
+
chef:
|
277
|
+
```
|