refs #8025 send-mail made generic

This commit is contained in:
Juan Ferrer 2024-09-24 12:27:24 +02:00
parent 4f20789f61
commit c8b0d9fb1c
10 changed files with 49 additions and 49 deletions

View File

@ -7,6 +7,7 @@ resolv:
resolvers:
- '10.0.0.4'
- '10.0.0.5'
awx_email: awx@verdnatura.es
awx_pub_key: >
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjeIZVyppFK/dqOUa1PxgSeRVWk7MFmANYvSs+VHHn
D4/BE//K8AxlxnyLl4e6jAcBFoIu1JLxbRKdOhx+Zgkq5OmEzp/XKzfEvnEU5CP+W2+5MwfkUQ3TetJs

View File

@ -1,5 +1,5 @@
- hosts: all
tasks:
- name: Upgrade system
import_role:
name: debian-upgrade
- name: Upgrade system
import_role:
name: debian-upgrade

View File

@ -1,5 +1,5 @@
- hosts: all
tasks:
- name: Install and configure Freeradius with TOTP
import_role:
name: freeradius
- name: Install and configure Freeradius with TOTP
import_role:
name: freeradius

View File

@ -1,5 +1,5 @@
- hosts: ns1
tasks:
- name: Configure zone with nsupdate
import_role:
name: nsupdate
- name: Configure zone with nsupdate
import_role:
name: nsupdate

View File

@ -1,3 +1,3 @@
- hosts: all
tasks:
- ping:
- ping:

View File

@ -1,7 +1,6 @@
- hosts: localhost
become: no
become_method: sudo
tasks:
- name: Send mail
import_role:
name: config-send-mail
- name: Send mail
import_role:
name: send-mail

View File

@ -1,5 +1,5 @@
- hosts: all
tasks:
- name: Test role
import_role:
name: debian-base
- name: Test role
import_role:
name: debian-base

View File

@ -1,5 +1,5 @@
- name: Ping Windows hosts
hosts: all
tasks:
- name: Ping Windows hosts
ansible.windows.win_ping:
- name: Ping Windows hosts
ansible.windows.win_ping:

View File

@ -1,28 +1,28 @@
- hosts: all
serial: 1
tasks:
- block:
- name: Check if there are missing updates
win_updates: state=searched
register: update_count
- block:
- name: Install missing updates only if at least one is missing
win_updates:
category_names: '*'
#- Application
#- Connectors
#- DefinitionUpdates
#- DeveloperKits
#- FeaturePacks
#- Guidance
#- ServicePacks
#- Tools
#- UpdateRollups
#- CriticalUpdates
#- SecurityUpdates
log_path: C:\Win_Template_Patch.log
register: update_result
- name: Reboot, if needed.
win_reboot:
when: update_result.reboot_required
when: update_count.found_update_count|int >= 1
- block:
- name: Check if there are missing updates
win_updates: state=searched
register: update_count
- block:
- name: Install missing updates only if at least one is missing
win_updates:
category_names: '*'
#- Application
#- Connectors
#- DefinitionUpdates
#- DeveloperKits
#- FeaturePacks
#- Guidance
#- ServicePacks
#- Tools
#- UpdateRollups
#- CriticalUpdates
#- SecurityUpdates
log_path: C:\Win_Template_Patch.log
register: update_result
- name: Reboot, if needed.
win_reboot:
when: update_result.reboot_required
when: update_count.found_update_count|int >= 1

View File

@ -1,10 +1,10 @@
- name: Send mail using Verdnatura SMTP servers
- name: Send mail using own SMTP server
community.general.mail:
host: smtp.verdnatura.es
host: "{{ smtp_server }}"
port: 465
username: awx@verdnatura.es
username: "{{ awx_email }}"
password: "{{ awx_smtp_password }}"
to: "{{ sysadmin_mail }}"
subject: Ansible-test
body: System {{ ansible_hostname }} has been send successfully mail.
subject: Ansible test
body: System {{ ansible_fqdn }} has sent the email successfully.
delegate_to: localhost