Use galae to send emails using msmtp.

This commit is contained in:
Julien Palard 2023-11-20 23:58:35 +01:00
parent db7c59cc70
commit d455b135d8
Signed by: mdk
GPG Key ID: 0EFC1AC1006886F8
6 changed files with 45 additions and 42 deletions

View File

@ -1,8 +1,6 @@
---
- hosts: mdk
vars:
letsencrypt_email: julien@palard.fr
tasks:
- name: Configure hostname
hostname:
@ -84,20 +82,34 @@
notify: restart sshd
tags: ssh
- name: Setup letsencrypt
include_role: name=julienpalard.nginx_letsencrypt
tags: always
vars:
letsencrypt_certificates:
- [irc.mdk.fr]
- [tuw.fr]
- name: msmtp config
copy:
dest: /etc/msmtprc
content: |
defaults
auth on
tls on
tls_starttls off
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile /var/log/msmtp
- name: Exim4
include_role: name=tschifftner.exim4_sendonly
account galae
auth plain
host mail.galae.net
port 465
from {{ vault_smtp_username }}
user {{ vault_smtp_username }}
password {{ vault_smtp_password }}
account default : galae
- name: Install msmtp
apt:
name: [msmtp, msmtp-mta]
handlers:
- name: reload fail2ban
service: name=fail2ban state=reloaded
- name: reload sshd
- name: restart sshd
service: name=sshd state=restarted

View File

@ -2,3 +2,5 @@
admin_email: julien@palard.fr
gandi_api_key: "{{ vault_gandi_api_key }}"
ansible_user: root
ansible_python_interpreter: /usr/bin/python3

View File

@ -1,10 +1,14 @@
$ANSIBLE_VAULT;1.1;AES256
34336133353038653538313163313464363635306265343938376236623833343365386237306564
3262333664306534306139633466303961356430663738640a353936326262623261313038306465
62653239613636353537626562343163636234353432633664316130376561353035666635373931
3837643533646466620a656363373061323030313361613033613337366362373335626434366237
62303937316532333763396435633864363831346537613864616431396639326462316163623561
39306166316361663466626239663835623031383134663561646530623539623563653331346634
30366463343334393066396338316636356365653634386333643237343634356636633630383637
32633537653034383739303335383630646130646462326565343665646332623662373830356365
6566
65373439643337356162343830646336623863646137656265386537386663363332383833653531
3533623932363765306539363834326133373563363231370a616639616331383930663032326432
30326535303866363130636330396465343966643065666564616665343933653061663939643265
6561353837323236660a663966626237633164383164346165336161616662323466333334326639
30303064303733613562363666613238393138666639346133323635623665336338663766356566
35633637366566393962336265343063366439363439313531396430393331376637656433306561
37333531333739643165386665343332343363636230663662656538376537633131613862353462
39373235333535643866646461383235346464636135333833306134313632633263626235396534
65303335373536356530373937373737333230333433613630613337616562383338613038366133
31613534646663653032623366643530353738356435316633643533353031383436343230353765
34633131333634613535636235363166376636316530393430343330346163646463383162393362
66633735356536616138613562396334616233323037663534313966353633353838646137363166
6562

View File

@ -1,18 +1,5 @@
all:
vars:
ansible_user: root
ansible_python_interpreter: /usr/bin/python3
children:
ctfd:
hosts:
eqy.fr:
ansible_host: 163.172.82.132
mdk:
hosts:
mdk.fr:
ansible_host: 51.15.187.166
online_server: sd-131717
silence:
hosts:
silence:
ansible_host: 192.168.1.210
[mdk]
www.mdk.fr ansible_host=51.15.187.166 online_server=sd-131717
[silence]
silence.local ansible_host=192.168.1.210

View File

@ -2,7 +2,5 @@
roles:
- src: julienpalard.nginx
version: master
- src: tschifftner.exim4_sendonly
version: master
- src: julienpalard.ctfd
version: master

View File

@ -1,7 +1,7 @@
---
- import_playbook: base.yml
- import_playbook: cert_watch.yml
- import_playbook: common.yml
- import_playbook: pasteque.yml
- import_playbook: static_websites.yml
- import_playbook: weechat.yml