On 26. aug. 2016 11:16, Andrea Francesco Speziale wrote:
I'm trying to automate a script installation through Ansible in a Vagrant
machine.

I tried a lot to find a solution across the web but the documentation and
the examples are very weak.

That script I'm trying to install is prompting questions that I'm trying to
answer programmatically with the *Ansible Expect Module*.

Ansible Task:

- name: "Running Lisk installation"
  become: True
  become_user: vagrant
  expect:
      command: bash installLisk.sh install -r {{env}}
      responses:
            'Where do you want to install Lisk to? (Default
/home/vagrant)': "/home/vagrant"
            'Would like to install NTP? (y/n):': "y"
      echo: yes

It seems it can't recognize the question or the answer, *this is the error
I'm getting back* from the provisioning

Since responses is regex, you need to escape all the regex special character with a backspace that you mean literally.

--
Kai Stian Olstad

--
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/68edfaf9-80a8-764b-ae06-b8523ef79227%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to