Coder Social home page Coder Social logo

epcim / pantry-chef-repo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chef-boneyard/pantry-chef-repo

1.0 1.0 0.0 60 KB

A Chef Repository For Pantry

Home Page: https://supermarket.chef.io/cookbooks/pantry

License: Apache License 2.0

Ruby 56.45% Shell 25.49% PowerShell 18.06%

pantry-chef-repo's Introduction

Chef Pantry

Welcome to the Pantry!

Pantry is a workstation automation cookbook and Chef repository. The cookbook itself is shared on the Supermarket community site, and has its own git repository.

TL;DR:

git clone https://github.com/chef/pantry-chef-repo
cd pantry-chef-repo
sudo ./bin/pantry -c

Getting Started

Get this repository on your system. You can clone it if you have git installed, or you can download the zip archive.

Once you have the pantry-chef-repo on your system, open a terminal, and run the pantry script with sudo.

To just perform the installation:

sudo ./bin/pantry

To perform the installation and run Chef with the default Policyfile.rb, use the -c option.

sudo ./bin/pantry -c

Installing Packages

Packages are installed by populating attribute arrays with a list of names to install. For OS X, these are handled by the homebrew cookbook's formulas and casks attributes. For Windows, these are handled by Chocolatey.

Update the Policyfile.rb attributes to modify the package lists you want to install.

default['homebrew']['formulas'] = %w(coreutils go postgresql)
default['homebrew']['casks'] = %w(google-chrome skype vagrant)

./bin/pantry will use the Policyfile.rb to add these attributes to the node. Then update the Policyfile.lock.json and export the repository.

chef update
chef export --force zero-repo
sudo chef-client -z

Using a Chef Server

This is optional.

Pantry can be used with a Chef Server. Since this isn't the default, it does require a little more work on your part. For this example, I'll use Hosted Chef as my server.

Note Don't use -c with the bin/pantry script. It assumes running chef-client with local mode.

Before running chef-client, do the following:

Create /etc/chef/client.rb with at least the following content, and copy your organization's validation client key (ORGNAME-validator.pem) to /etc/chef/validation.pem.

chef_server_url 'https://api.opscode.com/organizations/ORGNAME'
validation_client_name 'ORGNAME-validator'

Create .chef/knife.rb or ~/.chef/knife.rb with the following content. Replace ORGNAME and HOSTED_USERNAME with your values.

chef_server_url 'https://api.opscode.com/organizations/ORGNAME'
node_name 'HOSTED_USERNAME'
client_key 'path/to/your/HOSTED_USERNAME.pem'
use_policyfile true
deployment_group 'pantry-chef-server'
versioned_cookbooks true

Obtain the validation client key from your Chef Server. For example, I downloaded mine from the Hosted Chef starter kit. Copy it to /etc/chef.

Upload the cookbooks from this repository.

chef install
chef push

Run Chef!

sudo chef-client

bin/pantry

The pantry script takes 0 or 1 argument. It does the following:

  1. Install ChefDK using CHEF's installation script that downloads the package with the Omnitruck API.
  2. "Vendors" the required cookbooks into zero-repo using Chef Policyfiles.
  3. Optionally runs chef-client (using "local mode") with the base role in this repository if the -c argument is used.

For more information about Policyfiles, see its README.

Scope

Workstations are personalized work environments. Pantry is opinionated where it needs to be and tries to stay out of the way of the user. It is not in the scope to support every possible use case on all workstation operating systems. The primary purpose is to get the base OS environment setup to be able to install packages and software commonly desired for workstation systems, and provide a framework to build upon with other cookbooks.

Requirements

ChefDK: As this is intended to run on a workstation that is presumably also used for Chef development, the default and supported method of installing Chef is using the ChefDK. This is performed by the bin/pantry script.

Administrative/privileged access: Some of the things required to setup a workstation involve root/administrative privileges. As such, chef-client should be invoked using sudo, or otherwise in an administrative shell. Note that this can have interesting interactions with software such as Homebrew, and we've tried to accommodate that. If you encounter any problems, please open an issue.

Platform:

  • OS X 10.9, 10.10
  • Windows 8.1

It may work on other versions of these platforms with or without modification.

Future (planned): Linux (Debian and RHEL families). See Bugs, below.

Bugs

Report issues in this repository. We may close your issue and open it elsewhere if appropriate. For example, supporting other platforms is deferred to the pantry cookbook

Homebrew cask prior to version 0.50.0 has an issue fixed in 0.50.0+ that requires upgrading brew-cask. TL;DR:

brew update && brew upgrade brew-cask && brew cleanup

License and Author

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.

pantry-chef-repo's People

Contributors

epcim avatar jtimberman avatar josegonzalez avatar pmichalec avatar jaym avatar oferrigni avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.