From c95be4ceaa784f0c16d3a9a4ae9342c50c411eac Mon Sep 17 00:00:00 2001 From: Paul Durivage Date: Thu, 19 Dec 2013 15:12:12 -0600 Subject: Make sudo and su command line arguments mutually exclusive --- bin/ansible-playbook | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bin/ansible-playbook') diff --git a/bin/ansible-playbook b/bin/ansible-playbook index 4f8934ebb5..646b64a764 100755 --- a/bin/ansible-playbook +++ b/bin/ansible-playbook @@ -83,6 +83,13 @@ def main(args): parser.print_help(file=sys.stderr) return 1 + # su and sudo command line arguments need to be mutually exclusive + if (options.su or options.su_user or options.ask_su_pass) and \ + (options.sudo or options.sudo_user or options.ask_sudo_pass): + parser.error("Sudo arguments ('--sudo', '--sudo-user', and '--ask-sudo-pass') " + "and su arguments ('-su', '--su-user', and '--ask-su-pass') are " + "mutually exclusive") + inventory = ansible.inventory.Inventory(options.inventory) inventory.subset(options.subset) if len(inventory.list_hosts()) == 0: -- cgit v1.2.1