I’m using Ansible to do an ad-hoc command against multiple systems. The command does a wget and then pipes to sudo sh. Obviously, I’m using the shell module to do this.
Psuedo command: ansible group -B 1800 -P 30 -m shell -a ‘wget -O - http://some.url.com | sudo sh’ --ask-pass --sudo --ask-sudo-pass
Problem is that sometimes, when this is done, sudo password prompt is hidden until user hits enter on keyboard.
With && the things get executed sequentially, with | they get executed almost synchronously, so it has a race condition between your explicit sudo and the sudo ansible runs being fed the password before your’s prompts for it.