Project configuration for advanced users

📘

This is an article for advanced users of Frontastic.

We've introduced a way to add another ansible-vault for encrypted project configurations. This vault should be just an encrypted version of the project.yml with the necessary overwrites and should be named accordingly:

  • project.yml.crypt for Production project.yml
  • project.yml.staging.crypt for Staging project.yml.staging

These files will then get decrypted on our servers to make them available there.

Sourcing hierarchy

The files are sourced in the following order and values are overwritten by later files:

Production

  1. project.yml
  2. project.yml.crypt

Staging

  1. project.yml
  2. project.yml.staging
  3. project.yml.staging.crypt

Development

  1. project.yml
  2. project.yml.dev

So, if you have the same key-value pair specified in both project.yml and project.yml.dev the .dev one will be used.

Creating the Ansible-Vault

In order to create a vault, you could follow the documentation of Ansible.

Basically, you'll need to run the following command on your shell inside the project's config directory:

# cd to project's config directory, where $PROJECT is something like "demo_de"  
cd $PROJECT/config 
# create the ansible vault there with an vault-id that equals your customer's name, for example, "demo" 
# Keep in mind that it should be a unique password that needs to be known by Frontastic as well, so please don't reuse a password here  
ansible-vault create --vault-id [email protected] project.yml.crypt

The password you choose here needs to be known by Frontastic so that it can be configured on our servers properly. Don't reuse another password here!

Choose any new password you like and get in touch with one of the Frontastic team using the Submit a ticket button so that they can configure the servers properly to use the password you've used so that it gets decrypted on the production and staging machines.

Please don't forget to check in the generated encrypted vault file into Git.

Editing the Ansible-Vault

You could edit the vault by running the following command:

ansible-vault edit --vault-id [email protected] project.yml.crypt

After editing and once the changes are pushed into your master branch, please contact our Support team (using the Submit a ticket button) who will make sure these are applied to your production and/or staging servers.

For further details, see the Ansible documentation.


Did this page help you?