refs #8025 send-mail made generic
This commit is contained in:
parent
4f20789f61
commit
c8b0d9fb1c
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
- hosts: all
|
||||
tasks:
|
||||
- name: Upgrade system
|
||||
import_role:
|
||||
name: debian-upgrade
|
||||
- name: Upgrade system
|
||||
import_role:
|
||||
name: debian-upgrade
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -1,3 +1,3 @@
|
|||
- hosts: all
|
||||
tasks:
|
||||
- ping:
|
||||
- ping:
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
- hosts: all
|
||||
tasks:
|
||||
- name: Test role
|
||||
import_role:
|
||||
name: debian-base
|
||||
- name: Test role
|
||||
import_role:
|
||||
name: debian-base
|
||||
|
|
|
@ -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:
|
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue