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.
25 lines
548 B
25 lines
548 B
---
|
|
- hosts: all
|
|
become: yes
|
|
become_user: root
|
|
vars:
|
|
docker_clusterstore: yes
|
|
vagrant: yes
|
|
roles:
|
|
- ../docker
|
|
tasks:
|
|
- name: check consul state
|
|
command: docker ps -q -f name=consul
|
|
register: consulcheck
|
|
changed_when: no
|
|
|
|
- name: ensure consul is running
|
|
command: >
|
|
docker run \
|
|
-d \
|
|
--name consul \
|
|
-p "8500:8500" \
|
|
--restart always \
|
|
progrium/consul -server -bootstrap
|
|
when: consulcheck.stdout_lines | length == 0
|