Ok i have a software that always when restart needs to insert password is
really pain in the ass so i trying to automate
This is my playbook
# tasks file for terminal
- name: restart terminal <--this is working fine
service: name=terminal state=restarted
Ok here is the problem after restart the sever i need to see in the logs of
the application and i found the following
[2016-05-22 04:32:19.581] INFO [Terminal-PasswordCallback] + more stuff in
this line but i would like just to trigger the next task when found the
content into the brackets because info is really common after restart the
log stop specific to get the password
as i said befor the message that my software is waiting for the password
so i create the following regex like waiting for this result to continue
with the next task but is no working at all , i don't know if I'm doing
correctly or something is missing
- name: service ready for password
wait_for: path=/var/point/terminal/logs/terminal.log
search_regex="*INFO [Terminal-PasswordCallback]
if the result is ok now i need to execute another program to ingest the
password
i create the following task for it
- name: execute terminalpasswd
expect:
command: /opt/terminal/terminalpasswd
response:
Please enter password for terminal:"te2331"
when i run the program is give me a prompt that said Please enter password
for terminal in this case i don't sure if this is possible with the expect
or no to ingest the password when the prompt is coming, any suggestions
really appreciate
Thank you
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/72860c48-4757-44a9-9065-92de5d38fdb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.