Skip to content

wrightp/ec-tools

Repository files navigation

ec-tools Cookbook

Installs Enterprise Chef tools and provides custom resources

Attributes

ec-tools::default

Key Type Description Default
['chef']['config']['node_name'] String Chef config node name pivotal
['chef']['config']['client_key'] String Chef config client key /etc/opscode/pivotal.pem
['chef']['config']['chef_server_root'] String Chef config server root https://localhost
['chef']['config']['private_key_raw'] String Chef config private key string. Creates ['chef']['config']['client_key'] with provided key value if configured nil
['knife']['admin']['config'] String Knife config file for admin /opt/opscode/embedded/conf/knife-pivotal.rb
['knife']['admin']['bin'] String knife-opc bin file /opt/opscode/embedded/bin/knife-opc

Usage

ec-tools::default

  • Adds Chef bin dir to system path
knife-opc
  • Installs the knife-opc gem

  • Creates a knife-opc bin script which is preconfigured and ready to execute

    knife-opc user list

ec-tools::databags

user

{
  "id": "rockawesome",
  "first_name": "Fred",
  "last_name": "Mercury",
  "email": "[email protected]",
  "password": "bohemian"
}

org

{
  "id":"neworgrockawesome",
  "description": "My New Org",
  "users" : [
    "rockawesome"
  ],
  "groups" : {
    "admins" : [
      "rockawesome"
    ],
    "billing-admins" : [
      "rockawesome"
    ]
  }
}

Resources

 myuser = 'fred'

 chef_user myuser do
    action :create
    first_name 'Fred'
    last_name 'Mercury'
    email "#{myuser}@getchef.com"
    password 'bohemian'
 end

  chef_org 'neworg' do
    action :create
    description 'My Organization'
    users myuser # associates user with org. Supports String or an Array of users.
 end

 [ 'admins', 'billing-admins' ].each do |group|
   chef_group group do
     action :add
     org myuser
     users [ myuser ]
   end
 end
  • When a user is created the private key is saved as a databag item (user/fred.json, org/neworg.json)

Plans

  • add more knife-opc commands as resources
  • install knife-acl and knife-opc-backup
  • add knife-acl and knife-opc-backup commands as resources
  • chef server status resources (commands as well?)

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request using Github

License and Authors

Authors: Patrick Wright

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages