Xicheng Chang 31a3c755f4 Update: add ansible code
Ansible for installing:
Chef(host)
Cobbler
Compass
Currently only three components being on the same host is supported.

Change-Id: I1f36ee77546d3e5734a69660dde9edc41dc8ea13
2015-01-28 10:46:52 -08:00

15 lines
452 B
YAML

---
- name: check if docker is running
command: ps -ef
register: processes
- name: check if there is containers if docker is running
command: docker ps -a
register: containers
when: processes.stdout.find("docker") != -1
- name: write files if container exists
local_action: file path="/tmp/{{ container_name }}" mode=0644 state=touch
when: processes.stdout.find("docker") != -1 and containers.stdout.find("{{ container_name }}") != -1