# SQLpage This role installs N instances of [SQLpage](https://sql.ophir.dev/) with their corresponding services. * [SQLpage](#sqlpage) * [Variable reference](#variable-reference) * [Mandatory variables](#mandatory-variables) * [Optional variables](#optional-variables) * [Example](#example) * [Update](#update) * [Other information](#other-information) ## Variable reference ### Mandatory variables | Variable | Description | Type of variable | Example value | |----------------------|-------------------------------------------|------------------|---------------| | sqlpage_project_list | list of projects and their configurations | list | see below | ### Optional variables | Variable | Description | Type of variable | Default value | Other value | |---------------------|--------------------------------------------------------------------|------------------|---------------|---------------| | sqlpage_version | version of sqlpage | string | `latest` | `v0.28.0` | ## Example The `mode` variable is used to set the site either in `production` or in `developement` mode (default is `production`). In production mode, error messages are hidden on the web interface, but can be found in the systemd logs, and pages are cached. Additionally, you can set the `debug` variable to true to get more detailed logs (trace) and see exactly what SQLPage is doing The `environment_list` variable is used to define custom environment variables that you can use in sqlpage, follow the documentation: https://sql-page.com/functions.sql?function=environment_variable#function ``` sqlpage_project_list: - name: central port: 8081 dbuser: centralro dbpass: "{{ lookup('hashi_vault', 'secret=cosium-kv/data/inventories/center/group_vars/central')['centralro_dbpassword'] }}" dbhost: "central-db.cosium.com" dbname: central - name: alexandria debug: true port: 8082 dbuser: "alexandria-worker" dbpass: "{{ lookup('hashi_vault', 'secret=cosium-kv/data/services/alexandria')['database_user_alexandria-worker_password'] }}" dbhost: "alexandria-db.cosium.com" dbname: alexandria mode: "development" environment_list: - SFTP_SERVER_HOSTNAME=sftp4.cosium.net ``` # Update To update sqlpage, add this parameter: `--extra-vars '{ "sqlpage_update_now" : true }'`. # Other information You need a reverse proxy in front to forward to the corresponding ports. Also, if you want to have to deploy a git repository to an SQLpage website, you'll need to use the role `git_generic_deploy_files`, for instance: ``` git_generic_deploy_files_list: - repository_url: "ssh://{{ lookup('ansible.builtin.config', 'DEFAULT_REMOTE_USER').split('-')[1] }}@gerrit.cosium.com:29418/sqlpage-central" branch: master deploy_directory: "/srv/central" ```