27 lines
670 B
YAML
27 lines
670 B
YAML
|
#################################################
|
||
|
# 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
|