using the new "become" syntax, how do you configure your playbook to log in to a host as a regular user, switch to the root user and ask for a password?
I tried:
---
- hosts: foo
gather_facts: no
remote_user: martin
become: yes
become_method: su
tasks:
- name: update
yum: name=tree state=latest
This playbook just hands in the TASK
phase. I also tried removing the become_method
and using ansible-playbook book.yml --ask-become-pass
but that also didn't work. Any ideas?
I think I hit something similar to this recently and ended up putting these lines in
ansible.cfg
:I think the
become_user
directive is unnecessary as thats also the default, but I think it was thebecome_ask_pass
that made the difference and stopped it hanging.Hope that helps.