ogre 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/README.md +16 -2
  4. data/lib/ogre.rb +10 -0
  5. data/lib/ogre/config.rb +2 -0
  6. data/lib/ogre/messages.rb +12 -0
  7. data/lib/ogre/org-create.rb +30 -6
  8. data/lib/ogre/org-list.rb +13 -0
  9. data/lib/ogre/org-show.rb +45 -0
  10. data/lib/ogre/runner.rb +0 -2
  11. data/lib/ogre/user-list.rb +13 -0
  12. data/lib/ogre/version.rb +2 -2
  13. data/ogre.gemspec +5 -4
  14. data/spec/fixtures/vcr_cassettes/org-list.yml +73 -0
  15. data/spec/fixtures/vcr_cassettes/org-show.yml +205 -0
  16. data/spec/fixtures/vcr_cassettes/user-list.yml +75 -0
  17. data/spec/ogre/org-create_spec.rb +3 -2
  18. data/spec/ogre/org-list_spec.rb +26 -0
  19. data/spec/ogre/org-show_spec.rb +27 -0
  20. data/spec/ogre/user-list_spec.rb +26 -0
  21. data/spec/spec_helper.rb +4 -4
  22. metadata +48 -57
  23. data/lib/ogre/skeletons/code_generator/files/default/chefignore +0 -95
  24. data/lib/ogre/skeletons/code_generator/files/default/cookbook_readmes/README-policy.md +0 -9
  25. data/lib/ogre/skeletons/code_generator/files/default/cookbook_readmes/README.md +0 -54
  26. data/lib/ogre/skeletons/code_generator/files/default/gitignore +0 -16
  27. data/lib/ogre/skeletons/code_generator/files/default/repo/README.md +0 -66
  28. data/lib/ogre/skeletons/code_generator/files/default/repo/cookbooks/example/attributes/default.rb +0 -7
  29. data/lib/ogre/skeletons/code_generator/files/default/repo/cookbooks/example/metadata.rb +0 -3
  30. data/lib/ogre/skeletons/code_generator/files/default/repo/cookbooks/example/recipes/default.rb +0 -8
  31. data/lib/ogre/skeletons/code_generator/files/default/repo/data_bags/README.md +0 -58
  32. data/lib/ogre/skeletons/code_generator/files/default/repo/data_bags/example/example_item.json +0 -4
  33. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/README.md +0 -9
  34. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/_default.json +0 -9
  35. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/dev.json +0 -21
  36. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/example.json +0 -13
  37. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/int.json +0 -21
  38. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/prod.json +0 -21
  39. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/qa.json +0 -21
  40. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/stage.json +0 -21
  41. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/README.md +0 -9
  42. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/active-base.json +0 -12
  43. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/example.json +0 -13
  44. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_caeast.json +0 -13
  45. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_canada.json +0 -13
  46. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_cawest.json +0 -13
  47. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_useast.json +0 -13
  48. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_uswest.json +0 -13
  49. data/lib/ogre/skeletons/code_generator/metadata.rb +0 -8
  50. data/lib/ogre/skeletons/code_generator/recipes/repo.rb +0 -52
  51. data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.all_rights.erb +0 -3
  52. data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.apache2.erb +0 -201
  53. data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.gplv2.erb +0 -339
  54. data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.gplv3.erb +0 -674
  55. data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.mit.erb +0 -21
  56. data/lib/ogre/skeletons/code_generator/templates/default/README.md.erb +0 -4
  57. data/lib/ogre/skeletons/code_generator/templates/default/cookbook_file.erb +0 -0
  58. data/lib/ogre/skeletons/code_generator/templates/default/knife.rb.erb +0 -44
  59. data/lib/ogre/skeletons/code_generator/templates/default/metadata.rb.erb +0 -8
  60. data/lib/ogre/skeletons/code_generator/templates/default/repo/gitignore.erb +0 -12
@@ -1,9 +0,0 @@
1
- This directory typically contains Chef cookbooks. This repository was
2
- generated with the '--policy-only' option, which means you have chosen
3
- to use a workflow where each cookbook is treated as an independent
4
- software project. As a result, any cookbooks present in this directory
5
- are independent git projects, and the contents of this directory have
6
- been added to .gitignore.
7
-
8
- Love,
9
- Chef
@@ -1,54 +0,0 @@
1
- This directory contains the cookbooks used to configure systems in your infrastructure with Chef - an example basic cookbook called `example` has been automatically created for you.
2
-
3
- Knife needs to be configured to know where the cookbooks are located with the `cookbook_path` setting. If this is not set, then several cookbook operations will fail to work properly.
4
-
5
- cookbook_path ["./cookbooks"]
6
-
7
- This setting tells knife to look for the cookbooks directory in the present working directory. This means the knife cookbook subcommands need to be run in the `chef-repo` directory itself. To make sure that the cookbooks can be found elsewhere inside the repository, use an absolute path. This is a Ruby file, so something like the following can be used:
8
-
9
- current_dir = File.dirname(__FILE__)
10
- cookbook_path ["#{current_dir}/../cookbooks"]
11
-
12
- Which will set `current_dir` to the location of the knife.rb file itself (e.g. `~/chef-repo/.chef/knife.rb`).
13
-
14
- Configure knife to use your preferred copyright holder, email contact and license. Add the following lines to `.chef/knife.rb`.
15
-
16
- cookbook_copyright "Example, Com."
17
- cookbook_email "cookbooks@example.com"
18
- cookbook_license "apachev2"
19
-
20
- Supported values for `cookbook_license` are "apachev2", "mit","gplv2","gplv3", or "none". These settings are used to prefill comments in the default recipe, and the corresponding values in the metadata.rb. You are free to change the the comments in those files.
21
-
22
- Create new cookbooks in this directory with Knife.
23
-
24
- knife cookbook create COOKBOOK
25
-
26
- This will create all the cookbook directory components. You don't need to use them all, and can delete the ones you don't need. It also creates a README file, metadata.rb and default recipe.
27
-
28
- You can also download cookbooks directly from the Opscode Cookbook Site. There are two subcommands to help with this depending on what your preference is.
29
-
30
- The first and recommended method is to use a vendor branch if you're using Git. This is automatically handled with Knife.
31
-
32
- knife cookbook site install COOKBOOK
33
-
34
- This will:
35
-
36
- * Download the cookbook tarball from the Chef Supermarket.
37
- * Ensure its on the git master branch.
38
- * Checks for an existing vendor branch, and creates if it doesn't.
39
- * Checks out the vendor branch (chef-vendor-COOKBOOK).
40
- * Removes the existing (old) version.
41
- * Untars the cookbook tarball it downloaded in the first step.
42
- * Adds the cookbook files to the git index and commits.
43
- * Creates a tag for the version downloaded.
44
- * Checks out the master branch again.
45
- * Merges the cookbook into master.
46
- * Repeats the above for all the cookbooks dependencies, downloading them from the community site
47
-
48
- The last step will ensure that any local changes or modifications you have made to the cookbook are preserved, so you can keep your changes through upstream updates.
49
-
50
- If you're not using Git, use the site download subcommand to download the tarball.
51
-
52
- knife cookbook site download COOKBOOK
53
-
54
- This creates the COOKBOOK.tar.gz from in the current directory (e.g., `~/chef-repo`). We recommend following a workflow similar to the above for your version control tool.
@@ -1,16 +0,0 @@
1
- .vagrant
2
- Berksfile.lock
3
- *~
4
- *#
5
- .#*
6
- \#*#
7
- .*.sw[a-z]
8
- *.un~
9
-
10
- # Bundler
11
- Gemfile.lock
12
- bin/*
13
- .bundle/*
14
-
15
- .kitchen/
16
- .kitchen.local.yml
@@ -1,66 +0,0 @@
1
- Overview
2
- ========
3
-
4
- Every Chef installation needs a Chef Repository. This is the place where cookbooks, roles, config files and other artifacts for managing systems with Chef will live. We strongly recommend storing this repository in a version control system such as Git and treat it like source code.
5
-
6
- While we prefer Git, and make this repository available via GitHub, you are welcome to download a tar or zip archive and use your favorite version control system to manage the code.
7
-
8
- Repository Directories
9
- ======================
10
-
11
- This repository contains several directories, and each directory contains a README file that describes what it is for in greater detail, and how to use it for managing your systems with Chef.
12
-
13
- * `certificates/` - SSL certificates generated by `rake ssl_cert` live here.
14
- * `config/` - Contains the Rake configuration file, `rake.rb`.
15
- * `cookbooks/` - Cookbooks you download or create.
16
- * `data_bags/` - Store data bags and items in .json in the repository.
17
- * `roles/` - Store roles in .rb or .json in the repository.
18
-
19
- Rake Tasks
20
- ==========
21
-
22
- The repository contains a `Rakefile` that includes tasks that are installed with the Chef libraries. To view the tasks available with in the repository with a brief description, run `rake -T`.
23
-
24
- The default task (`default`) is run when executing `rake` with no arguments. It will call the task `test_cookbooks`.
25
-
26
- The following tasks are not directly replaced by knife sub-commands.
27
-
28
- * `bundle_cookbook[cookbook]` - Creates cookbook tarballs in the `pkgs/` dir.
29
- * `install` - Calls `update`, `roles` and `upload_cookbooks` Rake tasks.
30
- * `ssl_cert` - Create self-signed SSL certificates in `certificates/` dir.
31
- * `update` - Update the repository from source control server, understands git and svn.
32
-
33
- The following tasks duplicate functionality from knife and may be removed in a future version of Chef.
34
-
35
- * `metadata` - replaced by `knife cookbook metadata -a`.
36
- * `new_cookbook` - replaced by `knife cookbook create`.
37
- * `role[role_name]` - replaced by `knife role from file`.
38
- * `roles` - iterates over the roles and uploads with `knife role from file`.
39
- * `test_cookbooks` - replaced by `knife cookbook test -a`.
40
- * `test_cookbook[cookbook]` - replaced by `knife cookbook test COOKBOOK`.
41
- * `upload_cookbooks` - replaced by `knife cookbook upload -a`.
42
- * `upload_cookbook[cookbook]` - replaced by `knife cookbook upload COOKBOOK`.
43
-
44
- Configuration
45
- =============
46
-
47
- The repository uses two configuration files.
48
-
49
- * config/rake.rb
50
- * .chef/knife.rb
51
-
52
- The first, `config/rake.rb` configures the Rakefile in two sections.
53
-
54
- * Constants used in the `ssl_cert` task for creating the certificates.
55
- * Constants that set the directory locations used in various tasks.
56
-
57
- If you use the `ssl_cert` task, change the values in the `config/rake.rb` file appropriately. These values were also used in the `new_cookbook` task, but that task is replaced by the `knife cookbook create` command which can be configured below.
58
-
59
- The second config file, `.chef/knife.rb` is a repository specific configuration file for knife. If you're using the Opscode Platform, you can download one for your organization from the management console. If you're using the Open Source Chef Server, you can generate a new one with `knife configure`. For more information about configuring Knife, see the Knife documentation.
60
-
61
- http://docs.chef.io/knife.html
62
-
63
- Next Steps
64
- ==========
65
-
66
- Read the README file in each of the subdirectories for more information about what goes in those directories.
@@ -1,7 +0,0 @@
1
- # This is a Chef attributes file. It can be used to specify default and override
2
- # attributes to be applied to nodes that run this cookbook.
3
-
4
- # Set a default name
5
- default["example"]["name"] = "Sam Doe"
6
-
7
- # For further information, see the Chef documentation (http://docs.getchef.com/essentials_cookbook_attribute_files.html).
@@ -1,3 +0,0 @@
1
- name 'example'
2
- description 'An example cookbook'
3
- version '1.0.0'
@@ -1,8 +0,0 @@
1
- # This is a Chef recipe file. It can be used to specify resources which will
2
- # apply configuration to a server.
3
-
4
- log "Welcome to Chef, #{node["example"]["name"]}!" do
5
- level :info
6
- end
7
-
8
- # For more information, see the documentation: http://docs.getchef.com/essentials_cookbook_recipes.html
@@ -1,58 +0,0 @@
1
- Data Bags
2
- ---------
3
-
4
- This directory contains directories of the various data bags you create for your infrastructure. Each subdirectory corresponds to a data bag on the Chef Server, and contains JSON files of the items that go in the bag.
5
-
6
- For example, in this directory you'll find an example data bag directory called `example`, which contains an item definition called `example_item.json`
7
-
8
- Before uploading this item to the server, we must first create the data bag on the Chef Server.
9
-
10
- knife data bag create example
11
-
12
- Then we can upload the items in the data bag's directory to the Chef Server.
13
-
14
- knife data bag from file example example_item.json
15
-
16
- For more information on data bags, see the Chef wiki page:
17
-
18
- https://docs.getchef.com/essentials_data_bags.html
19
-
20
- Encrypted Data Bags
21
- -------------------
22
-
23
- Added in Chef 0.10, encrypted data bags allow you to encrypt the contents of your data bags. The content of attributes will no longer be searchable. To use encrypted data bags, first you must have or create a secret key.
24
-
25
- openssl rand -base64 512 > secret_key
26
-
27
- You may use this secret_key to add items to a data bag during a create.
28
-
29
- knife data bag create --secret-file secret_key passwords mysql
30
-
31
- You may also use it when adding ITEMs from files,
32
-
33
- knife data bag create passwords
34
- knife data bag from file passwords data_bags/passwords/mysql.json --secret-file secret_key
35
-
36
- The JSON for the ITEM must contain a key named "id" with a value equal to "ITEM" and the contents will be encrypted when uploaded. For example,
37
-
38
- {
39
- "id": "mysql",
40
- "password": "abc123"
41
- }
42
-
43
- Without the secret_key, the contents are encrypted.
44
-
45
- knife data bag show passwords mysql
46
- id: mysql
47
- password: 2I0XUUve1TXEojEyeGsjhw==
48
-
49
- Use the secret_key to view the contents.
50
-
51
- knife data bag show passwords mysql --secret-file secret_key
52
- id: mysql
53
- password: abc123
54
-
55
-
56
- For more information on encrypted data bags, see the Chef wiki page:
57
-
58
- https://docs.getchef.com/essentials_data_bags.html
@@ -1,4 +0,0 @@
1
- {
2
- "id": "example_item",
3
- "key": "value"
4
- }
@@ -1,9 +0,0 @@
1
- Create environments here, in either the Role Ruby DSL (.rb) or JSON (.json) files. To install environments on the server, use knife.
2
-
3
- For example, in this directory you'll find an example environment file called `example.json` which can be uploaded to the Chef Server:
4
-
5
- knife environment from file environments/example.json
6
-
7
- For more information on environments, see the Chef wiki page:
8
-
9
- https://docs.chef.io/environments.html
@@ -1,9 +0,0 @@
1
- {
2
- "override_attributes": {},
3
- "default_attributes": {},
4
- "chef_type": "environment",
5
- "json_class": "Chef::Environment",
6
- "cookbook_versions": {},
7
- "description": "The default Chef environment",
8
- "name": "_default"
9
- }
@@ -1,21 +0,0 @@
1
- {
2
- "override_attributes": {},
3
- "default_attributes": {
4
- "active_tuned": {
5
- "enabled": true
6
- },
7
- "postfix": {
8
- "relayhost": "lassmtpint.active.local"
9
- },
10
- "chef_client": {
11
- "config": {
12
- "ssl_verify_mode": ":verify_none"
13
- }
14
- }
15
- },
16
- "chef_type": "environment",
17
- "json_class": "Chef::Environment",
18
- "cookbook_versions": {},
19
- "description": "Chef Development Environment",
20
- "name": "dev"
21
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "example",
3
- "description": "This is an example environment defined as JSON",
4
- "chef_type": "environment",
5
- "json_class": "Chef::Environment",
6
- "default_attributes": {
7
- },
8
- "override_attributes": {
9
- },
10
- "cookbook_versions": {
11
- "example": "= 1.0.0"
12
- }
13
- }
@@ -1,21 +0,0 @@
1
- {
2
- "override_attributes": {},
3
- "default_attributes": {
4
- "active_tuned": {
5
- "enabled": true
6
- },
7
- "postfix": {
8
- "relayhost": "lassmtpint.active.local"
9
- },
10
- "chef_client": {
11
- "config": {
12
- "ssl_verify_mode": ":verify_none"
13
- }
14
- }
15
- },
16
- "chef_type": "environment",
17
- "json_class": "Chef::Environment",
18
- "cookbook_versions": {},
19
- "description": "Chef Integration Environment",
20
- "name": "int"
21
- }
@@ -1,21 +0,0 @@
1
- {
2
- "override_attributes": {},
3
- "default_attributes": {
4
- "active_tuned": {
5
- "enabled": true
6
- },
7
- "postfix": {
8
- "relayhost": "lassmtpint.active.local"
9
- },
10
- "chef_client": {
11
- "config": {
12
- "ssl_verify_mode": ":verify_none"
13
- }
14
- }
15
- },
16
- "chef_type": "environment",
17
- "json_class": "Chef::Environment",
18
- "cookbook_versions": {},
19
- "description": "Chef Production Environment",
20
- "name": "prod"
21
- }
@@ -1,21 +0,0 @@
1
- {
2
- "override_attributes": {},
3
- "default_attributes": {
4
- "active_tuned": {
5
- "enabled": true
6
- },
7
- "postfix": {
8
- "relayhost": "lassmtpint.active.local"
9
- },
10
- "chef_client": {
11
- "config": {
12
- "ssl_verify_mode": ":verify_none"
13
- }
14
- }
15
- },
16
- "chef_type": "environment",
17
- "json_class": "Chef::Environment",
18
- "cookbook_versions": {},
19
- "description": "Chef QA Environment",
20
- "name": "qa"
21
- }
@@ -1,21 +0,0 @@
1
- {
2
- "override_attributes": {},
3
- "default_attributes": {
4
- "active_tuned": {
5
- "enabled": true
6
- },
7
- "postfix": {
8
- "relayhost": "lassmtpint.active.local"
9
- },
10
- "chef_client": {
11
- "config": {
12
- "ssl_verify_mode": ":verify_none"
13
- }
14
- }
15
- },
16
- "chef_type": "environment",
17
- "json_class": "Chef::Environment",
18
- "cookbook_versions": {},
19
- "description": "Chef Staging Environment",
20
- "name": "stage"
21
- }
@@ -1,9 +0,0 @@
1
- Create roles here, in either the Role Ruby DSL (.rb) or JSON (.json) files. To install roles on the server, use knife.
2
-
3
- For example, in this directory you'll find an example role file called `example.json` which can be uploaded to the Chef Server:
4
-
5
- knife role from file roles/example.json
6
-
7
- For more information on roles, see the Chef wiki page:
8
-
9
- https://docs.getchef.com/essentials_roles.html
@@ -1,12 +0,0 @@
1
- {
2
- "env_run_lists": {},
3
- "run_list": [
4
- "recipe[active-base]"
5
- ],
6
- "chef_type": "role",
7
- "override_attributes": {},
8
- "default_attributes": {},
9
- "json_class": "Chef::Role",
10
- "description": "active base server role",
11
- "name": "active-base"
12
- }
@@ -1,13 +0,0 @@
1
- {
2
- "name": "example",
3
- "description": "This is an example role defined as JSON",
4
- "chef_type": "role",
5
- "json_class": "Chef::Role",
6
- "default_attributes": {
7
- },
8
- "override_attributes": {
9
- },
10
- "run_list": [
11
- "recipe[example]"
12
- ]
13
- }
@@ -1,13 +0,0 @@
1
- {
2
- "env_run_lists": {},
3
- "run_list": [],
4
- "chef_type": "role",
5
- "override_attributes": {
6
- "location": "caeast",
7
- "tz": "UTC"
8
- },
9
- "default_attributes": {},
10
- "json_class": "Chef::Role",
11
- "description": "Role for Canada ECDC",
12
- "name": "loc_caeast"
13
- }
@@ -1,13 +0,0 @@
1
- {
2
- "env_run_lists": {},
3
- "run_list": [],
4
- "chef_type": "role",
5
- "override_attributes": {
6
- "location": "canada",
7
- "tz": "UTC"
8
- },
9
- "default_attributes": {},
10
- "json_class": "Chef::Role",
11
- "description": "Role for Canada DC",
12
- "name": "loc_canada"
13
- }