mongo backup

master
omidshj 2025-02-05 20:45:47 +03:30
parent e282152266
commit 36b2bb5d32
1 changed files with 13 additions and 0 deletions

13
mongo backup.yml Normal file
View File

@ -0,0 +1,13 @@
- name: Backup MongoDB Databases
hosts: all
become: yes
tasks:
- name: Backup MongoDB databases
command: >
docker exec {{ mongodb_container }} mongodump
--db {{ item }}
--username {{ mongodb_user }}
--password {{ mongodb_password }}
--authenticationDatabase admin
--out {{ backup_dir }}
with_items: "{{ db_names }}"