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: resolvers:
- '10.0.0.4' - '10.0.0.4'
- '10.0.0.5' - '10.0.0.5'
awx_email: awx@verdnatura.es
awx_pub_key: > awx_pub_key: >
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjeIZVyppFK/dqOUa1PxgSeRVWk7MFmANYvSs+VHHn ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjeIZVyppFK/dqOUa1PxgSeRVWk7MFmANYvSs+VHHn
D4/BE//K8AxlxnyLl4e6jAcBFoIu1JLxbRKdOhx+Zgkq5OmEzp/XKzfEvnEU5CP+W2+5MwfkUQ3TetJs D4/BE//K8AxlxnyLl4e6jAcBFoIu1JLxbRKdOhx+Zgkq5OmEzp/XKzfEvnEU5CP+W2+5MwfkUQ3TetJs

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,28 +1,28 @@
- hosts: all - hosts: all
serial: 1 serial: 1
tasks: tasks:
- block: - block:
- name: Check if there are missing updates - name: Check if there are missing updates
win_updates: state=searched win_updates: state=searched
register: update_count register: update_count
- block: - block:
- name: Install missing updates only if at least one is missing - name: Install missing updates only if at least one is missing
win_updates: win_updates:
category_names: '*' category_names: '*'
#- Application #- Application
#- Connectors #- Connectors
#- DefinitionUpdates #- DefinitionUpdates
#- DeveloperKits #- DeveloperKits
#- FeaturePacks #- FeaturePacks
#- Guidance #- Guidance
#- ServicePacks #- ServicePacks
#- Tools #- Tools
#- UpdateRollups #- UpdateRollups
#- CriticalUpdates #- CriticalUpdates
#- SecurityUpdates #- SecurityUpdates
log_path: C:\Win_Template_Patch.log log_path: C:\Win_Template_Patch.log
register: update_result register: update_result
- name: Reboot, if needed. - name: Reboot, if needed.
win_reboot: win_reboot:
when: update_result.reboot_required when: update_result.reboot_required
when: update_count.found_update_count|int >= 1 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: community.general.mail:
host: smtp.verdnatura.es host: "{{ smtp_server }}"
port: 465 port: 465
username: awx@verdnatura.es username: "{{ awx_email }}"
password: "{{ awx_smtp_password }}" password: "{{ awx_smtp_password }}"
to: "{{ sysadmin_mail }}" to: "{{ sysadmin_mail }}"
subject: Ansible-test subject: Ansible test
body: System {{ ansible_hostname }} has been send successfully mail. body: System {{ ansible_fqdn }} has sent the email successfully.
delegate_to: localhost delegate_to: localhost