Adoptable Cookbooks List

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Client:
json
{
"id": "client_name",
"chef_server": {
"client_key": "public key contents",
"type": [
"client"
],
"orgs": [ "organization" ]
}
}
Note: If no organization is specified for a client, it will be added
to the default organization. The client enabled and admin settings
can be set at the top level of the chef_server hash or in and orgs
hash as in the User example.

Set path to restore file with node[:chef_server_populator][:restore][:file]

The restore recipe is run if a restore file is set

The restore file can be remote or local

When enabling backups:

Include chef-server-populator::restore recipe

Set backup cron interval with node[:chef_server_populator][:schedule]

Optionally set a remote storage location with node[:chef_server_populator][:backup][:remote][:connection]

Backups include both a pg_dump of the entire chef database and a tarball of the Chef data directory

Public Key Format

The format of the public key specified with the json object needs to be a single line string with new lines
represented with the \n character

You can use one of the below commands to convert your public key file into the correct string format (credit
to the certificates cookbook for these)
cat <filename> | sed s/$/\\\\n/ | tr -d '\n'
-OR-
/usr/bin/env ruby -e 'p ARGF.read' <filename>
-OR-
perl -pe 's!(\x0d)?\x0a!\\n!g' <filename>
If you need to obtain the public key string for your private key first, then run the following on the .pem
file containing the private key
openssl rsa -in <path_to_keyfile>.pem -pubout

Extras

Need to use the IP address of the node for a bit, or another name instead of
having node[:fqdn]?

node[:chef_server_populator][:servername_override]

Keep chef server configured via chef client:

node[:chef_server_populator][:chef_server]

If the hash is non-empty, it will write the chef-server dna.json and trigger a
reconfigure when ever the attributes are updated.

Known Issues

As mentioned above, user and client data bag items currently only
support the first organization provided. Multi-org support is
forthcoming.

Examples

Take a look in the examples directory for basic bootstrap templates that will
build a new erchef server, using existing keys and client, and
register itself, or restore an existing chef server from a backup.

v0.3.0

v0.2.0

Provide distinct solo vs. client recipes

Client recipe configures dna.json and uses ctl for reconfigure

Foodcritic Metric

1.1.0 failed this metric

FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:1FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:2FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:3FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:4FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:5FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:6FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:7FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:8FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:10FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:12FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:15FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:20FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:22FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:24FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:25FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:26FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:28FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:29FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:30FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:31FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:32FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:41FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:47FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:55FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/attributes/default.rb:57FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/backups.rb:1FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/backups.rb:9FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/backups.rb:18FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/backups.rb:22FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/backups.rb:27FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/backups.rb:32FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/backups.rb:38FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/backups.rb:40FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/backups.rb:56FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:3FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:13FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:15FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:16FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:17FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:35FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:146FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:147FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:150FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:151FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:1FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:2FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:5FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:6FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:9FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:10FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:11FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:12FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:13FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:14FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:15FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:16FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:18FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:19FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:20FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:21FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:22FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:23FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:24FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/default.rb:10FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/default.rb:11FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/org.rb:1FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/org.rb:2FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/org.rb:4FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/org.rb:5FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/org.rb:26FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/premium.rb:4FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/restore.rb:2FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/restore.rb:3FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/restore.rb:5FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/restore.rb:9FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/restore.rb:12FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/restore.rb:13FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/restore.rb:15FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/restore.rb:19FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/solo.rb:3FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/solo.rb:4FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/solo.rb:9FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/solo.rb:10FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/solo.rb:12FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/solo.rb:18FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/solo.rb:19FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/solo.rb:21FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/solo.rb:22FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/solo.rb:25FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/solo.rb:26FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/solo.rb:34FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/templates/default/chef-server-backup.rb.erb:7FC002: Avoid string interpolation where not required: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:3FC002: Avoid string interpolation where not required: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/solo.rb:9FC019: Access node attributes in a consistent manner: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/configurator.rb:2FC022: Resource condition within loop may not behave as expected: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:31FC022: Resource condition within loop may not behave as expected: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:47FC022: Resource condition within loop may not behave as expected: /tmp/cook/3b8a0590a7e5135f98da61db/chef-server-populator/recipes/client.rb:51