Skip to content
Paul Mackay edited this page May 30, 2016 · 27 revisions

Setup of the Ansible Playbooks

  • Fork the ofn-infra repository.
  • Clone the forked copy:
git clone https://github.com/<your account>/ofn-infra.git

Setup host configuration

Host configuration is divided into group_vars and host_vars. A group stores all the configuration that is common to all servers in that group. For OFN they are typically based on the country.

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

Seed data

OFN is installed with Australia's states by default. The Open Food Foundation collects more localisation data repositories of other countries. They follow the name scheme l10n_<country-code> like l10n_gb or l10n_fr.

If you are the first to run an OFN app for a country, you have to create a repository with that data first. It should contain a file called states.yml.

Publish that repository somewhere accessible for your server. The Open Food Foundation will be happy to put your repository amongst the others. Then change the l10n_repo variable in your vars file to match your repository.

SSL certificate files

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

  • Obtain a certificate from a provider. We recommend Let's Encrypt.
  • 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.

Note: This currently only supports configuring one server at a time.

Next: Provisioning of your server