Monday, July 10, 2017

Configuration File Parameters Tuning

1)  Disabling Host Key Checking

Ansible 1.2.1 and later have host key checking enabled by default.

If a host is reinstalled and has a different key in ‘known_hosts’, this will result in an error message until corrected. If a host is not initially in ‘known_hosts’ this will result in prompting for confirmation of the key, which results in an interactive experience if using Ansible, from say, cron. You might not want this.

If you understand the implications and wish to disable this behavior, you can do so by editing /etc/ansible/ansible.cfg or ~/.ansible.cfg:

[defaults]
host_key_checking = False

Alternatively this can be set by an environment variable:

$ export ANSIBLE_HOST_KEY_CHECKING=False

2)  Control the mechanism for transferring files (In /etc/ansible/ansible.cfg )


#   * smart = try sftp and then try scp [default]
#   * True = use scp only
#   * False = use sftp only
#scp_if_ssh = smart
scp_if_ssh = True

3) control_path = /tmp/ansible-ssh-%%h-%%p-%%r


4) /usr/bin/ansible program used for ad-hoc tasks


5) Playbooks are more likely to be kept in source control and used to push out your configuration or assure the configurations of your remote systems are in spec

6) to enable password based authentication

ask_pass      = True

Modify this setting to true in /etc/ansible/ansible.cfg

No comments:

Post a Comment