You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Remove any old config if you want to make sure you're using the latest
18
-
# defaults
19
-
$ rm -rf ~/.puppetserver
17
+
# Remove any old config if you want to make sure you're using the latest
18
+
# defaults
19
+
$ rm -rf ~/.puppetserver
20
20
21
-
# Run the `dev-setup` script to initialize all required configuration
22
-
$ ./dev-setup
21
+
# Run the `dev-setup` script to initialize all required configuration
22
+
$ ./dev-setup
23
23
24
-
# Launch the clojure REPL
25
-
$ lein repl
26
-
# Run Puppet Server
27
-
dev-tools=> (go)
28
-
dev-tools=> (help)
24
+
# Launch the clojure REPL
25
+
$ lein repl
26
+
# Run Puppet Server
27
+
dev-tools=> (go)
28
+
dev-tools=> (help)
29
+
```
29
30
30
31
You should now have a running server. All relevant paths (`$confdir`, `$codedir`, etc.) are configured by default to point to directories underneath `~/.puppetlabs`. These should all align with the default
31
32
values that `puppet` uses (for non-root users).
@@ -34,34 +35,40 @@ You can find the specific paths in the `dev/puppetserver.conf` file.
34
35
35
36
In another shell, you can run the agent:
36
37
37
-
# Go to the directory where you checked out puppetserver
This will set up all of the necessary configuration files and directories inside of your `~/.puppetlabs` directory. If you are interested in seeing what all of the default file paths are, you can find them in
67
74
`./dev/puppetserver.conf`.
@@ -75,7 +82,7 @@ If you'd like to customize your environment, here are a few things you can do:
75
82
- Create a file called `dev/user.clj`. This file will be automatically loaded when you run Puppet Server from the REPL. In it, you can define a function called `get-config`, and use it to override the default
76
83
values of various settings from `dev/puppetserver.conf`. For an example of what this file should look like, see `./dev/user.clj.sample`.
77
84
78
-
You don't need to create a `user.clj` in most cases; the settings that I change the most frequently that would warrant the creation of this file, though, are:
85
+
You don't need to create a `user.clj` in most cases; settings most likely to warrant it are:
79
86
80
87
-`jruby-puppet.max-active-instances`: the number of JRuby instances to put into the pool. This can usually be set to 1 for dev purposes, unless you're working on something that involves concurrency.
81
88
-`jruby-puppet.splay-instance-flush`: Do not attempt to splay JRuby flushing, set when testing if using multiple JRuby instances and you need to control when they are flushed from the pool
@@ -101,91 +108,109 @@ contains an integrated REPL that can be used in place of the `lein repl` command
101
108
102
109
To start the server from the REPL, run the following:
103
110
104
-
$ lein repl
105
-
nREPL server started on port 47631 on host 127.0.0.1
106
-
dev-tools=> (go)
107
-
dev-tools=> (help)
111
+
```clojure
112
+
$ lein repl
113
+
nREPL server started on port 47631 on host 127.0.0.1
114
+
dev-tools=> (go)
115
+
dev-tools=> (help)
116
+
```
108
117
109
118
Then, if you make changes to the source code, all you need to do in order to restart the server with the latest changes is:
110
119
111
-
dev-tools=> (reset)
120
+
```clojure
121
+
dev-tools=> (reset)
122
+
```
112
123
113
124
Restarting the server this way should be significantly faster than restarting the entire JVM process.
114
125
115
126
You can also run the utility functions to inspect the state of the server, e.g.:
116
127
117
-
dev-tools=> (print-puppet-environment-states)
128
+
```clojure
129
+
dev-tools=> (print-puppet-environment-states)
130
+
```
118
131
119
132
Have a look at `dev-tools.clj` if you're interested in seeing what other utility functions are available.
120
133
121
134
## Step 4b: Run the server from the command line
122
135
123
-
If you prefer not to run the server interactively in the REPL, you can launch it as a normal process. To start the Puppet Server when running from source, simply run the following:
136
+
If you prefer not to run the server interactively in the REPL, you can launch it as a normal process. To start the OpenVox Server when running from source, simply run the following:
124
137
125
-
lein run -c /path/to/puppetserver.conf
138
+
```bash
139
+
lein run -c /path/to/puppetserver.conf
140
+
```
126
141
127
142
## Step 4c: Development environment gotchas
128
143
129
144
## Missing git submodules
130
145
131
146
If you get an error like the following:
132
147
133
-
Execution error (LoadError) at org.jruby.RubyKernel/require
134
-
(org/jruby/RubyKernel.java:970).
135
-
(LoadError) no such file to load -- puppet
148
+
```text
149
+
Execution error (LoadError) at org.jruby.RubyKernel/require
150
+
(org/jruby/RubyKernel.java:970).
151
+
(LoadError) no such file to load -- puppet
152
+
```
136
153
137
154
Then you've probably forgotten to fetch the git submodules.
138
155
139
156
## Failing tests
140
157
141
158
If you change the `:webserver :ssl-port` config option from the default value of `8140`, tests will fail with errors like the following:
142
159
143
-
lein test :only puppetlabs.general-puppet.general-puppet-int-test/test-external-command-execution
144
-
145
-
ERROR in (test-external-command-execution) (SocketChannelImpl.java:-2)
Changing the `ssl-port` variable back to `8140` makes the tests run properly.
160
179
161
180
## Running the Agent
162
181
163
-
Use a command like the one below to run an agent against your running puppetserver:
182
+
Use a command like the one below to run an agent against your running OpenVox Server:
164
183
165
-
puppet agent --confdir ~/.puppetlabs/etc/puppet \
166
-
--debug -t
184
+
```bash
185
+
puppet agent --confdir ~/.puppetlabs/etc/puppet \
186
+
--debug -t
187
+
```
167
188
168
-
Note that a system installed Puppet Agent is ok for use with source-based PuppetDB and Puppet Server. The `--confdir` above specifies the same confdir that Puppet Server is using. Because the Puppet Agent and
169
-
Puppet Server instances are both using the same confdir, they're both using the same certificates as well. This alleviates the need to sign certificates as a separate step.
189
+
Note that a system installed Puppet Agent is ok for use with source-based OpenVoxDB and OpenVox Server. The `--confdir` above specifies the same confdir that OpenVox Server is using. Because the Puppet Agent and
190
+
OpenVox Server instances are both using the same confdir, they're both using the same certificates as well. This alleviates the need to sign certificates as a separate step.
170
191
171
192
## Running the Agent inside a Docker container
172
193
173
-
You can easily run a Puppet Agent inside a Docker container, either by using the `host` network profile or by accessing the Puppetserver service using the Docker host IP:
194
+
You can easily run a Puppet Agent inside a Docker container, either by using the `host` network profile or by accessing the OpenVox Server service using the Docker host IP:
174
195
175
-
docker run -ti \
176
-
--name agent1 \
177
-
puppet/puppet-agent-ubuntu \
178
-
agent -t --server 172.17.0.1
196
+
```bash
197
+
docker run -ti \
198
+
--name agent1 \
199
+
ghcr.io/openvoxproject/openvoxagent:8 \
200
+
agent -t --server 172.17.0.1
179
201
180
-
docker run -ti \
181
-
--name agent2 \
182
-
--network host \
183
-
--add-host puppet:127.0.0.1 \
184
-
puppet/puppet-agent-ubuntu
202
+
docker run -ti \
203
+
--name agent2 \
204
+
--network host \
205
+
--add-host puppet:127.0.0.1 \
206
+
ghcr.io/openvoxproject/openvoxagent:8
207
+
```
185
208
186
209
To start another Puppet Agent run in a previous container you can use the `docker start` command:
187
210
188
-
docker start -a agent1
211
+
```bash
212
+
docker start -a agent1
213
+
```
189
214
190
215
## Running tests
191
216
@@ -198,73 +223,89 @@ arguments for the `:jvm-opts` `defproject` key within the `project.clj` file, it
198
223
199
224
1. An environment variable named `PUPPETSERVER_HEAP_SIZE`. For example, to use a heap size of 6 GiB for a `lein test` run, you could run the following:
200
225
201
-
$ PUPPETSERVER_HEAP_SIZE=6G lein test
226
+
```bash
227
+
PUPPETSERVER_HEAP_SIZE=6G lein test
228
+
```
202
229
203
230
2. A lein `profiles.clj` setting in the `:user` profile under the `:puppetserver-heap-size` key. For example, to use a heap size of 6 GiB, you could add the following key to your `~/.lein/profiles.clj` file:
204
231
205
-
{:user {:puppetserver-heap-size "6G"
206
-
...}}
232
+
```clojure
233
+
{:user {:puppetserver-heap-size"6G"
234
+
...}}
235
+
```
207
236
208
237
With the `:puppetserver-heap-size` key defined in the `profiles.clj` file, any subsequent `lein test` run would utilize the associated value for the key. If both the environment variable and the `profiles.clj`
209
238
key are defined, the value from the environment variable takes precedence. When either of these settings is defined, the value is used as both the minimum and maximum JVM heap size.
210
239
211
-
From anecdotal testing from the puppetserver master branch as of 10/26/2016, it appeared that at least a heap size of 5 GB would provide the best performance benefit for full runs of the Clojure unit test
212
-
suite. This value may change over time depending upon how the tests evolve.
240
+
From anecdotal testing, at least a heap size of 5 GB provides the best performance benefit for full runs of the Clojure unit test suite. This value may change over time depending upon how the tests evolve.
213
241
214
242
## Installing Ruby Gems for Development
215
243
216
-
The gems that are vendored with the puppetserver OS packages will be automatically installed into your dev environment by the `./dev-setup` script. If you wish to install additional gems, please see the
244
+
The gems that are vendored with the openvox-server OS packages will be automatically installed into your dev environment by the `./dev-setup` script. If you wish to install additional gems, please see the
217
245
[Gems](./gems.html) document for detailed information.
218
246
219
247
## Debugging
220
248
221
-
For more information about debugging both Clojure and JRuby code, please see [Puppet Server: Debugging](./dev_debugging.html) documentation.
249
+
For more information about debugging both Clojure and JRuby code, please see [OpenVox Server: Debugging](./dev_debugging.html) documentation.
222
250
223
-
## Running PuppetDB
251
+
## Running OpenVoxDB
224
252
225
-
To run a source PuppetDB with Puppet Server, Puppet Server needs standard PuppetDB configuration and how to find the PuppetDB terminus. First copy the `dev/puppetserver.conf` file to another directory. In your
226
-
copy of the config, append a new entry to the `ruby-load-path` list: `<PDB source path>/puppet/lib`. This tells PuppetServer to load the PuppetDB terminus from the specified directory.
253
+
To run a source OpenVoxDB with OpenVox Server, OpenVox Server needs standard OpenVoxDB configuration and how to find the OpenVoxDB terminus. First copy the
254
+
`dev/puppetserver.conf` file to another directory. In your copy of the config, append a new entry to the `ruby-load-path` list: `<PDB source path>/puppet/lib`. This tells
255
+
OpenVox Server to load the OpenVoxDB terminus from the specified directory.
227
256
228
-
From here, the instructions are similar to installing PuppetDB manually via packages. The PuppetServer instance needs configuration for connecting to PuppetDB. Instructions on this configuration are below, but
229
-
the official docs for this can be found [here](https://docs.puppet.com/puppetdb/4.3/connect_puppet_master.html).
257
+
From here, the instructions are similar to installing OpenVoxDB manually via packages. The OpenVox Server instance needs configuration for connecting to OpenVoxDB. See the
258
+
[OpenVoxDB documentation](../../../openvoxdb/latest/connect_puppet_server.html) for details.
230
259
231
260
Update `~/.puppetlabs/etc/puppet/puppet.conf` to include:
232
261
233
-
[master]
234
-
storeconfigs = true
235
-
storeconfigs_backend = puppetdb
236
-
reports = store,puppetdb
262
+
```ini
263
+
[master]
264
+
storeconfigs = true
265
+
storeconfigs_backend = puppetdb
266
+
reports = store,puppetdb
267
+
```
237
268
238
269
Create a new puppetdb config file `~/.puppetlabs/etc/puppet/puppetdb.conf` that contains
239
270
240
-
[main]
241
-
server_urls = https://<MASTERHOST>:8081
271
+
```ini
272
+
[main]
273
+
server_urls = https://<MASTERHOST>:8081
274
+
```
242
275
243
276
Then create a new routes file at `~/.puppetlabs/etc/puppet/routes.yaml` that contains
244
277
245
-
---
246
-
master:
247
-
facts:
248
-
terminus: puppetdb
249
-
cache: yaml
278
+
```yaml
279
+
---
280
+
master:
281
+
facts:
282
+
terminus: puppetdb
283
+
cache: yaml
284
+
```
250
285
251
-
Assuming you have a PuppetDB instance up and running, start your Puppet Server instance with the new puppetserver.conf file that you changed:
286
+
Assuming you have a OpenVoxDB instance up and running, start your OpenVox Server instance with the new puppetserver.conf file that you changed:
252
287
253
-
lein run -c ~/<YOUR CONFIG DIR>/puppetserver.conf
288
+
```bash
289
+
lein run -c ~/<YOUR CONFIG DIR>/puppetserver.conf
290
+
```
254
291
255
-
Depending on your PuppetDB configuration, you might need to change some SSL config. PuppetDB requires that the same CA that signs it's certificate, also has signed Puppet Server's certificate. The easiest way
256
-
to do this is to point PuppetDB at the same configuration directory that Puppet Server and Puppet Agent are pointing to. Typically this setting is specified in the `jetty.ini` file in the PuppetDB conf.d
292
+
Depending on your OpenVoxDB configuration, you might need to change some SSL config. OpenVoxDB requires that the same CA that signs its certificate also has signed OpenVox Server's certificate. The easiest way
293
+
to do this is to point OpenVoxDB at the same configuration directory that OpenVox Server and Puppet Agent are pointing to. Typically this setting is specified in the `jetty.ini` file in the OpenVoxDB conf.d
0 commit comments