Remove gathering facts and correct loop.
This commit is contained in:
@@ -2,12 +2,9 @@
|
|||||||
# This playbooks sends email for backups
|
# This playbooks sends email for backups
|
||||||
- name: Send email for backups
|
- name: Send email for backups
|
||||||
hosts: all
|
hosts: all
|
||||||
gather_facts: true
|
gather_facts: false
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Include variables
|
|
||||||
ansible.builtin.include_vars: vars/hostinger.yaml
|
|
||||||
|
|
||||||
- name: Send email
|
- name: Send email
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg:
|
msg:
|
||||||
@@ -29,8 +26,8 @@
|
|||||||
subject: Datenbank Backup
|
subject: Datenbank Backup
|
||||||
body: Backup der Anwendung wurde erstellt.
|
body: Backup der Anwendung wurde erstellt.
|
||||||
attach:
|
attach:
|
||||||
- "{{ backup_location }}/{{ item[0].name }}/{{ item[0].database[0].container }}-{{ date }}..sql.gz"
|
- "{{ backup_location }}/{{ item[0].name }}/{{ item[0].database[0].container }}-{{ date }}.sql.gz"
|
||||||
loop: "{{ containers | subelements('email') }}"
|
loop: "{{ containers | subelements('email', skip_missing=true) }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item[1] }}"
|
label: "{{ item[1] }}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user