2016-04-17 20:40:20 +06:00

26 lines
469 B
YAML

# test.yml
---
- hosts: localhost
become: no
gather_facts: no
tasks:
- name: Run MongoDB cluster in Docker
docker:
name: "{{ item }}"
image: "{{ image_name }}"
command: "/sbin/init"
state: started
with_items:
- mongo1
- mongo2
- mongo3
- hosts: "{{ target }}"
become: no
gather_facts: yes
roles:
- role: greendayonfire.mongodb
when: "'mongo' in group_names"