- コマンド結果によって処理の要否を判断する
register
を使ってコマンド実行結果を変数に格納。ignore_errors
は必須。changed_when
,failed_when
は表示を見やすくするために。
- name: check if YOUR_MODULE is installed
command: /usr/bin/test -e PATH_TO_THE_FILE
$ ./docker_sbt_test.py local/sbt-test --dir /workspace/docker-sbt-test/example --setup " \ | |
rm -fr /workspace/docker-sbt-test && \ | |
git clone --depth 1 https://github.com/mogproject/docker-sbt-test.git /workspace/docker-sbt-test \ | |
" | |
2014-01-11 07:24:53,272 [INFO] Creating test image (local/sbt-test:test-1389425093.27) ... | |
Uploading context 2.048 kB | |
Step 1 : FROM local/sbt-test:latest | |
---> de04dd418dc0 | |
Step 2 : RUN /bin/bash -c " rm -fr /workspace/docker-sbt-test && git clone --depth 1 https://github.com/mogproject/docker-sbt-test.git /workspace/docker-sbt-test " | |
---> Running in 8b9c2b674e0d |
----system---- ---load-avg--- ----total-cpu-usage---- -dsk/total- -net/total- ------memory-usage----- ---paging-- ---system-- -most-expensive- ----most-expensive---- ----most-expensive---- --most-expensive- | |
date/time | 1m 5m 15m |usr sys idl wai hiq siq| read writ| recv send| used buff cach free| in out | int csw | cpu process | i/o process | block i/o process | memory process | |
11-01 07:24:47|0.74 0.79 0.37| 0 0 99 0 0 0| 19k 110k| 0 0 | 409M 221M 1306M 1894M| 50B 125B| 141 166 |docker 0.1|docker 103k 93k|docker 100k 51k|docker 58.0M | |
11-01 07:24:48|0.74 0.79 0.37| 0 2 98 0 0 0| 0 124k| 60B 534B| 410M 221M 1306M 1893M| 0 0 | 135 68 | |sshd: vagra1773B 480B| |docker 58.0M | |
11-01 07:24:49|0.74 0.79 0.37| 1 1 99 0 0 0| 0 0 | 60B 198B| 410M 221M 1306M 1893M| 0 0 | 49 30 | |sshd: vagra 591B 144B|loop1 0 4096B|docker |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
print_histo.py | |
Visualize histogram as text. | |
""" | |
import sys | |
import numpy |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""" | |
Bipartite graph matching algorithm | |
""" | |
import collections | |
class Graph(object): |
for(i<-1 to'd')println(Seq("Fizz"*(1-i%3)+"Buzz"*(1-i%5),""+i)max) |