This role installs a multicoop Foodsoft instance at a Debian based system. It uses rbenv to install all necessary Ruby and Rails packages.
A MariaDB server needs to be installed separately.
All the Foodsoft components are started via Systemd services. Puma is used as an application server. Socket activation is enabled.
You can adapt the role to your needs via the following variables. Please note: If there's no default you have to set this variable by yourself (e.g. at your playbook).
Name | Default | Note |
---|---|---|
foodsoft_home |
/opt/foodsoft |
Path to install the Foodsoft instance |
foodsoft_user |
_foodsoft |
System user that runs all services |
foodsoft_user_home |
/var/lib/{{ foodsoft_user }} |
Home directory for the system user |
foodsoft_db |
foodsoft |
Name of the Foodsoft database |
foodsoft_db_user |
foodsoft |
Name of the Foodsoft database user |
foodsoft_db_password |
Database password | |
foodsoft_environment_file |
/etc/foodsoft/foodsoft.conf |
Foodsoft configuration file used by systemd service |
doodsoft_web_service |
foodsoft-web.service |
Name of the Foodsoft systemd web service |
foodsoft_web_socket |
foodsoft-web.socket |
Name of the Foodsoft systemd web socket |
foodsoft_secret_key_base |
autogenerated | Foodsoft Rails secret key base |
foodsoft_smtp_service |
foodsoft-smtp.service |
Name of the Foodsoft systemd SMTP service |
foodsoft_resque_service |
foodsoft-resque.service |
Name of Foodsoft systemd Resque service |
foodsoft_web_bind_ip |
127.0.0.1 |
Listen address for the internal Foodsoft application server |
foodsoft_web_port |
3001 |
Listen port for the internal Foodsoft application server |
foodsoft_redis_url |
redis://127.0.0.1:6379/1 |
URL to the Redis server, Uses the first Redis database |
foodsoft_version |
master |
Foodsoft version to install |
ruby_build_version |
master |
Ruby build version to install |
ruby_path |
{{ foodsoft_user_home }}/.rbenv |
Path to Ruby binaries |
mariadb_socket |
/run/mysqld/mysqld.sock |
MariaDB connection socket |
For outgoing mail delivery the Foodsoft needs to connect to an SMTP server.
Name | Default | Note |
---|---|---|
foodsoft_smtp_address |
127.0.0.1 |
Address of the SMTP server |
foodsoft_smtp_port |
25 |
Port of the SMTP server |
foodsoft_smtp_authentication |
false |
True if your SMTP server requires authentication |
foodsoft_smtp_enable_starttls_auto |
false |
True if your SMTP server only accepts TLS connections |
foodsoft_smtp_user_name |
SMTP user name | |
foodsoft_smtp_password |
SMTP password | |
foodsoft_smtp_domain |
Sender domain | |
foodsoft_smtp_openssl_verify_mode |
Set for certificate verification |
The Foodsoft provides an internal SMTP server that processes incomming mails.
Name | Default | Note |
---|---|---|
foodsoft_smtp_server_host |
127.0.0.1 |
Listen address for the internal Foodsoft SMTP server |
foodsoft_smtp_server_port |
2526 |
Listen port for the internal Foodsoft SMTP server |
It's possbile to access the Sharedlists database
from within the Foodsoft. Just use the following variables to grant the Foodsoft database user
SELECT
access to the Sharedlists database.
Name | Default | Note |
---|---|---|
sharedlists.enabled |
True if you want to connect a Sharedlists database |
|
sharedlists.database |
Name of the sharedlists database |
You can set all possible configuration settings from app_config.yml.SAMPLE via your playbook. Some notes:
- There are no configuration defaults. You have to set everything you want to configure by yourself.
- If you need to quote a configuration setting use double quotes.
- You can add every existing key-value-pair to
foodsoft_config
andfoodsoft_multi_coops_config
. Only the nested configuration settings shown in the example are supported.
---
- name: Playbook to install a Foodsoft instance
hosts:
- << your_host >>
roles:
- role: foodsoft
foodsoft_db_password: abcd1234
foodsoft_config:
default_locale: en
homepage: https://foodcoops.net
multi_coop_install: true
default_scope: "'demo'"
foodsoft_config_notification:
sender_address: '"\"Foodsoft Error\" <[email protected]"'
email_prefix: '"[Foodsoft]"'
foodsoft_config_notification_error_recipients:
- [email protected]
foodsoft_config_notificatopn_feedback_recipients:
- [email protected]
foodsoft_config_contact:
street: Grüne Straße 103
zip_code: "10997"
city: Berlin
country: Deutschland
email: [email protected]
phone: '"030 123 45678"'
foodsoft_config_shared_lists:
adapter: mysql2
host: localhost
database: "{{ sharedlists.database }}"
username: "{{ foodsoft_db_user }}"
password: "{{ foodsoft_db_password }}"
encoding: utf8
socket: "{{ mariadb_socket }}"
foodsoft_config_webstats_tracking_code: |
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
...
</script>
<!-- End Matomo Code -->
foodsoft_multi_coops:
- name: demo
database: foodsoft_demo
config:
use_wiki: false
use_messages: false
- name: myfoodcoop
database: myfoodcoop
config:
default_locale: de
homepage: https://example.org
sharedlists:
enabled: true
database: sharedlists