adapt playbook to more functions of the python tool
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -146,5 +146,6 @@ message*.txt
|
|||||||
config.py
|
config.py
|
||||||
inventory.txt
|
inventory.txt
|
||||||
ansible/host_vars/*
|
ansible/host_vars/*
|
||||||
|
!ansible/host_vars/example.tld.yml
|
||||||
!.keep
|
!.keep
|
||||||
TODO.md
|
TODO.md
|
||||||
|
|||||||
10
ansible/host_vars/example.tld.yml
Normal file
10
ansible/host_vars/example.tld.yml
Normal 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
|
||||||
2
ansible/inventory.sample.txt
Normal file
2
ansible/inventory.sample.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[autoreply_editor]
|
||||||
|
example.tld
|
||||||
@@ -11,12 +11,6 @@
|
|||||||
src: config.py.j2
|
src: config.py.j2
|
||||||
dest: autoreply-editor/config.py
|
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
|
- name: Install specified python requirements
|
||||||
pip:
|
pip:
|
||||||
requirements: requirements.txt
|
requirements: requirements.txt
|
||||||
@@ -45,12 +39,6 @@
|
|||||||
path: autoresponders
|
path: autoresponders
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Create autoreply mailbot filter
|
|
||||||
template:
|
|
||||||
src: filter-autoreply.j2
|
|
||||||
dest: .filter-autoreply
|
|
||||||
mode: 0600
|
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- name: reread supervisord
|
- name: reread supervisord
|
||||||
command: supervisorctl reread
|
command: supervisorctl reread
|
||||||
|
|||||||
@@ -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_USERNAME = "{{ auth_user }}"
|
||||||
BASIC_AUTH_PASSWORD = "{{ auth_pass }}"
|
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 %}]
|
||||||
|
|||||||
@@ -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 ''"
|
|
||||||
Reference in New Issue
Block a user