{"id":19109964,"url":"https://github.com/coopdevs/trytond_provision","last_synced_at":"2026-03-19T08:09:57.365Z","repository":{"id":37678082,"uuid":"155861152","full_name":"coopdevs/trytond_provision","owner":"coopdevs","description":"Ansible project to provision a Tryton 3.8 application","archived":true,"fork":false,"pushed_at":"2022-12-08T02:43:13.000Z","size":250,"stargazers_count":1,"open_issues_count":26,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-29T11:58:00.932Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coopdevs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-02T12:10:56.000Z","updated_at":"2025-04-12T15:58:56.000Z","dependencies_parsed_at":"2023-01-25T04:00:24.905Z","dependency_job_id":null,"html_url":"https://github.com/coopdevs/trytond_provision","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coopdevs/trytond_provision","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coopdevs%2Ftrytond_provision","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coopdevs%2Ftrytond_provision/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coopdevs%2Ftrytond_provision/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coopdevs%2Ftrytond_provision/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coopdevs","download_url":"https://codeload.github.com/coopdevs/trytond_provision/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coopdevs%2Ftrytond_provision/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29209823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T21:35:21.898Z","status":"ssl_error","status_checked_at":"2026-02-07T21:35:20.106Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T04:23:01.969Z","updated_at":"2026-02-07T22:01:18.691Z","avatar_url":"https://github.com/coopdevs.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tryton Provision\n\nAnsible project to provision and deploy a [Tryton](http://www.tryton.org/) 3.8 server.\n\nThis is intended to be used with Som Connexió's own Tryton repository: https://gitlab.com/coopdevs/somconnexio-tryton-root-project.\n\n\u003c!-- vim-markdown-toc GitLab --\u003e\n\n* [Requirements](#requirements)\n* [Development](#development)\n   * [Fix mount directory](#fix-mount-directory)\n* [Giving access to the server](#giving-access-to-the-server)\n   * [App access](#app-access)\n   * [Admin access](#admin-access)\n* [Production](#production)\n* [Ansible playbooks](#ansible-playbooks)\n   * [Create System Administrators users - `playbooks/sys_admins.yml`](#create-system-administrators-users-playbookssys_adminsyml)\n   * [Provision - `playbooks/provision.yml`](#provision-playbooksprovisionyml)\n   * [Installing and configuring a FTP server - `playbooks/ftp.yml`](#installing-and-configuring-a-ftp-server-playbooksftpyml)\n   * [Further development requirements](#further-development-requirements)\n   * [Manual: Create the database](#manual-create-the-database)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n## Requirements\n\nThis project has been thought to be run against a Debian 9.0 (Stretch) machine.\n\n* Ansible \u003e 2.7\n\n\u003e We are using the Ansible 2.8.5 version.\n\nYou can find more information about Ansible [here](http://docs.ansible.com/)\n\nWe use [Pyenv](https://gitlab.com/coopdevs/ansible-development-environment) to consistently run specific Python and Ansible versions across all machines.\n\nPlease check the installation instructions at [Pyenv's](https://gitlab.com/coopdevs/ansible-development-environment) repository and then run the next commands to generate the `virtualenv`:\n\n```\n$ pyenv install 3.7.4\n$ pyenv virtualenv 3.7.4 trytond_provision\n$ pyenv local trytond_provision\n```\n\nBefore running the next command, make sure that you are in the virtualenv. You can run `python --version` and check if the Python version is `trytond_provision`.\n\n```\n$ pip install -r requirements.txt\n```\n\nAfter installing Ansible, we need to download and install the project dependencies:\n\n```commandline\n$ pyenv exec ansible-galaxy install -r requirements.yml\n```\n## Development\n\nYou can use `devenv` to create an LXC container that you can use to provision a Tryton server. See https://github.com/coopdevs/devenv.\n\nOnce `devenv` is installed, change dir to the directory where you cloned the repository and run:\n\n```commandline\ndevenv\n```\n\nThis will create an LXC container based on Debian Stretch. Now, read [#ansible-playbooks] to provision your newly created container.\n\n### Fix mount directory\n\nFix problem with #14\n\nBefore continue with the documentation, please fix the mount directory in the LXC Configuration file (`/var/lib/lxc/somconnexio/config`). Run:\n\n```commandline\nsudo vim /var/lib/lxc/somconnexio/config\n```\n\nFrom vim, run the command `:%s/opt/home\\/administrator/g` and save.\n\nNote that if you need to develop web forms, you'll also need to add an extra mount entry like\n\n```\nlxc.mount.entry = \u003cpath_to_your_webforms_repo\u003e /var/lib/lxc/somconnexio/rootfs/home/administrator/eticom/wwweticom none bind,create=dir 1.0\n```\n\nNow, restart the container and continue with the documentation.\n\n## Giving access to the server\n\nThere are two access levels to the server: app or admin access. The former can deploy, modify or start/stop/restart the app while the latter has full access to server's configuration.\n\n### App access\n\nIn order to access the server your SSH key should be listed in `tryton_user_keys`. You should open a pull request. You can use [#79](https://github.com/coopdevs/trytond_provision/pull/79) as example.\n\n### Admin access\n\nAdmin access is controled with [playbooks/sys_admins.yml](https://github.com/coopdevs/trytond_provision/blob/master/playbooks/sys_admins.yml). For that playbook to take you into account your SSH key should be listed in `system_administrators`. Check out [Create System Administrators users - `playbooks/sys_admins.yml`](#Create-System-Administrators-users---`playbooks/sys_admins.yml`) for more details.\n\n## Production\n\nTo have access to the production environment with your own user you need to be added to the `ssh-users` group. That's the only group allowed to access via SSH.\n\nYou can do that by running the following:\n\n```\n$ sudo usermod -a -G ssh-users \u003cuser-name\u003e\n```\n\n## Ansible playbooks\n\n### Create System Administrators users - `playbooks/sys_admins.yml`\n\nThis playbook uses Coopdevs' [`sys-admins` role](https://github.com/coopdevs/sys-admins-role) to manage the system administrators users.\n\nBy default a user is created in the target machine, with the public key of your current user assigned.\n\nYou can create new `host_vars` folder with your domain as name, or you can use the existing one (local.tryton.coop).\nModify these vars, which you can find in file `config.yml`:\n\n```YAML\nsystem_administrators_group:      # System administrators group\nsystem_administrators:            # List of system administrators added to the group\n  - name:                         # User name\n    ssh_key:                      # User SSH public key file path\n    state:                        # User state (present/absent)\n```\n\nThe first time you run it against a brand new host you need to run it as root user. You'll also need passwordless SSH access to the root user.\n\n```commandline\npyenv exec ansible-playbook playbooks/sys_admins.yml --limit dev -u root\n```\n\nRun the sysadmin playbook:\n```commandline\npyenv exec ansible-playbook playbooks/sys_admins.yml --limit dev -u USER\n```\n\nFor the following executions, the script will assume that your user is included in the system administrators list for the given host.\nTo run the playbook as a system administrator just use the following command:\n\n```commandline\npyenv exec ansible-playbook playbooks/sys_admins.yml --limit dev\n```\n\nAnsible will try to connect to the host using the system user. If your user as a system administrator is different than your local system user please run this playbook with the correct user using the -u flag.\n\n```commandline\n$ pyenv exec ansible-playbook playbooks/sys_admins.yml --limit dev -u \u003cusername\u003e\n```\n\nOnce this is done, you can check if it works with:\n```commandline\n$ ssh admin@local.tryton.coop\n```\n\nChange the host and user for the ones of your choice if you don't use these default ones.\n\nNow, before following the provision instructions, read the [Configuration variables]() section.\n\n### Provision - `playbooks/provision.yml`\nThis playbook does:\n\n* Create Tryton user and add SSH keys\n* Create Tryton configuration files\n* Create Tryton log configuration files\n* Install the system packages\n* Install PostgreSQL\n* Create PostgreSQL users and databases\n* Install Python development tools\n* Create virtualenv and install Python dependencies\n* Install NodeJS\n* Create Tryton configuration files\n\nTo use, run:\n```commandline\n$ pyenv exec ansible-playbook playbooks/provision.yml -u USER -l HOSTGROUP --ask-vault-pass\n```\n\n### Installing and configuring a FTP server - `playbooks/ftp.yml`\n\nThis playbook uses the [`vsftpd` role](https://github.com/weareinteractive/vsftpd) to manage the FTP server.\n\n### Further development requirements\n\nYou can install some development goodies like ipython, ipdb or tryton_shell by setting var `dev_mode` to `true` in host's vars.\n(./inventory/hosts_vars/loca.tryton.coop/config.yml).\n\n### Manual: Create the database\n\nAfter provisioning and deploying the application, we need to create a development database.\n\nWe use a dump to recreate a DB for development purposes. You need to get a backup and fill the `eticom` database with it:\n\n```commandline\npsql -h 127.0.0.1 -U eticom -W eticom \u003c \u003cYOUR-DUMP\u003e\n```\n\nWith this done, you can manage the app with the following scripts.\n\n```commandline\n./up                        - Start the Tryton server\n./up-web                    - Start the web forms\n./update \u003cmodule_name\u003e      - Update Tryton modules\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoopdevs%2Ftrytond_provision","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoopdevs%2Ftrytond_provision","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoopdevs%2Ftrytond_provision/lists"}