Skip to content

Instantly share code, notes, and snippets.

@shirou
shirou / wait.yml
Created February 26, 2014 08:49
wait until sshd is up.
- name: wait for ping
ping:
register: waiting
until: waiting|success
retries: 10
delay: 20
@shirou
shirou / fluentd_log.py
Last active September 23, 2022 12:34
ansible callback plugin which send log to fluentd.
import json
import urllib
import urllib2
url = 'http://localhost:8888/ansible'
def post(category, data):
data['category'] = category
invocation = data.pop('invocation', None)
---
- hosts: example
gather_facts: no
tasks:
- name: raw
raw: sleep 10 && ls / > /home/hoge/hogehoge
sakura <--> 西海岸
ping (icmp)
round-trip min/avg/max/stddev = 117.985/118.451/127.126/1.422 ms
ぐらいの環境
QoS0
receiver:2014-01-31T10:26:35.783506, QoS:0, msgid:0, sender:2014-01-31T10:26:35.665650, diff:0:00:00.117856
______________________________________________________
< TASK: yum name="{{work_dir}}/{{item}}" state=present >
------------------------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
@shirou
shirou / gist:7280724
Created November 2, 2013 16:29
login as ubuntu, do as www
---
- hosts: test
gather_facts: no
remote_user: ubuntu
sudo: yes
tasks:
- name: get id
shell: id
sudo_user: www
register: hoge
@shirou
shirou / ssh_keyscan.yml
Last active March 6, 2025 06:47
run ssh-keyscan to add keys to known_hosts. This is a playbook for ansible
---
- hosts: all
gather_facts: no
sudo: no
tasks:
- name: run ssh-keyscan to add keys to known_hosts
local_action: shell ssh-keyscan {{ ansible_ssh_host }} >> ~/.ssh/known_hosts
@shirou
shirou / deploy.yml
Last active December 24, 2015 13:09
ansible deploy例
---
- hosts: release
sudo: no
serial: 1
tasks:
- name: git repoのpush
local_action: command git push {{ inventory_hostname }} master
- name: git repoのpull
command: chdir=/home/worker/snowflakes
git pull --rebase origin master
@shirou
shirou / README
Last active November 22, 2016 03:36
add these lines to conf.py
How to write
1. pip install sphinxjp.themecore
2. pip install <なにか新しいtinkererのテーマ> 例: sphinxjp.themes.newtinker
3. 'sphinxjp.themecore' をextentionsに追加する
例: extensions = ['tinkerer.ext.blog', 'tinkerer.ext.disqus', 'sphinxjp.themecore']
4. html_theme = "<なにか新しいtinkererのテーマ>" と書く
5. ヽ(゚∀゚ヽ 三 ノ゚∀゚)ノ ワーイ
@shirou
shirou / gist:6505630
Last active December 22, 2015 17:19
---
- hosts: local
gather_facts: no
user: shirou
vars:
- packages:
- build-essential
- libsqlite3-dev
- libreadline6-dev
- libgdbm-dev