O comando read
funciona no meu caso:
read -s -p "SUDO Password: " pass
echo "$pass" | sudo -S apt-add-repository -y ppa:ansible/ansible &&
sudo apt-get update &&
sudo apt-get install -y ansible &&
ansible-playbook --extra-vars "ansible_become_pass=$pass" playbook.yml
@Cometsong obrigado pela pista