--- layout: post title: Installing Supermarket Without a Wrapper Cookbook category: chef_infra tags: [chef, supermarket, installation] summary: Need a quick guide to setup a private Supermarket, but don't want to hassle with making a wrapper cookbook? Read this. --- ## Installing Supermarket The current way of setting up a private Supermarket uses the wrapper cookbook pattern. This method has its benefits. It's repeatable, automated, makes customization easy, etc. If you would like to use this method visit: [https://docs.chef.io/install_supermarket.html](https://docs.chef.io/install_supermarket.html) This guide is for those of you want to setup a private Supermarket but don't want the benefits of using a cookbook. --- ## Guide ### Install the Package 1. Install the Supermarket package: ``` curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chef-server ``` 2. Reconfigure: ``` sudo supermarket-ctl reconfigure ``` ### Configure Authentication via Chef Server 1. On your Chef server add the following to `/etc/opscode/chef-server.rb`: ```ruby oc_id['applications'] ||= {} oc_id['applications']['supermarket'] = { 'redirect_uri' => 'https://YOUR_SUPERMARKET_FQDN/auth/chef_oauth2/callback' } ``` 2. Run the following on your Chef server: ``` sudo chef-server-ctl reconfigure ``` 3. Save the contents of `/etc/opscode/oc-id-applications/supermarket.json`: 4. On the Supermarket server, create `/etc/supermarket/supermarket.json` using: ```text { "chef_server_url": "https://YOUR_CHEF_SERVER_FQDN", "chef_oauth2_app_id": "UID FROM SUPERMARKET JSON (STEP 3)", "chef_oauth2_secret": "SECRET FROM SUPERMARKET JSON (STEP 3)", "chef_oauth2_verify_ssl": false } ``` 5. Reconfigure: ``` sudo supermarket-ctl reconfigure ``` 6. Test the login by going to your Supermarket FQDN and logging in as a Chef user. 7. Authorize Supermarket to use that account. ### Configuring SSL 1. Place the following in `/etc/supermarket/supermarket.rb`: ``` default['supermarket']['nginx']['force_ssl'] = true default['supermarket']['ssl']['certificate'] = '/var/opt/supermarket/ssl/ca/your-host.crt' default['supermarket']['ssl']['certificate_key'] = '/var/opt/supermarket/ssl/ca/your-host.key' ``` 2. Run the following: ``` sudo supermarket-ctl reconfigure ```