Ansible: remove a program and say 'yes' to the command prompt? -
i trying remove system gem in ansible playbook, command i'm running requires user input before can complete:
- name: uninstall graphviz gem command: sudo -i gem uninstall ruby-graphviz sudo: true
when run playbook find ansible hangs when gets code above. figure it's because user input required in order complete task.
so how can tell ansible remove gem, , 'yes' follow-up question os might have user?
from documentation:
rubygems ask confirmation if attempting uninstall gem dependency of existing gem. can use –ignore-dependencies option skip check.
so change command gem uninstall --ignore-dependencies ruby-graphviz
.
p.s. should better use sudo
or become
directives instead of sudo command.