From 869a97e1cb229961d03b25c3d320441615ab5035 Mon Sep 17 00:00:00 2001 From: Lorin Hochstein Date: Fri, 7 Sep 2012 14:34:36 -0400 Subject: [PATCH 1/2] Fix comment in example config file. The config file incorrectly mentions the --private-key-file flag. Should be --private-key --- examples/ansible.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ansible.cfg b/examples/ansible.cfg index ac7fdce3287..f29fd55b58a 100644 --- a/examples/ansible.cfg +++ b/examples/ansible.cfg @@ -21,7 +21,7 @@ module_name = command remote_tmp = $HOME/.ansible/tmp -# the default pattern for ansible-playbooks ("hosts:") +# the default pattern for ansible-playbooks ("hosts:") pattern = * @@ -62,7 +62,7 @@ remote_port=22 #remote_user=root # if set, always use this private key file for authentication, same as if passing -# --private-key-file to ansible or ansible-playbook +# --private-key to ansible or ansible-playbook #private_key_file=/path/to/file From eabbaaec46694d464837468d97678bd1df40aab3 Mon Sep 17 00:00:00 2001 From: Lorin Hochstein Date: Fri, 7 Sep 2012 14:37:32 -0400 Subject: [PATCH 2/2] Have ansible respect private_key_file option The ansible command-line tool was ignoring the private_key_file option. --- lib/ansible/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/utils.py b/lib/ansible/utils.py index 20dfea3c87b..107d7061f92 100644 --- a/lib/ansible/utils.py +++ b/lib/ansible/utils.py @@ -394,7 +394,7 @@ def base_parser(constants=C, usage="", output_opts=False, runas_opts=False, default=constants.DEFAULT_HOST_LIST) parser.add_option('-k', '--ask-pass', default=False, dest='ask_pass', action='store_true', help='ask for SSH password') - parser.add_option('--private-key', default=None, dest='private_key_file', + parser.add_option('--private-key', default=C.DEFAULT_PRIVATE_KEY_FILE, dest='private_key_file', help='use this file to authenticate the connection') parser.add_option('-K', '--ask-sudo-pass', default=False, dest='ask_sudo_pass', action='store_true', help='ask for sudo password')