Stories in Ready Build Status Coverage Status Dependency Status Inline docs Gem Version Code Climate

Ogre

This gem supports organization and user management for Enterprise Chef.

While this functionality already exists in knife-opc, we wanted to be able to create the chef policy repository as well and set the private key into vCenter Orchestrator all in one tool.

Installation

There's an open ended dependency on the ChefDK and is expected you have it already installed. The best way to install ogre the least amount of dependencies is to:

chef gem install ogre

Configuration

~/.ogre/config.json

All of the parameters here are optional and can be passed in and/or overriden at the CLI. As of today, the pivotal user is the only user able to execute certain methods via the Chef API. The key can be found in /etc/opscode/pivotal.pem on the Enterprise Chef box.

{
   "run_as":"chef_username",
   "key_path":"/path/to/key.pem",
   "server_url":"https://chef.url",
   "ssl_verify_mode":"true (default) / false",
   "vco_url":"https://vco.url:8281/",
   "vco_user": "domain\\user",
   "vco_password":"password",
   "vco_wf_name":"vco_workflow_name",
   "vco_verify_ssl":"false",
   "repo_url":"https://path.to/skeleton_repo"
}

Usage

ogre org-create ORG DESCRIPTION (options)

  • -p, --create-repo Create Chef policy repository
  • -P, --repo-path Chef policy repo path
  • -I, --license=LICENSE Chef policy repository license
  • -m, --email=EMAIL Chef policy repository e-mail
  • -C, --authors=AUTHORS Chef policy repository authors
  • -r, --repo-url=REPO_URL Chef Policy Repository skeleton url

When using -p, Ogre will save the Chef policy repository as ~/.ogre/ORG-chef, otherwise it will output the validator key for the new organization.

ogre org-delete ORG (options)

  • -f, --force Delete without confirmation

ogre org-list ORG (options)

ogre org-show ORG (options)

Users in the admin group are prefixed with @

ogre user-create USERNAME FIRST_NAME LAST_NAME EMAIL PASSWORD (options)

ogre user-delete USERNAME (options)

  • -f, --force Delete without confirmation

ogre user-list (options)

ogre associate ORG USER (options)

  • -a, --admin Add user to admin group within organization

ogre set-private-key CHEF_HOSTNAME CHEF_VALIDATOR_NAME KEY_PATH (options)

set-private-key is very opinionated to our needs. We have a vco workflow called Set Private Key which takes in CHEF_HOSTNAME, CHEF_VALIDATOR_NAME, and KEY_PATH. This is stored in Orchestrator so that our organzation has the correct permissions to bootstrap nodes.

  • --vco-url vCenter Orchestrator URL
  • --vco-user vCenter Orchestrator user
  • --vco-password vCenter Orchestrator password
  • --vco-wf-name vCenter Orchestrator workflow name
  • --vco-verify-ssl vCenter Orchestrator verify ssl

Contributing

  1. Fork it ( https://github.com/activenetwork-automation/ogre/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License and Authors

License

Copyright: Copyright 2015 ACTIVE Network, LLC
License: Apache License, Version 2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.