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