Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

12 lines
606 B

#!/bin/sh
set -eo pipefail
mongodump \
{% if graylog_mongo_url | length == 1 and graylog_mongo_pass is defined and graylog_mongo_pass != False %}
{% set graylog_mongo = graylog_mongo_url[0] | urlsplit %}
--uri {{ graylog_mongo['scheme'] }}://{{ graylog_mongo_user }}:{{ graylog_mongo_pass | urlencode | regex_replace('/','%2F') }}@{{ graylog_mongo['hostname'] }}{% if graylog_mongo['port'] %}:{{ graylog_mongo['port'] }}{% endif %}{{ graylog_mongo['path'] }}?{{ graylog_mongo['query'] }} \
{% else %}
--uri {{ graylog_mongo_url[0] }} \
{% endif %}
--quiet --out {{ graylog_root_dir }}/backup/mongo