Macでansibleを使えるようにする

pyenvを入れる

Macには標準でPythonが入っているが、pyenvで環境ごと管理したい

git clone git://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile

python2.7を入れる

3系じゃないのは3系だとAWS系のコマンドで使えないものがあったため

pyenv install 2.7.14
pyenv global 2.7.14

Ansibleを入れる

最初pipで入れるかと思ったらhomebrewで入れられたみたい。

brew install ansible
$ ansible --version
ansible 2.4.1.0
  config file = None
  configured module search path = [u'/Users/homahi/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.4.1.0/libexec/lib/python2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.14 (default, Sep 25 2017, 09:53:22) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]
````