GCE project cheffian-supermarket
Install and configure api_fqdn:
apt-get update
curl https://packagecloud.io/install/repositories/chef/stable/script.deb | bash
apt-get update
apt-get install chef-server-core
echo "api_fqdn \"$(hostname -f)\"" >> /etc/opscode/chef-server.rb
chef-server-ctl reconfigure
Add orgs/user:
chef-server-ctl user-create pdb Peter Burkholder pburkholder@getchef.com TestPassword -f pdb.pem
chef-server-ctl org-create pdb_chef12_org pdb_chef12_org -f pdb_chef12_org.pem -a pdb
echo "oc_id['administrators'] = ['pdb']" >> /etc/opscode/chef-server.rb
chef-server-ctl reconfigure
Configure oc-id
- Navigate to https://chefserver/id
- Click the New Application button and fill in the application name and Redirect url
- Name: supermarket
- Redirect uri: https:///auth/chef_oauth2/callback
- After you click Submit you will be shown the Application Id and Secret strings which you must supply to Supermarket. Copy these down, but don’t worry about losing them. You can always retrieve them from the /id/oauth/applications URL of your Chef server.
Install:
apt-get update
curl https://packagecloud.io/install/repositories/chef/stable/script.deb | apt-get update
apt-get install supermarket
supermarket-ctl reconfigure
Configure /etc/supermarket/supermarket.rb:
default['supermarket']['chef_oauth2_app_id'] = '1fcce03a...67b822d1196'
default['supermarket']['chef_oauth2_secret'] = '9836e5f7d65....b10178ac0d'
default['supermarket']['chef_oauth2_url'] = 'https://chefserver-0.c.cheffian-supermarket.internal'
default['supermarket']['chef_oauth2_verify_ssl'] = false
Reconfigure:
supermarket-ctl reconfigure
Next:
https://supermarket-0.c.cheffian-supermarket.internal/sign-in
You'll be redirected to the oc-id service on chef-server. Sign-in with the credentials you used above, then accept the request to 'Authorize Supermarket to use your Chef account'
Application: supermarket Application Id:
1fc.... 196
Secret:
9836e5f.... a0b10178ac0d
Callback URLs:
https://supermarket/auth/chef_oauth2/callback Authorize http://supermarket/auth/chef_oauth2/callback Authorize http://supermarket-0.c.cheffian-supermarket.internal/auth/chef_oauth2/callback Authorize https://supermarket-0.c.cheffian-supermarket.internal/auth/chef_oauth2/callback Authorize