rzo 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c21d24014263ebcf5c6697563b1011f6bd2eccc0
4
- data.tar.gz: b97615e5c8e1139fcf0ef8bcb2551485733321ae
3
+ metadata.gz: d67408c1091aa82e515dd92bbd1bbcd1034290e6
4
+ data.tar.gz: 04671d9b7c98f50d71a653489d8862e181cf23a8
5
5
  SHA512:
6
- metadata.gz: eaaadf9a406689d6827dec05a579403be72d3118acf050b4441733a5956dbe6854b704c09b668fc83b22f472aaf5c49fa6864a03ed0a43ecc594795fe6732d6e
7
- data.tar.gz: 1cc68e0ee47ae22c3aa78f40158cc44950e384553a4fdac2e7560a9d324d6c41e9c1803d34df53d8fa72ebfccac7aba0e188f283364e1dda4dfad10e23b656c2
6
+ metadata.gz: a3897968ecc1fb45588f2888003559de212c0f80300d91528cd71ec3a016a1bbe4efe8632574da15dc6995ddc52ae083fd9adca7b4ca74dcb56032c13cc324d4
7
+ data.tar.gz: 6252bd6fec7b7f27912f34e29bd6eb0d29469392d177a9df4077fadde5c33d425c2bed73e24f212268b4e9c6bb4ca5e37d37763577eb80a7c90cda4a6393d750
data/.gitignore CHANGED
@@ -1,3 +1,18 @@
1
+ # Vim
2
+ *.swp
3
+
4
+ # OS X
5
+ .DS_Store
6
+
7
+ # Ruby
8
+ Gemfile.lock
9
+
10
+ # Vagrant
11
+ .vagrant
12
+
13
+ /.envrc
14
+
15
+ # Gem
1
16
  /.bundle/
2
17
  /.yardoc
3
18
  /Gemfile.lock
data/.rubocop.yml ADDED
@@ -0,0 +1,62 @@
1
+ ---
2
+ AllCops:
3
+ DisplayCopNames: true
4
+ DisplayStyleGuide: true
5
+ Exclude:
6
+ - vendor/**/*
7
+ - pkg/**/*
8
+ - spec/fixtures/**/*
9
+ - lib/rzo/trollop.rb
10
+
11
+ # Cop's to ignore
12
+
13
+ Lint/UnneededDisable:
14
+ Enabled: false
15
+
16
+ Layout/MultilineOperationIndentation:
17
+ Enabled: false
18
+
19
+ # With this enabled it suggests a change that will break the Gemfile
20
+ Lint/AssignmentInCondition:
21
+ Enabled: false
22
+
23
+ Metrics/LineLength:
24
+ Enabled: false
25
+
26
+ # This is a good idea, but does not line up the rest of the lines making it
27
+ # harder to read
28
+ Layout/IndentHash:
29
+ Enabled: false
30
+
31
+ Style/Next:
32
+ Enabled: false
33
+
34
+ # If enabled, this cop makes it harder to understand the logic
35
+ Style/NonNilCheck:
36
+ Enabled: false
37
+
38
+ Style/TrailingCommaInLiteral:
39
+ Enabled: false
40
+
41
+ Style/TrailingCommaInArguments:
42
+ Enabled: false
43
+
44
+ # Cop's that require ruby >= 1.9
45
+ Style/HashSyntax:
46
+ Enabled: false
47
+
48
+ Style/BracesAroundHashParameters:
49
+ Enabled: false
50
+
51
+ # too many lines is the nature of a Vagrantfile
52
+ Metrics/BlockLength:
53
+ Enabled: false
54
+
55
+ Metrics/BlockNesting:
56
+ Enabled: false
57
+
58
+ Lint/ShadowingOuterLocalVariable:
59
+ Enabled: false
60
+
61
+ Style/IfInsideElse:
62
+ Enabled: false
data/.simplecov ADDED
@@ -0,0 +1,5 @@
1
+ SimpleCov.start do
2
+ add_filter '/.bundle/'
3
+ add_group 'lib', 'lib'
4
+ end
5
+ # vim:ft=ruby
data/.travis.yml CHANGED
@@ -1,5 +1,14 @@
1
+ ---
1
2
  sudo: false
2
3
  language: ruby
4
+
5
+ notifications:
6
+ email: false
7
+
3
8
  rvm:
9
+ - 2.1.9
4
10
  - 2.4.1
5
- before_install: gem install bundler -v 1.15.3
11
+
12
+ script:
13
+ - 'bundle exec rake validate rubocop'
14
+ - 'bundle exec rspec'
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --markup markdown --private
data/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ # Change Log
2
+
3
+ ## [v0.2.0](https://github.com/ghoneycutt/rizzo/tree/v0.1.0) (2017-08-23)
4
+ **Closed issues:**
5
+
6
+ - configuration language should be YAML instead of JSON [\#4](https://github.com/ghoneycutt/rizzo/issues/4)
7
+
8
+ **Merged pull requests:**
9
+
10
+ - rzo gem \(bundle exec rizzo --help\) [\#8](https://github.com/ghoneycutt/rizzo/pull/8) ([jeffmccune](https://github.com/jeffmccune))
11
+ - Turn into a gem [\#7](https://github.com/ghoneycutt/rizzo/pull/7) ([ghoneycutt](https://github.com/ghoneycutt))
12
+ - Change formatting in README [\#6](https://github.com/ghoneycutt/rizzo/pull/6) ([ghoneycutt](https://github.com/ghoneycutt))
13
+ - Allow multiple nodes to be a puppetmaster [\#3](https://github.com/ghoneycutt/rizzo/pull/3) ([ghoneycutt](https://github.com/ghoneycutt))
14
+ - Add CI testing with Travis-CI [\#2](https://github.com/ghoneycutt/rizzo/pull/2) ([ghoneycutt](https://github.com/ghoneycutt))
15
+
16
+
17
+
18
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/Gemfile CHANGED
@@ -1,6 +1,3 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
1
+ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
5
2
  # Specify your gem's dependencies in rzo.gemspec
6
3
  gemspec
data/Guardfile ADDED
@@ -0,0 +1,41 @@
1
+ # Note: The cmd option is now required due to the increasing number of ways
2
+ # rspec may be run, below are examples of the most common uses.
3
+ # * bundler: 'bundle exec rspec'
4
+ # * bundler binstubs: 'bin/rspec'
5
+ # * spring: 'bin/rspec' (This will use spring if running and you have
6
+ # installed the spring binstubs per the docs)
7
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
8
+ # * 'just' rspec: 'rspec'
9
+ rspec_results = File.expand_path('.rspec_status')
10
+ guard 'yard', server: false do
11
+ watch(%r{app\/.+\.rb})
12
+ watch(%r{lib\/.+\.rb})
13
+ watch(%r{ext\/.+\.c})
14
+ end
15
+
16
+ guard :rubocop do
17
+ watch(/.+\.rb$/)
18
+ watch('Gemfile')
19
+ watch('Guardfile')
20
+ watch('Vagrantfile')
21
+ watch('rzo.gemspec')
22
+ watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
23
+ end
24
+
25
+ guard :rspec, cmd: 'bundle exec rspec', results_file: rspec_results do
26
+ require 'guard/rspec/dsl'
27
+ dsl = Guard::RSpec::Dsl.new(self)
28
+
29
+ # Feel free to open issues for suggestions and improvements
30
+
31
+ # RSpec files
32
+ rspec = dsl.rspec
33
+ watch(rspec.spec_helper) { rspec.spec_dir }
34
+ watch(rspec.spec_support) { rspec.spec_dir }
35
+ watch(rspec.spec_files)
36
+
37
+ # Ruby files
38
+ ruby = dsl.ruby
39
+ dsl.watch_spec_files_for(ruby.lib_files)
40
+ end
41
+ # vim:ft=ruby
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (C) 2016-2017 Garrett Honeycutt <code@garretthoneycutt.com>
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
data/README.md CHANGED
@@ -1,39 +1,327 @@
1
- # Rzo
1
+ # Rizzo
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rzo`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Rizzo is a heavily customized Vagrant configuration and work flow with a
4
+ role based focus. It is meant to make working with Vagrant easier and
5
+ purpose built for layered Puppet control repositories.
4
6
 
5
- TODO: Delete this and the text above, and describe your gem
7
+ There should be at least one node for every role that is managed by a
8
+ control repo. This information is stored in `.rizzo.json` under the
9
+ control repo. This makes it apparent what roles are available and aids
10
+ in functional testing.
6
11
 
7
- ## Installation
12
+ Each control repo must have a directory under it named `modules`. It is
13
+ up to you to populate this, so it works with the common tools such as
14
+ librarian-puppet-simple, librarian-puppet and r10k, without being
15
+ dependent on them.
8
16
 
9
- Add this line to your application's Gemfile:
17
+ Rizzo is named after Rizzo the Rat.
10
18
 
11
- ```ruby
12
- gem 'rzo'
19
+ # Installation
20
+
21
+ Add the rizzo gem to your control repository `Gemfile`. For example, in
22
+ `puppetdata`:
23
+
24
+ ```diff
25
+ diff --git a/Gemfile b/Gemfile
26
+ index 572f681..5c2f3b0 100644
27
+ --- a/Gemfile
28
+ +++ b/Gemfile
29
+ @@ -20,6 +20,7 @@ gem 'puppet-lint-undef_in_function-check'
30
+ gem 'puppet-lint-unquoted_string-check'
31
+ gem 'puppet-lint-variable_contains_upcase'
32
+ gem 'puppet-syntax'
33
+ +gem 'rzo'
34
+
35
+ gem 'serverspec', :require => false
36
+ gem 'vagrant-wrapper', :require => false
37
+ ```
38
+
39
+ Then update the bundle with:
40
+
41
+ ```shell
42
+ bundle install --path .bundle/gems/
43
+ bundle update rzo
44
+ ```
45
+
46
+ Interact with rizzo using:
47
+
48
+ ```shell
49
+ bundle exec rizzo --help
50
+ usage: rizzo [GLOBAL OPTIONS] SUBCOMMAND [ARGS]
51
+ Sub Commands:
52
+
53
+ config Print out the combined rizzo json config
54
+ generate Initialize Vagrantfile in top control repo
55
+
56
+ Global options: (Note, command line arguments supersede ENV vars in {}'s)
57
+ -l, --logto=<s> Log file to write to or keywords STDOUT, STDERR {RZO_LOGTO} (default: STDERR)
58
+ -s, --syslog Log to syslog
59
+ -v, --verbose Set log level to INFO
60
+ -d, --debug Set log level to DEBUG
61
+ -c, --config=<s> Rizzo config file {RZO_CONFIG} (default: ~/.rizzo.json)
62
+ -e, --version Print version and exit
63
+ -h, --help Show this message
13
64
  ```
14
65
 
15
- And then execute:
66
+ Once rizzo is installed, setup your configuration file, `~/.rizzo.json`, then
67
+ use `bundle exec rizzo generate` to write the `Vagrantfile` in your control
68
+ repo.
69
+
70
+ # Dependencies
71
+
72
+ 1. **vagrant-vbguest gem** See
73
+ [https://github.com/dotless-de/vagrant-vbguest](https://github.com/dotless-de/vagrant-vbguest)
74
+
75
+ `vagrant plugin install vagrant-vbguest`
76
+
77
+ 1. **vagrant-proxyconf gem** This is optional. When used, if you have proxy
78
+ settings set in your environment, they will be transferred to the
79
+ guest. See
80
+ [http://tmatilai.github.io/vagrant-proxyconf/](http://tmatilai.github.io/vagrant-proxyconf/)
81
+
82
+ `vagrant plugin install vagrant-proxyconf`
83
+
84
+ # Setup
85
+
86
+ ## `~/.rizzo.json`
87
+
88
+ Change the paths to your git repos
89
+
90
+ ```json
91
+ {
92
+ "defaults": {
93
+ "bootstrap_repo_path": "/Users/gh/git/bootstrap"
94
+ },
95
+ "control_repos": [
96
+ "/Users/gh/git/puppetdata",
97
+ "/Users/gh/git/puppet-modules"
98
+ ],
99
+ "puppetmaster": {
100
+ "name": "infra-puppetca",
101
+ "modulepath": [
102
+ "./modules",
103
+ "./puppetdata/modules",
104
+ "./ghoneycutt/modules"
105
+ ],
106
+ "synced_folders": {
107
+ "/repos/puppetdata": {
108
+ "local": "/Users/gh/git/puppetdata",
109
+ "owner": "root",
110
+ "group": "root"
111
+ },
112
+ "/repos/ghoneycutt": {
113
+ "local": "/Users/gh/git/puppet-modules",
114
+ "owner": "root",
115
+ "group": "root"
116
+ }
117
+ }
118
+ }
119
+ }
120
+ ```
121
+
122
+ Once you have `~/.rizzo.json`, change to your top level control repository and generate your `Vagrantfile`.
123
+
124
+ ```shell
125
+ bundle exec rizzo generate
126
+ ```
127
+ ```
128
+ Wrote vagrant config to Vagrantfile
129
+ ```
130
+
131
+ Once the `Vagrantfile` has been generated, interact with the roles using `vagrant status`.
132
+
133
+ ```shell
134
+ vagrant status
135
+ ```
136
+ ```
137
+ Current machine states:
138
+
139
+ infra-puppetfourca not created (virtualbox)
140
+ infra-puppetfour not created (virtualbox)
141
+ infra-test not created (virtualbox)
142
+
143
+ This environment represents multiple VMs. The VMs are all listed
144
+ above with their current state. For more information about a specific
145
+ VM, run `vagrant status NAME`.
146
+ ```
147
+
148
+ ## Configuration Specification
149
+
150
+ ### defaults
151
+
152
+ The defaults hash is merged with each node entries hash. Put user
153
+ specific entries in `~/.rizzo.json` and project specific entries in
154
+ `${PATH_TO_CONTROL_REPO}/.rizzo.json`.
155
+
156
+ ### control_repos
157
+
158
+ The control_repos array is a list of control repos. Rizzo takes the
159
+ approach that control repos are layered. The ordering should match your
160
+ `puppetmaster['modulepath']` array. The first control repo with a
161
+ `.rizzo.json` in it will have that Rizzo config used.
162
+
163
+ ### puppetmaster
164
+
165
+ This hash is for your puppet master and is specific to that purpose.
166
+
167
+ #### name
168
+
169
+ If the name of the node matches puppetmaster['name'] then that node will
170
+ be treated as a puppetmaster. This will add the synced folders which map
171
+ to your control repos. This allows you to edit code locally using your
172
+ favorite editor and have it immediately available within the
173
+ puppetmaster.
174
+
175
+ #### modulepath
176
+
177
+ An array to describe the modulepath that is used in the puppetmaster's
178
+ environment.conf. This file is available in the `bootstrap_guest_path`
179
+ for use with your bootstrap script.
180
+
181
+ #### synced_folders
182
+
183
+ Hash of hashes for directories that are made available to the guest. The
184
+ key for the hash is the directory under the guest and its keys are
185
+ local, which is the path on the host and owner and group which are the
186
+ owner and group permissions the directory will be mounted with on the
187
+ guest.
188
+
189
+ ## `controlrepo/.rizzo.json`
190
+
191
+ ```json
192
+ {
193
+ "defaults": {
194
+ "bootstrap_script_path": "bootstrap_puppet4.sh",
195
+ "bootstrap_script_args": "-l -f `hostname -f`",
196
+ "bootstrap_guest_path": "/tmp/bootstrap",
197
+ "box": "centos7.box",
198
+ "box_url": "https://vagrantboxes/centos7.box",
199
+ "box_download_checksum": "3764a2c4ae3829aa4b50971e216c3a03736aafb2",
200
+ "box_download_checksum_type": "sha1",
201
+ "memory": "1024",
202
+ "netmask": "255.255.255.0",
203
+ "update_packages": true,
204
+ "update_packages_command": "yum -y update",
205
+ "shutdown": true,
206
+ "shutdown_command": "/sbin/shutdown -h now"
207
+ },
208
+ "nodes": [
209
+ {
210
+ "name": "infra-puppetca",
211
+ "hostname": "infra-puppetca1.example.org",
212
+ "forwarded_ports": [
213
+ {
214
+ "guest": "8140",
215
+ "host": "8140"
216
+ }
217
+ ],
218
+ "ip": "172.16.100.5",
219
+ "memory": "2048"
220
+ },
221
+ {
222
+ "name": "infra-puppet",
223
+ "hostname": "infra-puppet1.example.org",
224
+ "ip": "172.16.100.6",
225
+ "memory": "2048"
226
+ },
227
+ {
228
+ "name": "www-api",
229
+ "hostname": "www-api1.example.org",
230
+ "ip": "172.16.100.7"
231
+ }
232
+ ]
233
+ }
234
+ ```
235
+
236
+ ### defaults
237
+
238
+ This hash is merged with each node entry.
239
+
240
+ ### nodes
241
+
242
+ A list of node entries.
243
+
244
+ #### name
245
+
246
+ Name of the node entry. This is what it will be referred to by Vagrant.
247
+
248
+ #### hostname
249
+
250
+ The FQDN (fully qualified domain name).
251
+
252
+ #### forwarded_ports
253
+
254
+ An optional array of hashes with the key guest and value is the port on
255
+ the guest and the key host and the value is the port on the host. Rizzo
256
+ will check and fail if you use duplicate host ports, as they must be
257
+ unique.
258
+
259
+ #### ip
260
+
261
+ IP address.
262
+
263
+ #### netmask
264
+
265
+ Netmask.
266
+
267
+ #### memory
268
+
269
+ Amount of memory. This should be specified in MB without any unit
270
+ signifier.
271
+
272
+ #### bootstrap_repo_path
273
+
274
+ The path on the host to your bootstrap repo.
275
+
276
+ #### bootstrap_guest_path
277
+
278
+ The path on the guest where the `bootstrap_repo_path` will be mounted.
279
+
280
+ #### bootstrap_script_path
281
+
282
+ Path of script to be used to bootstrap a system. This is relative to
283
+ `bootstrap_guest_path`.
284
+
285
+ #### bootstrap_script_args
286
+
287
+ Any arguments to pass to `bootstrap_script_path`.
288
+
289
+ #### box
290
+
291
+ Name of the Vagrant box.
292
+
293
+ #### box_url
294
+
295
+ URL to the Vagrant box.
16
296
 
17
- $ bundle
297
+ #### box_download_checksum
18
298
 
19
- Or install it yourself as:
299
+ Checksum of the Vagrant box.
20
300
 
21
- $ gem install rzo
301
+ #### box_download_checksum_type
22
302
 
23
- ## Usage
303
+ Type of checksum used in `box_download_checksum`.
24
304
 
25
- TODO: Write usage instructions here
305
+ #### update_packages
26
306
 
27
- ## Development
307
+ Boolean to determine if packages should be updated.
28
308
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
309
+ #### update_packages_command
30
310
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
311
+ Command to update the packages.
32
312
 
33
- ## Contributing
313
+ #### shutdown
34
314
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rzo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
315
+ Boolean to determine if the system should be shutdown after being
316
+ provisioned. This is useful because Rizzo uses
317
+ [vagrant-vbguest](https://github.com/dotless-de/vagrant-vbguest) which
318
+ will check the version of the VirtualBox Guest Additions you have with
319
+ that of the guest VM. If they differ, it will recompile on the guest. If
320
+ the system is not shutdown and just rebooted, then on the next boot the
321
+ guest additions will not work. Instead the system must be brought up
322
+ with `vagrant up node_name` which will activate the vbguest plugin and
323
+ ensure the guest additions are working.
36
324
 
37
- ## Code of Conduct
325
+ #### shutdown_command
38
326
 
39
- Everyone interacting in the Rzo project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/rzo/blob/master/CODE_OF_CONDUCT.md).
327
+ The command used to shutdown the system.
data/Rakefile CHANGED
@@ -1,6 +1,31 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'json'
2
+ require 'rubocop/rake_task'
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
3
5
 
6
+ RuboCop::RakeTask.new
4
7
  RSpec::Core::RakeTask.new(:spec)
5
8
 
6
- task :default => :spec
9
+ desc 'Validation tests'
10
+ task :validate do
11
+ puts '=== Validating JSON (*.json) files'
12
+ filelist = FileList.new('**/*.json')
13
+ filelist.exclude('.bundle/**')
14
+ filelist.each do |json_file|
15
+ puts json_file
16
+ json = File.read(json_file)
17
+ JSON.parse(json)
18
+ end
19
+
20
+ puts "\n=== Validating ruby (*.rb, Vagrantfile, Rakefile and Gemfile) files"
21
+ Dir['**/*.rb', 'Vagrantfile', 'Rakefile', 'Gemfile'].each do |ruby|
22
+ sh "ruby -c #{ruby}"
23
+ end
24
+
25
+ puts "\n=== Validating ERB (*.erb) files"
26
+ Dir['**/*.erb'].each do |erb|
27
+ sh "erb -P -x -T '-' #{erb} | ruby -c"
28
+ end
29
+ end
30
+
31
+ task :default => %i[validate spec]
data/bin/console CHANGED
@@ -1,14 +1,13 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "rzo"
3
+ require 'bundler/setup'
4
+ require 'rzo'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
8
8
 
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
9
+ require 'pry'
10
+ Pry.start
12
11
 
13
- require "irb"
12
+ require 'irb'
14
13
  IRB.start(__FILE__)
data/exe/rizzo ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rzo'
4
+
5
+ app = Rzo::App.new
6
+ exit_code = app.run
7
+ Kernel.exit(exit_code)
data/exe/rzo ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rzo'
4
+
5
+ app = Rzo::App.new
6
+ exit_code = app.run
7
+ Kernel.exit(exit_code)
data/ext/_rizzo.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "defaults": {
3
+ "bootstrap_repo_path": "/Users/jeff/projects/acme/bootstrap"
4
+ },
5
+ "control_repos": [
6
+ "/Users/jeff/projects/acme/puppetdata",
7
+ "/Users/jeff/projects/acme/ghoneycutt-modules"
8
+ ],
9
+ "puppetmaster": {
10
+ "name": [
11
+ "infra-puppetfourca",
12
+ "infra-puppetfour"
13
+ ],
14
+ "modulepath": [
15
+ "./modules",
16
+ "./puppetdata/modules",
17
+ "./ghoneycutt/modules"
18
+ ],
19
+ "synced_folders": {
20
+ "/repos/puppetdata": {
21
+ "local": "/Users/jeff/projects/acme/puppetdata",
22
+ "owner": "root",
23
+ "group": "root"
24
+ },
25
+ "/repos/ghoneycutt": {
26
+ "local": "/Users/jeff/projects/acme/ghoneycutt-modules",
27
+ "owner": "root",
28
+ "group": "root"
29
+ }
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,16 @@
1
+ require 'rzo/app/subcommand'
2
+ module Rzo
3
+ class App
4
+ ##
5
+ # Load all rizzo config files and print the config
6
+ class Config < Subcommand
7
+ attr_reader :config
8
+ def run
9
+ exit_status = 0
10
+ load_config!
11
+ write_file(opts[:output]) { |fd| fd.puts(JSON.pretty_generate(config)) }
12
+ exit_status
13
+ end
14
+ end
15
+ end
16
+ end