adapt playbook to more functions of the python tool

This commit is contained in:
2021-12-23 13:43:02 +01:00
parent de2bd45ae4
commit 9c5b6dce9c
6 changed files with 18 additions and 18 deletions

1
.gitignore vendored
View File

@@ -146,5 +146,6 @@ message*.txt
config.py
inventory.txt
ansible/host_vars/*
!ansible/host_vars/example.tld.yml
!.keep
TODO.md

View File

@@ -0,0 +1,10 @@
---
auth_user: exampleuser
auth_pass: changemenow
domain: autoreply.example.tld
users:
- name: Foobar
email: foobar@example.com
- name: Barbaz
email: barbaz@example.net

View File

@@ -0,0 +1,2 @@
[autoreply_editor]
example.tld

View File

@@ -11,12 +11,6 @@
src: config.py.j2
dest: autoreply-editor/config.py
- name: Create empty message file if it does not exist
copy:
content: ""
dest: "autoreply-editor/{{ message_file }}"
force: no
- name: Install specified python requirements
pip:
requirements: requirements.txt
@@ -45,12 +39,6 @@
path: autoresponders
state: directory
- name: Create autoreply mailbot filter
template:
src: filter-autoreply.j2
dest: .filter-autoreply
mode: 0600
handlers:
- name: reread supervisord
command: supervisorctl reread

View File

@@ -1,3 +1,7 @@
MESSAGE_FILE = "{{ message_file }}"
"""Configuration file"""
# Username and password for logging in to the site
BASIC_AUTH_USERNAME = "{{ auth_user }}"
BASIC_AUTH_PASSWORD = "{{ auth_pass }}"
# List of users. First value is the full name, second the email address
USERS = [{% for user in users %}("{{ user.name }}", "{{ user.email }}"),{% endfor %}]

View File

@@ -1,5 +0,0 @@
logfile "$HOME/mailfilter-autoreply.log"
FROM="{{ mail_from }}"
to "| mailbot -T reply -t $HOME/autoreply-editor/{{ message_file }} -d $HOME/autoresponders/autoresponsedb -N -A 'From: $FROM' /var/qmail/bin/qmail-inject -f ''"