This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pyenvするのに必要なパッケージ | |
sudo yum install -y vim-enhanced gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel | |
# pyenv インストール | |
cd ~ | |
git clone git://github.com/yyuu/pyenv.git .pyenv | |
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile | |
. ~/.bash_profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: install zabbix-server | |
yum: name={{item}} enablerepo=epel state=installed | |
with_items: | |
- zabbix20-server-mysql | |
- zabbix20-web | |
- MySQL-python | |
tags: zabbix-server | |
- name: add zabbix dbuser | |
mysql_user: login_host=localhost login_user={{ dbroot }} login_password={{ dbpass }} name=zabbix password={{ zabbix_db_pass }} priv=zabbix.*:ALL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: install python (CentOS 6) | |
yum: name={{item}} enablerepo=epel state=installed | |
with_items: | |
- PyYAML | |
- python-paramiko | |
- python-jinja2 | |
when: ansible_os_family == 'RedHat' and ansible_distribution_version.split('.')[0]|int == 6 | |
tags: python | |
- name: install python26 (CentOS 5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FAILED >> { | |
"failed": true, | |
"msg": "Traceback (most recent call last):\r\n\n File \"/home/adminn/.ansible/tmp/ansible-1352204366.62-260359853897483/ping\", line 63, in ?\r\n\n import simplejson as json\r\n\nImportError: No module named simplejson\r\n", | |
"parsed": false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: localhost | |
connection: local | |
gather_facts: no | |
vars: | |
role: common | |
tasks: | |
- name: create directories for ansible files. | |
file: path={{ item }} state=directory | |
with_items: | |
- group_vars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ diff -u <(ssh host1 cat /etc/hosts) <(ssh host2 cat /etc/hsots) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_sudo_cmd(sudo_user, executable, cmd): | |
""" | |
helper function for connection plugins to create sudo commands | |
""" | |
# Rather than detect if sudo wants a password this time, -k makes | |
# sudo always ask for a password if one is required. | |
# Passing a quoted compound command to sudo (or sudo -s) | |
# directly doesn't work, so we shellquote it with pipes.quote() | |
# and pass the quoted string to the user's shell. We loop reading | |
# output until we see the randomly-generated sudo prompt set with |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if err := session.Run("/usr/bin/scp -qrt ./"); err != nil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"exec" | |
"log" | |
"os" | |
) | |
// Pipeline strings together the given exec.Cmd commands in a similar fashion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Subject: =?utf-8?B?6ZW344GE44K144OW44K444Kn44Kv44OI6ZW344GE44K144OW44K4?= | |
=?utf-8?B?44Kn44Kv44OI6ZW344GE44K144OW44K444Kn44Kv44OI6ZW344GE?= | |
=?utf-8?B?44K144OW44K444Kn44Kv44OI6ZW344GE44K144OW44K444Kn44Kv?= | |
=?utf-8?B?44OI6ZW344GE44K144OW44K444Kn44Kv44OI6ZW344GE44K144OW?= | |
=?utf-8?B?44K444Kn44Kv44OI?= | |
MIME-Version: 1.0 | |
Content-Type: text/plain; charset="utf-8" | |
Content-Transfer-Encoding: base64 | |
Message-Id: <20140222115231.8DECE260593@st> | |
Date: Sat, 22 Feb 2014 20:52:31 +0900 (JST) |
OlderNewer