2014/03/24

ansible config

ansible-playbookの方の-i のデフォルト値は???
あれ、設定ファイルは?ハマった。

If installing ansible from a package manager, the latest ansible.cfg should be present in /etc/ansible,
possibly as a ”.rpmnew” file (or other) as appropriate in the case of updates.
If you have installed from pip or from source, however, you may want to create this file in order to override default settings in Ansible.
==>ないので、自分で作るのね。


優先順位:
* ANSIBLE_CONFIG (an environment variable)
* ansible.cfg (in the current directory)
* .ansible.cfg (in the home directory)
* /etc/ansible/ansible.cfg


ansible.cfg:https://raw.github.com/ansible/ansible/devel/examples/ansible.cfg

内容的には
[defaults]
# some basic default values...

hostfile       = /etc/ansible/hosts
==>This is the default location of the inventory file, script,
 or directory that Ansible will use to determine what hosts it has available to talk to:
hostfile = /etc/ansible/hosts
library        = /usr/share/ansible
remote_tmp     = $HOME/.ansible/tmp
pattern        = *

forks          = 5 
=ー>This is the default number of parallel processes to spawn when communicating with remote hosts.
Since Ansible 1.3, the fork number is automatically limited to the number of possible hosts,
so this is really a limit of how much network and CPU load you think you can handle.

poll_interval  = 15
sudo_user      = root
#ask_sudo_pass = True
#ask_pass      = True
transport      = smart
remote_port    = 22
module_lang    = C

# default user to use for playbooks if user is not specified
# (/usr/bin/ansible will use current user as default)
#remote_user = root