nylas / ansible-test

An Ansible Testing Framework for Humans
MIT License
171 stars 28 forks source link

su, sudo conflict with become #2

Open gtrummell opened 8 years ago

gtrummell commented 8 years ago

I absolutely love this lightweight and fast testing tool, and that it doesn't require me to install all the weight of test-kitchen to run. However, I'm running into this problem no matter what I do:

Step 8 : CMD /opt/ansible/venv/bin/ansible-playbook -i inventory.yml     -c local -s -e testing=true -e role=$DOCKER_TEST_ROLE     -vvvv playbook.yml; /bin/bash
 ---> Running in 3187901e93db
 ---> b17e33c00016
Removing intermediate container 3187901e93db
Successfully built b17e33c00016
Usage: ansible-playbook playbook.yml

ansible-playbook: error: Sudo arguments ('--sudo', '--sudo-user', and '--ask-sudo-pass') and su arguments ('-su', '--su-user', and '--ask-su-pass') and become arguments ('--become', '--become-user', and '--ask-become-pass') are exclusive of each other

I get the same results with or without adding -vvvv.

SJLC commented 8 years ago

Sounds like you were testing with ansible 1.9, which had some issues with sudo vs become https://github.com/ansible/ansible/issues/10547

That error is gone with the ansible version currently available via pip (2.0.2.0), replaced by a mere warning

[DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user and make sure become_method is 'sudo' 
(default).
This feature will be removed in a future release. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.

I know how to fix the error/warning, maybe I should submit a pull request...