{"id":16164168,"url":"https://github.com/tleguern/ansible-matomo","last_synced_at":"2026-04-28T18:34:44.048Z","repository":{"id":141734163,"uuid":"171307310","full_name":"tleguern/ansible-matomo","owner":"tleguern","description":"Ansible role for Matomo (formerly Piwik)","archived":false,"fork":false,"pushed_at":"2021-11-30T16:20:17.000Z","size":38,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T09:18:10.485Z","etag":null,"topics":["ansible","ansible-role","matomo","piwik"],"latest_commit_sha":null,"homepage":null,"language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tleguern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-18T15:21:24.000Z","updated_at":"2021-11-30T16:20:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"df6948e8-b7c5-4d13-ba45-38f753006e9a","html_url":"https://github.com/tleguern/ansible-matomo","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleguern%2Fansible-matomo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleguern%2Fansible-matomo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleguern%2Fansible-matomo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tleguern%2Fansible-matomo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tleguern","download_url":"https://codeload.github.com/tleguern/ansible-matomo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595378,"owners_count":20963943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ansible","ansible-role","matomo","piwik"],"created_at":"2024-10-10T02:45:31.514Z","updated_at":"2026-04-28T18:34:39.030Z","avatar_url":"https://github.com/tleguern.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ansible-matomo\n\n[![builds.sr.ht status](https://builds.sr.ht/~tleguern/ansible-matomo.svg)](https://builds.sr.ht/~tleguern/ansible-matomo?)\n\nAnsible role for configuring Matomo, formerly known as Piwik.\n\nThis role configures Matomo, formerly known as Piwik, and optionally handle the configuration of MySQL and Nginx for minimal installations.\nIt then download a given release and complete the manual installation process automatically thanks to the [uri](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/uri_module.html) module.\n\nWhat is **not** automatic yet:\n\n- Configuration of the geoip database ;\n- Configuration of the trusted sites ;\n- User creation.\n\nAutomatic testing is provided using molecule's delegated driver and \u003chttps://builds.sr.ht\u003e.\nFor now only the `converge` step is implemented.\n\nIt should be noted that this role is not idempotent yet.\n\n## Requirements\n\n### Debian 9\n\n- python3-openssl\n- php\n- php-curl\n- php-gd\n- php-cli\n- php-mysql\n- php-xml\n- php-mbstring\n- php-fpm\n- python3-mysqldb\n- mysql-server\n- nginx\n- tar\n\nNginx is listed as an example, any http server implementing FastCGI will work.\n\n### OpenBSD 6.8\n\n- php\n- php-gd\n- php-pdo-mysql\n- php-curl\n- gtar\n\nMatomo can be installed in a chroot and works fine with OpenBSD's httpd.\n\n## Role Variables\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `matomo_mysql_database` | Optional definition of the database name | `matomodata` |\n| `matomo_mysql_user` | Optional name for mysql user | `matomo` |\n| `matomo_mysql_password` | Password for `matomo_mysql_user` | |\n| `matomo_name` | The domain name pointing to matomo | mandatory |\n| `matomo_superuser_user` | Name for matomo superuser | mandatory |\n| `matomo_superuser_password` | Password for `matomo_superuser_user` | mandatory |\n| `matomo_superuser_email` | Email address for `matomo_superuser_user` | mandatory |\n| `matomo_version` | The specific matomo version to install | \"3.9.0\" |\n| `matomo_proxy` | Configure matomo to use the X-Forwarded-For header | `no` |\n| `mysql_rescue_user` | Optional rescue mysql user with SUPER and PROCESS rights on `matomo_mysql_database`. Only used if `matomo_bypass_mysql` is not `yes`. | `` |\n| `mysql_rescue_password` | Password for `mysql_rescue_user`. Only used if `matomo_bypass_mysql` is not `yes`. | `` |\n| `matomo_bypass_mysql` | Do not configure mysql | `yes` |\n| `matomo_bypass_nginx` | Do not configure nginx | `yes` |\n| `matomo_www_directory` | Matomo install directory | `/var/www` |\n| `matomo_php_interpreter` | Path to PHP | `{{ __matomo_php_interpreter }}`\n\n### Debian\n\n| Variable | Default |\n|----------|---------|\n| `__matomo_php_interpreter` | `/usr/bin/php` |\n\n### OpenBSD\n\n| Variable | Default |\n|----------|---------|\n| `__matomo_php_interpreter` | `/usr/local/bin/php-7.3` |\n\n## Dependencies\n\nAny role configuring MySQL, such as:\n\n- geerlingguy.mysql\n- tleguern.mysql\n\nAny role configuring a web server, such as:\n\n- geerlingguy.nginx\n- reallyenglish.ansible-role-httpd\n\nA role configuring PHP is a plus.\n\n## Example Playbooks\n\nMinimal installation with included lightweight configuration of Nginx and MySQL on Debian:\n\n```yml\n- hosts: matomo\n  vars:\n    matomo_mysql_password: \"{{ vaulted_matomo_mysql_password }}\"\n    matomo_superuser_user: matomo_admin\n    matomo_superuser_password: \"{{ vaulted_matomo_superuser_password }}\"\n    matomo_name: stats.example.org\n  roles:\n  - role: tleguern.matomo\n```\n\nRegular installation on OpenBSD. Additional steps are needed once the installation is over to open the web server to the Internet:\n\n```yml\n- hosts: matomo\n  vars:\n    matomo_mysql_password: matomo\n    matomo_superuser_password: adminadmin42\n    matomo_version: \"3.9.0\"\n    matomo_name: localhost\n    matomo_superuser_email: admin@example.org\n    mysql_databases:\n      - name: \"{{ matomo_mysql_database }}\"\n    mysql_users:\n      - name: \"{{ matomo_mysql_user }}\"\n        password: \"{{ matomo_mysql_password }}\"\n        priv: \"*.*:FILE/{{ matomo_mysql_database }}.*:SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,CREATE\\ TEMPORARY\\ TABLES,LOCK\\ TABLES\"\n    mysql_db_admin_password: adminpassword\n    httpd_conf_domains:\n      - name: matomo\n        config: |\n          listen on 127.0.0.1 port 80\n          directory index index.php\n          root \"/matomo\"\n          location \"*.php\" {\n            fastcgi socket \"/run/php-fpm.sock\"\n          }\n  pre_tasks:\n    - name: Configure pdo_mysql\n      file:\n        src: \"/etc/php-7.3.sample/{{ item }}\"\n        dest: \"/etc/php-7.3/{{ item }}\"\n        state: link\n      loop: ['pdo_mysql.ini', 'gd.ini', 'curl.ini']\n    - name: Start php-fpm\n      service:\n        name: php73_fpm\n        state: started\n        enabled: yes\n  roles:\n    - role: tleguern.mysql\n    - role: reallyenglish.ansible-role-httpd\n    - role: tleguern.matomo\n```\n\n## License\n\nISC\n\n## Contributing\n\nEither send [send GitHub pull requests](https://github.com/tleguern/ansible-matomo) or [send patches on SourceHut](https://lists.sr.ht/~tleguern/misc).\n\n## Author Information\n\nWritten by Tristan Le Guern on behalf of Deveryware.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftleguern%2Fansible-matomo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftleguern%2Fansible-matomo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftleguern%2Fansible-matomo/lists"}