playbooks/mongodb/playbook.yml
2020-05-04 17:05:08 +05:30

27 lines
670 B
YAML
Executable File

#################################################
# DO Community Playbooks: MongoDB
#################################################
---
- hosts: all
become: true
vars_files:
- vars/default.yml
tasks:
- name: Pull default MongoDB image
docker_image:
name: "{{ mongo_image }}"
source: pull
- name: Create MongoDB container
docker_container:
name: "{{ mongo_name }}"
image: "{{ mongo_image }}"
state: started
restart_policy: "unless-stopped"
published_ports:
- 27071:27071
volumes:
- /var/lib/mongodb/data:/data/db
- /var/lib/mongodb/dump:/dump