Install and setup PolicydRateGuard for on a Debian mailserver with Postfix.
The role uses the following Ansible modules: apt, pip, git, mysql_db, mysql_user which might have additional dependencies.
It only installs and configures PolicydRateGuard as a daemon (Systemd service) and will not touch your existing Postfix installation. Please follow the Postfix Configuration instructions in PolicydRateGuard's README > Production INSTALL.
Installation from Ansible Galaxy onlime.policyd_rate_guard
:
$ ansible-galaxy install onlime.policyd_rate_guard
Or put the following into your Ansible project's requirements.yml
:
roles:
- name: onlime.policyd_rate_guard
version: main
... and then run:
$ ansible-galaxy install -r requirements.yml
For usage in your own roles, see Role Usage Examples below.
policyd_version
:- Default:
main
- Description: What version of the repository to check out. This can be the literal string
HEAD
, a branch name, or a tag name.
- Default:
policyd_install_path
:- Default:
/opt/policyd-rate-guard
- Description: PolicydRateGuard installation directory.
- Default:
policyd_log_path
:- Default:
/var/log/policyd-rate-guard
- Description: The path to the
policyd-rate-guard.log
log file
- Default:
policyd_sentry_dsn
:- Default:
None
- Description: Enable Sentry exception reporting by entering your Sentry DSN.
- Default:
policyd_mysql_dbname
:- Default:
policyd-rate-guard
- Description: MySQL database name.
- Default:
policyd_mysql_user
:- Default:
policyd
- Description: MySQL database username.
- Default:
policyd_mysql_pass
:- Default:
''
- Description: MySQL database password.
- Default:
Example with minimal customization:
- hosts: smtphosts
roles:
- role: onlime.policyd_rate_guard
policyd_version: stable
policyd_mysql_pass: '{{ vault_policyd_mysql_pass }}'
Important
I recommend to store any credentials like policyd_mysql_pass
in an Ansible vault. Best practice is to name all vault variables with a vault_
prefix, followed by the variable name which you are going to assign it to.
You could also use this Ansible role onlime.policyd_rate_guard
as a dependency in your own role, using the following structure:
roles/myrole/
├── meta
│ └── main.yml
├── tasks
│ └── main.yml
└── vars
└── main.yml
and then put the role's default variables overrides directly into vars/main.yml
:
policyd_version: stable
policyd_mysql_pass: '{{ vault_policyd_mysql_pass }}'
policyd_sentry_dsn: '{{ vault_policyd_sentry_dsn }}'
This role is maintained by Philip Iezzi (Onlime GmbH).