test mail role

This commit is contained in:
Ruben Blanco 2024-05-24 13:37:16 +02:00
parent d064b94993
commit d07393cbd4
3 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,12 @@
---
- hosts: localhost
become: yes
become_method: sudo
gather_facts: no
tasks:
- name: "[CONFIG SEND MAIL] Send Mail"
import_role:
name: config-send-mail

View File

@ -0,0 +1,15 @@
---
# roles/config-send-mail/tasks/main.yaml
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- name: Sending an e-mail using Verdnatura SMTP servers
community.general.mail:
host: smtp.verdnatura.es
port: 465
username: awx@verdnatura.es
password: "{{ bindsecretawx_password }}"
to: sysadmin@verdnatura.es
subject: Ansible-test
body: System {{ ansible_hostname }} has been send successfully mail.
delegate_to: localhost
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

View File

@ -0,0 +1,10 @@
---
# roles/config-send-mail/vars/main.yaml
bindsecretawx_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
62393936623766653737356136353765336265636136616330306537393638646663326663346138
3631616362363163393036613564623864383365633634660a366563363836363061623566393361
37633364633631333130346332613235303762316435313535613664323830656363353237373561
3866653365636431630a303262666662376662623862663461633361333037643863353135343836
61383730366664353730616331666139376234313562383163613736353231666533