Skip to content
Paul Mackay edited this page Aug 31, 2015 · 27 revisions

Clone ofn_deployment

Clone this project to create a local copy.

Setup host configuration

The playbooks use values set in vars.yml file(s) to accomplish their tasks. Information includes such things as the specific domain name for your OFN system, the password to the database used by OFN, file names, paths, etc. To support one ofn_deployment project being used for multiple servers, each server should have its own set of variables. These files are automatically loaded from the hosts_vars directory.

For example, to create a configuration file for the "www.openfoodnetwork.au" server:

  • Copy the provided vars.example.yml to host_vars/www.openfoodnetwork.au.yml:

cp vars.example.yml host_vars/www.openfoodnetwork.au.yml

  • Edit host_vars/www.openfoodnetwork.au.yml with values appropriate for this server.

If you're not familiar with YAML, read more at the official YAML site.. You can validate the syntax of your vars.yml file with the Online YAML Parser.

Seed data

If you don't want to use seed (initial) data specific to Australia, you need to provide your own country, state and suburb (a.k.a. postcode or zipcode) files for your location.

These are the files that are used for seed data:

  • db/default/spree/states.yml
  • db/default/spree/countries.yml
  • db/suburbs.csv

Look at the existing files in the openfoodnetwork repo for examples of how the files are used.

Put these seed files into a project that is named i10n_<country-code> as a convention, e.g. i10n_gb. The i10n_repo variable can be set to the git repo path, e.g. https://github.com/openfoodfoundation/i10n_au.git.

SSL certificate files

For production and staging environments, you will need SSL certificates for the domain name. (The domain name is specified in the vars.yml file.)

  • Purchase a certificate from a provider.
  • Create two text files: ssl.crt and ssl.key.
  • In ssl.crt add the content of the certificate and chain bundle.
  • In ssl.key add the content of the private key.

Note: the formatting of these text blocks must be that there are no spaces other than in the start/end lines and each line is 64 characters long.

  • Put these in the files folder.