Giter Club home page Giter Club logo

chef-services's Introduction

chef-services

kitchen list
kitchen converge

Stands up:

  1. chef-server
  2. automate
  3. build-node
  4. supermarket
  5. compliance

Chef server
user/password: delivery/delivery
http://chef.services.com

Automate server
Get Automate credentials for admin login
kitchen exec [AUTOMATE KITCHEN INSTANCE NAME] -c 'cat /tmp/test.creds'
"http://automate.services.com"

Supermarket
http://supermarket.services.com

Compliance
user/password: admin/password (defined on first login)
http://compliance.services.com

Available Attributes

default['delivery']['version'] = 'latest'
default['delivery']['chef_server'] = 'https://chef.services.com/organizations/delivery'
default['delivery']['enterprise_name'] = 'Chef' ## Set this to your desired enterprise name
default['compliance']['version'] = 'latest'
default['compliance']['package_source'] = nil
default['compliance']['channel'] = :stable
default['compliance']['accept_license'] = false
default['chefdk']['bashrc'] = '/etc/bashrc'
default['chefdk']['version'] = '0.17.17' ## Use a sem-ver value, not 'latest'

Steps

Once kitchen converge has stood up your stack, perform the following steps to complete the configuration of your Automate organization and pipeline.

1. Add this to your local workstation /etc/hosts
33.33.33.10 chef.services.com
33.33.33.11 automate.services.com
33.33.33.12 build.services.com
33.33.33.13 supermarket.services.com
33.33.33.14 compliance.services.com
2. Create Automate user account

Log in to Automate server (creds above) and create a user account; assign all permissions (can edit later). Insert the public half of a keypair that exists on your local workstation. Log out and log in with the new user account. Create a new organization

3. Create Chef server admin account

Log in to Chef server via kitchen from the chef-services repo directory and create admin user
kitchen login [CHEF SERVER KITCHEN INSTANCE NAME]
sudo chef-server-ctl user-create [USERNAME] [FIRST NAME] [LAST NAME] [EMAIL] [PASSWORD] --filename [FILE PATH]

Copy contents of output file to clipboard or local workstation file as [USERNAME].pem Exit kitchen ssh session.
exit

Log in to Chef server with delivery account; select organization from Administration tab and click invite user; indicate the newly created admin user to be added and click Invite.
Log in to Chef server with admin account, accept invite.
Log in to Chef server with delivery account; select Administration tab; select Admins group from left pane and add newly created admin user to the admin group.

4. Prep local workstation for Automate Project

Create directory matching enterprise name. Create subdirectory with organization name. Create subdirectory cookbooks.
Within organization directory, create .chef directory.
Move or create private key file (from step 3 above) into .chef directory.
From Chef server UI, download knife.rb file for your Chef org and move into .chef directory.
From within organization directory, setup connection to Automate
delivery setup --server=automate.services.com --ent=[ENTERPRISE NAME --org=[ORGANIZATION NAME] --user=[AUTOMATE USER]

Fetch Chef server SSL certificates to local workstation
knife ssl fetch

Verify connectivity to Chef server
knife cookbook list

5. Setup local Project to verify workflow

From within cookbooks directory, git clone some project repo, CD into directory, and push code to Chef server.
berks install
berks upload --no-ssl-verify

From within cookbooks directory, git clone delivery-base cookbook (used for environment nodes), CD into directory, and push code to Chef server.
berks install
berks upload --no-ssl-verify

Verify connection for local workstation to Automate built-in github services.
ssh -i [PATH TO AUTOMATE USER PRIVATE KEY] -l [AUTOMATE USER@ORG] -p 8989 automate.services.com

Submit either or both projects to Automate (from within project directory), provide Automate user password when prompted.
delivery init

6. Setup environment nodes/stages

Automate can use environment nodes for each of the Acceptance, Union, Rehearsal and Delivery (AURD) stages. Create nodes for each and bootstrap them to the Chef server from the organization directory of your workstation.
knife bootstrap acceptance.services.com --ssh-user vagrant --sudo --node-name acceptance --yes
knife bootstrap union.services.com --ssh-user vagrant --sudo --node-name union --yes
knife bootstrap rehearsal.services.com --ssh-user vagrant --sudo --node-name rehearsal --yes
knife bootstrap delivered.services.com --ssh-user vagrant --sudo --node-name delivered --yes

Create environments to be associated to each environment node. Acceptance stages typically follows the naming convention [STAGE]-[ENTERPRISE]-[ORGANIZATION]-[PROJECT]-[PIPELINE].
knife environment create acceptance-[ORGANIZATION]-[PROJECT]-[PIPELINE] -d "The acceptance environment" knife environment create union -d "The union environment" knife environment create rehearsal -d "The rehearsal environment" knife environment create delivered -d "The delivered environment"

Associate each environment to an environment node.
knife node environment_set acceptance acceptance-[ORGANIZATION]-[PROJECT]-[PIPELINE] knife node environment_set union union knife node environment_set rehearsal rehearsal knife node environment_set delivered delivered

Add the delivery-base cookbook to each environment node run-list.
knife node run_list add acceptance 'recipe[delivery-base]' knife node run_list add union 'recipe[delivery-base]' knife node run_list add rehearsal 'recipe[delivery-base]' knife node run_list add delivered 'recipe[delivery-base]'

Verify environment nodes are available to accept jobs
knife node status

License

Author:
Copyright: Copyright 2008-2016, Chef Software, Inc.
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.

chef-services's People

Contributors

larryebaum avatar mtyler avatar stephenlauck avatar

Watchers

 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.